Refactoring WIP

This commit is contained in:
Nikolai Smirnov
2022-07-08 11:38:25 +05:00
parent fc4f1f1db3
commit 2c4df04c5c
43 changed files with 832 additions and 833 deletions

View File

@@ -0,0 +1,15 @@
<UserControl x:Class="StructureHelper.Infrastructure.UI.DataTemplates.EllipseTemplate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StructureHelper"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers"
xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
mc:Ignorable="d">
<Grid>
<ContentControl Content="{StaticResource EllipsePrimitive}"/>
</Grid>
</UserControl>

View File

@@ -0,0 +1,16 @@
using System.Windows;
using System.Windows.Controls;
namespace StructureHelper.Infrastructure.UI.DataTemplates
{
/// <summary>
/// Логика взаимодействия для EllipseTemplate.xaml
/// </summary>
public partial class EllipseTemplate : UserControl
{
public EllipseTemplate()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,28 @@
<UserControl x:Class="StructureHelper.Infrastructure.UI.DataTemplates.RectangleTemplate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StructureHelper"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:infrastructure="clr-namespace:StructureHelper.Infrastructure"
xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers"
xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
mc:Ignorable="d">
<Grid>
<ContentControl Content="{StaticResource RectanglePrimitive}"/>
<Rectangle Cursor="SizeNWSE" Width="20" Height="20" Fill="{Binding Brush}" VerticalAlignment="Bottom" HorizontalAlignment="Right">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseDown">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.LeftButtonDown}" CommandParameter="{Binding}"/>
</i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseUp">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.LeftButtonUp}" CommandParameter="{Binding}"/>
</i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseMove">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.PreviewMouseMove}" CommandParameter="{Binding}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Rectangle>
</Grid>
</UserControl>

View File

@@ -0,0 +1,16 @@
using System.Windows;
using System.Windows.Controls;
namespace StructureHelper.Infrastructure.UI.DataTemplates
{
/// <summary>
/// Логика взаимодействия для RectangleTemplate.xaml
/// </summary>
public partial class RectangleTemplate : UserControl
{
public RectangleTemplate()
{
InitializeComponent();
}
}
}