xaml

XamlReader with Click Event

▼魔方 西西 提交于 2021-02-07 10:44:55
问题 I am using XamlReader in my WPF project. And it works (My reference) My current sample Xaml is like that: <Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Width="800" Height="600"> <Button Name="Test1" Content="Test1" Width="357" Height="88" Margin="14,417,0,0" ></Button> <Button Name="Test2" Content="Test2" Width="357" Height="88" Margin="14,529,0,0" ></Button> </Grid> and adding button's click event like this: button = LogicalTreeHelper.FindLogicalNode(rootObject,

Xamarin Dim Page (Master Detail Page)

狂风中的少年 提交于 2021-02-07 09:57:27
问题 So for Android when the master page of a master-detail page is shown the master page is covered with a "black dim" view so it is easy to differentiate the two pages with the eye. In iOS the detail page is not dimmed so it is tougher to differentiate the views. Is there a way to overlay the details page with a BoxView or Frame that is "black translucent" so it dims the page in similar fashion to Android. I have tried many different colors and opacities of a box view but they all completely

How to show a flow document using a DocumentViewer?

坚强是说给别人听的谎言 提交于 2021-02-07 09:32:33
问题 I have a simple flow document in my resources, FlowDocument1.xaml : <FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ColumnWidth="400" FontSize="14" FontFamily="Georgia"> <Paragraph> Test </Paragraph> </FlowDocument> And I want to show this document in a DocumentViewer . I searched for a property that takes path but I couldn't find one. And the following throws an exception: <DocumentViewer x:Name="TestViewer" Document="Resources/FlowDocument1.xaml" /> How can I

How to show a flow document using a DocumentViewer?

纵饮孤独 提交于 2021-02-07 09:32:05
问题 I have a simple flow document in my resources, FlowDocument1.xaml : <FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ColumnWidth="400" FontSize="14" FontFamily="Georgia"> <Paragraph> Test </Paragraph> </FlowDocument> And I want to show this document in a DocumentViewer . I searched for a property that takes path but I couldn't find one. And the following throws an exception: <DocumentViewer x:Name="TestViewer" Document="Resources/FlowDocument1.xaml" /> How can I

Windows 10 Mobile height of soft keyboard

流过昼夜 提交于 2021-02-07 09:23:36
问题 Does anybody know how to move content of the page (maybe set relative margins or something like that) when soft keyboard is shown. Here is the example page from my application. So I want when the user starts typing a phone number in the text box the bottom button will be shown above the soft keyboard. As a result I want something like that: P.S: Sorry about Russian language on the screens. 回答1: It's kind of tricky, but as I've tried should work. I've used InputPane's showing and hiding events

DataTemplate does not refresh after switching to an object of same DataType

青春壹個敷衍的年華 提交于 2021-02-07 09:10:47
问题 I have following ControlTemplate : <ContentControl Content="{Binding ContentViewModel}"> <ContentControl.Resources> <DataTemplate DataType="{x:Type viewModel:FilledContentViewModel}"> <usercontrols:FilledMainWindow x:Name="MainContent" /> </DataTemplate> <DataTemplate DataType="{x:Type viewModel:EmptyContentViewModel}"> <!-- todo: Something like a StartPage here --> </DataTemplate> </ContentControl.Resources> </ContentControl> This works great until the view model tries to change the

How to databind public property in xaml

巧了我就是萌 提交于 2021-02-07 06:36:07
问题 All I am trying to do is bind a public property to a textBlock. What am I doing wrong here? namespace WpfApplication1 { public partial class MainWindow : Window { public string test { get; set; } public MainWindow() { test = "this is a test"; InitializeComponent(); } } } <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window

WPF Paths Collision detection?

耗尽温柔 提交于 2021-02-07 04:12:57
问题 I have two hexagon shapes <Path Stroke="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="Red" StrokeThickness="1" Name="Hex1" Canvas.Left="31.343" Canvas.Top="26.866" Height="163.687" Stretch="Fill" Width="159.134" > <Path.Data> <PathGeometry > <PathGeometry.Figures> <PathFigureCollection > <PathFigure StartPoint="43,0"> <PathFigure.Segments> <PathSegmentCollection > <PolyLineSegment Points="43,0"/> <PolyLineSegment Points="86,25"/> <PolyLineSegment Points="86,75"/>

WPF Paths Collision detection?

流过昼夜 提交于 2021-02-07 04:11:00
问题 I have two hexagon shapes <Path Stroke="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="Red" StrokeThickness="1" Name="Hex1" Canvas.Left="31.343" Canvas.Top="26.866" Height="163.687" Stretch="Fill" Width="159.134" > <Path.Data> <PathGeometry > <PathGeometry.Figures> <PathFigureCollection > <PathFigure StartPoint="43,0"> <PathFigure.Segments> <PathSegmentCollection > <PolyLineSegment Points="43,0"/> <PolyLineSegment Points="86,25"/> <PolyLineSegment Points="86,75"/>

WPF Paths Collision detection?

吃可爱长大的小学妹 提交于 2021-02-07 04:09:36
问题 I have two hexagon shapes <Path Stroke="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="Red" StrokeThickness="1" Name="Hex1" Canvas.Left="31.343" Canvas.Top="26.866" Height="163.687" Stretch="Fill" Width="159.134" > <Path.Data> <PathGeometry > <PathGeometry.Figures> <PathFigureCollection > <PathFigure StartPoint="43,0"> <PathFigure.Segments> <PathSegmentCollection > <PolyLineSegment Points="43,0"/> <PolyLineSegment Points="86,25"/> <PolyLineSegment Points="86,75"/>