I have initialized C# WPF application,and in the main window class i have created a property called "Myangel", and i have Path object with the Name "indicaitor" which i created via the XML file ,i've made rotate transform for this path.
My question is how to bind "Myangel" property in the mainwindow to the "Angel" property of the Rotate Transform in the XML file?
My Code as below
<Window x:Class="CtrlTst.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" MouseDoubleClick="Window_MouseDoubleClick">
<Grid>
<Path Stroke="Black" Fill="Azure" StrokeThickness="4">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="175,150" IsClosed="True">
<ArcSegment Point="325,150" Size="1,1" SweepDirection="Clockwise"></ArcSegment>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
<Path Stroke="red" StrokeThickness="4">
<Path.Data>
<EllipseGeometry Center="250,150" RadiusX="100" RadiusY="100" ></EllipseGeometry>
</Path.Data>
</Path>
<Path Stroke="Red" StrokeThickness="2" Fill="Red" Name="indicaitor">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="250,150" IsClosed="False" >
<PolyLineSegment Points="195,150,200,145,200,155,195,150"></PolyLineSegment>
</PathFigure>
</PathGeometry>
<!-- <LineGeometry StartPoint="250,150" EndPoint="250,90"></LineGeometry>-->
</Path.Data>
<Path.RenderTransform>
<RotateTransform CenterX="250" CenterY="150" Angle="{Binding }"></RotateTransform>
</Path.RenderTransform>
</Path>
<TextBox Height="43" HorizontalAlignment="Left" Margin="203,178,0,0" Name="textBox1" VerticalAlignment="Top" Width="91" TextChanged="textBox1_TextChanged" />
</Grid>
</Window>
Thanks;

New Topic/Question
Reply




MultiQuote




|