StructureHelper: UI fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
@@ -9,7 +10,7 @@ using StructureHelperCommon.Models.Materials;
|
|||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
public abstract class PrimitiveBase: ViewModelBase
|
public abstract class PrimitiveBase : ViewModelBase
|
||||||
{
|
{
|
||||||
#region Поля
|
#region Поля
|
||||||
|
|
||||||
@@ -24,7 +25,18 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
|
|
||||||
#region Свойства
|
#region Свойства
|
||||||
|
|
||||||
public PrimitiveType Type => type;
|
public PrimitiveType Type
|
||||||
|
{
|
||||||
|
get => type;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
OnPropertyChanged(value, type);
|
||||||
|
OnPropertyChanged(nameof(RectangleFieldVisibility));
|
||||||
|
OnPropertyChanged(nameof(PrimitiveDimension));
|
||||||
|
OnPropertyChanged(nameof(HeightRowHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool Captured
|
public bool Captured
|
||||||
{
|
{
|
||||||
set => OnPropertyChanged(value, ref captured);
|
set => OnPropertyChanged(value, ref captured);
|
||||||
@@ -157,6 +169,10 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
set => OnPropertyChanged(value, ref borderCaptured);
|
set => OnPropertyChanged(value, ref borderCaptured);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Visibility RectangleFieldVisibility => Type == PrimitiveType.Rectangle ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
public string PrimitiveDimension => Type == PrimitiveType.Rectangle ? "Ширина" : "Диаметр";
|
||||||
|
public double HeightRowHeight => Type == PrimitiveType.Rectangle ? 40 : 0;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Команды
|
#region Команды
|
||||||
@@ -239,6 +255,9 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
PopupCanBeClosed = false;
|
PopupCanBeClosed = false;
|
||||||
Captured = false;
|
Captured = false;
|
||||||
ParamsPanelVisibilty = true;
|
ParamsPanelVisibilty = true;
|
||||||
|
ParameterCaptured = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (primitive is Rectangle rect)
|
//if (primitive is Rectangle rect)
|
||||||
// rect.BorderCaptured = false;
|
// rect.BorderCaptured = false;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
{
|
{
|
||||||
public Rectangle(double primitiveWidth, double primitiveHeight, double rectX, double rectY, MainViewModel mainViewModel) : base(PrimitiveType.Rectangle, rectX, rectY, mainViewModel)
|
public Rectangle(double primitiveWidth, double primitiveHeight, double rectX, double rectY, MainViewModel mainViewModel) : base(PrimitiveType.Rectangle, rectX, rectY, mainViewModel)
|
||||||
{
|
{
|
||||||
|
Type = PrimitiveType.Rectangle;
|
||||||
PrimitiveWidth = primitiveWidth;
|
PrimitiveWidth = primitiveWidth;
|
||||||
PrimitiveHeight = primitiveHeight;
|
PrimitiveHeight = primitiveHeight;
|
||||||
ShowedX = 0;
|
ShowedX = 0;
|
||||||
|
|||||||
@@ -9,7 +9,23 @@
|
|||||||
xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
|
xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
|
||||||
xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
|
xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Grid>
|
<StackPanel>
|
||||||
<ContentControl Content="{StaticResource EllipsePrimitive}"/>
|
<Ellipse Style="{StaticResource EllipseStyle}" d:DataContext="{d:DesignInstance dataContexts:Point}">
|
||||||
</Grid>
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="PreviewMouseDown">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonDown}" CommandParameter="{Binding}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
<i:EventTrigger EventName="PreviewMouseUp">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonUp}" CommandParameter="{Binding}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
<i:EventTrigger EventName="PreviewMouseMove">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PointPreviewMouseMove}" CommandParameter="{Binding}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
<mouseEventTriggers:DoubleClickEventTrigger EventName="MouseDown">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PrimitiveDoubleClick}" CommandParameter="{Binding}"/>
|
||||||
|
</mouseEventTriggers:DoubleClickEventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
</Ellipse>
|
||||||
|
<userControls:PrimitivePopup Type="Rectangle" IsOpen="{Binding ParamsPanelVisibilty}" d:DataContext="{d:DesignInstance dataContexts:PrimitiveBase}"/>
|
||||||
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -8,9 +8,27 @@
|
|||||||
xmlns:infrastructure="clr-namespace:StructureHelper.Infrastructure"
|
xmlns:infrastructure="clr-namespace:StructureHelper.Infrastructure"
|
||||||
xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers"
|
xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers"
|
||||||
xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
|
xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
|
||||||
mc:Ignorable="d">
|
xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{d:DesignInstance dataContexts:Rectangle}">
|
||||||
|
<StackPanel>
|
||||||
<Grid>
|
<Grid>
|
||||||
<ContentControl Content="{StaticResource RectanglePrimitive}"/>
|
<Rectangle Style="{StaticResource RectangleStyle}">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="PreviewMouseDown">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonDown}" CommandParameter="{Binding}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
<i:EventTrigger EventName="PreviewMouseUp">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonUp}" CommandParameter="{Binding}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
<i:EventTrigger EventName="PreviewMouseMove">
|
||||||
|
<i:InvokeCommandAction Command="{Binding RectanglePreviewMouseMove}" CommandParameter="{Binding}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
<mouseEventTriggers:DoubleClickEventTrigger EventName="MouseDown">
|
||||||
|
<i:InvokeCommandAction Command="{Binding PrimitiveDoubleClick}" CommandParameter="{Binding}"/>
|
||||||
|
</mouseEventTriggers:DoubleClickEventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
</Rectangle>
|
||||||
<Rectangle Cursor="SizeNWSE" Width="20" Height="20" Fill="{Binding Brush}" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
<Rectangle Cursor="SizeNWSE" Width="20" Height="20" Fill="{Binding Brush}" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="PreviewMouseDown">
|
<i:EventTrigger EventName="PreviewMouseDown">
|
||||||
@@ -25,4 +43,6 @@
|
|||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<userControls:PrimitivePopup IsOpen="{Binding ParamsPanelVisibilty}"/>
|
||||||
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -52,38 +52,4 @@
|
|||||||
<Setter Property="Width" Value="{Binding PrimitiveWidth}"/>
|
<Setter Property="Width" Value="{Binding PrimitiveWidth}"/>
|
||||||
<Setter Property="Height" Value="{Binding PrimitiveHeight}"/>
|
<Setter Property="Height" Value="{Binding PrimitiveHeight}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Rectangle x:Key="RectanglePrimitive" Style="{StaticResource RectangleStyle}" d:DataContext="{d:DesignInstance dataContexts:PrimitiveBase}" >
|
|
||||||
<i:Interaction.Triggers>
|
|
||||||
<i:EventTrigger EventName="PreviewMouseDown">
|
|
||||||
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonDown}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<i:EventTrigger EventName="PreviewMouseUp">
|
|
||||||
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonUp}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<i:EventTrigger EventName="PreviewMouseMove">
|
|
||||||
<i:InvokeCommandAction Command="{Binding RectanglePreviewMouseMove}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<mouseEventTriggers:DoubleClickEventTrigger EventName="MouseDown">
|
|
||||||
<i:InvokeCommandAction Command="{Binding PrimitiveDoubleClick}" CommandParameter="{Binding}"/>
|
|
||||||
</mouseEventTriggers:DoubleClickEventTrigger>
|
|
||||||
</i:Interaction.Triggers>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Ellipse x:Key="EllipsePrimitive" Style="{StaticResource EllipseStyle}" d:DataContext="{d:DesignInstance dataContexts:PrimitiveBase}">
|
|
||||||
<i:Interaction.Triggers>
|
|
||||||
<i:EventTrigger EventName="PreviewMouseDown">
|
|
||||||
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonDown}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<i:EventTrigger EventName="PreviewMouseUp">
|
|
||||||
<i:InvokeCommandAction Command="{Binding PrimitiveLeftButtonUp}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<i:EventTrigger EventName="PreviewMouseMove">
|
|
||||||
<i:InvokeCommandAction Command="{Binding EllipsePreviewMouseMove}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<mouseEventTriggers:DoubleClickEventTrigger EventName="MouseDown">
|
|
||||||
<i:InvokeCommandAction Command="{Binding PrimitiveDoubleClick}" CommandParameter="{Binding}"/>
|
|
||||||
</mouseEventTriggers:DoubleClickEventTrigger>
|
|
||||||
</i:Interaction.Triggers>
|
|
||||||
</Ellipse>
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<UserControl x:Class="StructureHelper.Infrastructure.UI.UserControls.PrimitivePopup"
|
<Popup x:Class="StructureHelper.Infrastructure.UI.UserControls.PrimitivePopup"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@@ -6,10 +6,8 @@
|
|||||||
xmlns:local="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
|
xmlns:local="clr-namespace:StructureHelper.Infrastructure.UI.UserControls"
|
||||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||||
xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
|
xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d" IsOpen="{Binding ParamsPanelVisibilty}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<!--Rectangle-->
|
|
||||||
<local:PrimitivePopup IsOpen="{Binding ParamsPanelVisibilty}" d:DataContext="{d:DesignInstance dataContexts:Rectangle}" Type="Rectangle">
|
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="MouseLeave">
|
<i:EventTrigger EventName="MouseLeave">
|
||||||
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetPopupCanBeClosedTrue}" CommandParameter="{Binding}"/>
|
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetPopupCanBeClosedTrue}" CommandParameter="{Binding}"/>
|
||||||
@@ -24,7 +22,7 @@
|
|||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="{Binding HeightRowHeight}"/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
@@ -39,13 +37,13 @@
|
|||||||
<ColumnDefinition Width="170"/>
|
<ColumnDefinition Width="170"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Координата X" Margin="10"/>
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Координата X" Margin="10"/>
|
||||||
<TextBox Grid.Column="1" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.RectParameterX, Mode=TwoWay}"/>
|
<TextBox Grid.Column="1" VerticalAlignment="Center" Margin="10" Text="{Binding ShowedX, Mode=TwoWay}"/>
|
||||||
<TextBlock Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Координата Y" Margin="10"/>
|
<TextBlock Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Координата Y" Margin="10"/>
|
||||||
<TextBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.RectParameterY, Mode=TwoWay}"/>
|
<TextBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Margin="10" Text="{Binding ShowedY, Mode=TwoWay}"/>
|
||||||
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Ширина" Margin="10"/>
|
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding PrimitiveDimension}" Margin="10"/>
|
||||||
<TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.RectParameterWidth, Mode=TwoWay}"/>
|
<TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" Margin="10" Text="{Binding PrimitiveWidth, Mode=TwoWay}"/>
|
||||||
<TextBlock Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Высота" Margin="10"/>
|
<TextBlock Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Высота" Margin="10" Visibility="{Binding RectangleFieldVisibility}"/>
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.RectParameterHeight, Mode=TwoWay}"/>
|
<TextBox Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Margin="10" Text="{Binding PrimitiveHeight, Mode=TwoWay}" Visibility="{Binding RectangleFieldVisibility}"/>
|
||||||
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Материал" Margin="10"/>
|
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Материал" Margin="10"/>
|
||||||
<Button Grid.Row="4" Grid.Column="1" Margin="10" Background="White"
|
<Button Grid.Row="4" Grid.Column="1" Margin="10" Background="White"
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.OpenMaterialCatalogWithSelection}" CommandParameter="{Binding}"
|
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.OpenMaterialCatalogWithSelection}" CommandParameter="{Binding}"
|
||||||
@@ -54,14 +52,14 @@
|
|||||||
<Button Grid.Row="5" Grid.Column="1" Margin="10" Background="{Binding Brush, Mode=TwoWay}"
|
<Button Grid.Row="5" Grid.Column="1" Margin="10" Background="{Binding Brush, Mode=TwoWay}"
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetColor}" CommandParameter="{Binding}"/>
|
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetColor}" CommandParameter="{Binding}"/>
|
||||||
<TextBlock Grid.Row="6" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Прозрачность"/>
|
<TextBlock Grid.Row="6" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Прозрачность"/>
|
||||||
<TextBox Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" Margin="10,10,50,10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ParameterOpacity, Mode=TwoWay}"/>
|
<TextBox Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" Margin="10,10,50,10" Text="{Binding ShowedOpacity, Mode=TwoWay}"/>
|
||||||
<TextBlock Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Text="%" Margin="25,10"/>
|
<TextBlock Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Text="%" Margin="25,10"/>
|
||||||
<TextBlock Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Заблокировать объект" Grid.ColumnSpan="2"/>
|
<TextBlock Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Заблокировать объект" Grid.ColumnSpan="2"/>
|
||||||
<CheckBox Grid.Row="7" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ElementLock, Mode=TwoWay}"></CheckBox>
|
<CheckBox Grid.Row="7" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" IsChecked="{Binding ElementLock, Mode=TwoWay}"/>
|
||||||
<TextBlock Grid.Row="8" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Z-порядок"/>
|
<TextBlock Grid.Row="8" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Z-порядок"/>
|
||||||
<StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal">
|
<StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal">
|
||||||
<TextBox VerticalAlignment="Center" HorizontalAlignment="Left" Width="50" Margin="10"
|
<TextBox VerticalAlignment="Center" HorizontalAlignment="Left" Width="50" Margin="10"
|
||||||
Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.PrimitiveIndex, Mode=TwoWay}"/>
|
Text="{Binding ShowedZIndex, Mode=TwoWay}"/>
|
||||||
<TextBlock VerticalAlignment="Center" Text="Max = "/>
|
<TextBlock VerticalAlignment="Center" Text="Max = "/>
|
||||||
<TextBlock VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.PrimitivesCount, Mode=TwoWay}"/>
|
<TextBlock VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.PrimitivesCount, Mode=TwoWay}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -73,70 +71,5 @@
|
|||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetParameters}" CommandParameter="{Binding}"/>
|
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetParameters}" CommandParameter="{Binding}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</local:PrimitivePopup>
|
|
||||||
<!--Ellipse-->
|
|
||||||
<local:PrimitivePopup IsOpen="{Binding ParamsPanelVisibilty}" d:DataContext="{d:DesignInstance dataContexts:Point}" Type="Ellipse">
|
|
||||||
<i:Interaction.Triggers>
|
|
||||||
<i:EventTrigger EventName="MouseLeave">
|
|
||||||
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetPopupCanBeClosedTrue}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
<i:EventTrigger EventName="MouseEnter">
|
|
||||||
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetPopupCanBeClosedFalse}" CommandParameter="{Binding}"/>
|
|
||||||
</i:EventTrigger>
|
|
||||||
</i:Interaction.Triggers>
|
|
||||||
<Border Background="White" BorderBrush="Black" BorderThickness="1">
|
|
||||||
<Grid Grid.Column="1">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="170"/>
|
|
||||||
<ColumnDefinition Width="170"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Координата центра X" Margin="10"/>
|
|
||||||
<TextBox Grid.Column="1" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.EllipseParameterX, Mode=TwoWay}"/>
|
|
||||||
<TextBlock Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Координата центра Y" Margin="10"/>
|
|
||||||
<TextBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.EllipseParameterY, Mode=TwoWay}"/>
|
|
||||||
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Площадь" Margin="10"/>
|
|
||||||
<TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" Margin="10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.EllipseParameterSquare, Mode=TwoWay}"/>
|
|
||||||
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Материал" Margin="10"/>
|
|
||||||
<Button Grid.Row="4" Grid.Column="1" Margin="10" Background="White"
|
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.OpenMaterialCatalogWithSelection}" CommandParameter="{Binding}"
|
|
||||||
Content="{Binding MaterialName, Mode=TwoWay}"/>
|
|
||||||
<TextBlock Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Цвет"/>
|
|
||||||
<Button Grid.Row="5" Grid.Column="1" Margin="10" Background="{Binding Brush, Mode=TwoWay}"
|
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetColor}" CommandParameter="{Binding}"/>
|
|
||||||
<TextBlock Grid.Row="6" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Прозрачность"/>
|
|
||||||
<TextBox Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" Margin="10,10,50,10" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ParameterOpacity, Mode=TwoWay}"/>
|
|
||||||
<TextBlock Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Text="%" Margin="25,10"/>
|
|
||||||
<TextBlock Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Заблокировать объект" Grid.ColumnSpan="2"/>
|
|
||||||
<CheckBox Grid.Row="7" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ElementLock, Mode=TwoWay}"></CheckBox>
|
|
||||||
<TextBlock Grid.Row="8" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10" Text="Z-порядок"/>
|
|
||||||
<StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal">
|
|
||||||
<TextBox VerticalAlignment="Center" HorizontalAlignment="Left" Width="50" Margin="10"
|
|
||||||
Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.PrimitiveIndex, Mode=TwoWay}"/>
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="Max = "/>
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.PrimitivesCount, Mode=TwoWay}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<Button Grid.Row="9" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Установить впереди всех" Margin="10"
|
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetInFrontOfAll}" CommandParameter="{Binding}"/>
|
|
||||||
<Button Grid.Row="9" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Установить позади всех" Margin="10"
|
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetInBackOfAll}" CommandParameter="{Binding}"/>
|
|
||||||
<Button Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="10" Content="Установить параметры"
|
|
||||||
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetParameters}" CommandParameter="{Binding}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Popup>
|
||||||
</local:PrimitivePopup>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace StructureHelper.Infrastructure.UI.UserControls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for PrimitivePopup.xaml
|
/// Interaction logic for PrimitivePopup.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PrimitivePopup : UserControl
|
public partial class PrimitivePopup : Popup
|
||||||
{
|
{
|
||||||
public static readonly DependencyProperty TypeProperty =
|
public static readonly DependencyProperty TypeProperty =
|
||||||
DependencyProperty.Register("Type", typeof(PrimitiveType), typeof(PrimitivePopup));
|
DependencyProperty.Register("Type", typeof(PrimitiveType), typeof(PrimitivePopup));
|
||||||
|
|||||||
@@ -250,7 +250,10 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
var primitive = Primitives.FirstOrDefault(x => x.ParamsPanelVisibilty);
|
var primitive = Primitives.FirstOrDefault(x => x.ParamsPanelVisibilty);
|
||||||
if (primitive != null && primitive.PopupCanBeClosed)
|
if (primitive != null && primitive.PopupCanBeClosed)
|
||||||
|
{
|
||||||
primitive.ParamsPanelVisibilty = false;
|
primitive.ParamsPanelVisibilty = false;
|
||||||
|
primitive.ParameterCaptured = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user