Skip to content

Commit 497f68d

Browse files
committed
Изменён стартовый Window и добавлены связанные линии
В App.xaml стартовое окно сменено на TestWindows8.xaml. В TestWindows8.xaml удалены привязки DataContext и Title, обновлены параметры стрелки, а также добавлены две линии: первая с явными координатами, вторая начинается в конце первой с помощью привязки к её свойству P2.
1 parent 35a32a7 commit 497f68d

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

Tests/MathCore.WPF.WindowTest/App.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:l="clr-namespace:MathCore.WPF.WindowTest"
5-
StartupUri="TestWindow7.xaml">
5+
StartupUri="TestWindows8.xaml">
66
<Application.Resources>
77
<ResourceDictionary>
88
<ResourceDictionary.MergedDictionaries>

Tests/MathCore.WPF.WindowTest/TestWindows8.xaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66
xmlns:vm="clr-namespace:MathCore.WPF.WindowTest.ViewModels"
77
xmlns:l="clr-namespace:MathCore.WPF.WindowTest"
88
xmlns:sh="clr-namespace:MathCore.WPF.Shapes;assembly=MathCore.WPF"
9-
DataContext="{StaticResource TestWindow8Model}"
10-
Title="{Binding Title}"
119
Width="800" Height="450">
1210
<Window.Resources>
1311
<vm:TestWindow8ViewModel x:Key="TestWindow8Model"/>
1412
</Window.Resources>
1513
<Grid>
1614
<sh:Arrow X1="10" X2="300" Y1="30" Y2="300"
1715
ArrowHeadLength="53"
18-
ArrowHeadWidth="31" StrokeThickness="4"
19-
IsArrowHeadClosed="False" ArrowHeadOffset="-36"
16+
ArrowHeadWidth="31" StrokeThickness="4" ArrowHeadOffset="64" Fill="Red"
2017
/>
18+
19+
<!-- Первая линия с явным указанием P1 и P2 для инициализации -->
20+
<Line sh:LineEx.P1="10,30" sh:LineEx.P2="300,150" Stroke="Red" StrokeThickness="4" Name="Line1"/>
21+
22+
<!-- Вторая линия: начинается в конце первой линии (P2), заканчивается в (300,200) -->
23+
<Line Stroke="Blue" StrokeThickness="4"
24+
sh:LineEx.P1="{Binding Path=(sh:LineEx.P2), ElementName=Line1}"
25+
sh:LineEx.P2="300,200"/>
26+
2127
</Grid>
2228
</Window>

0 commit comments

Comments
 (0)