删除废弃的两个item

This commit is contained in:
艾竹
2023-05-03 16:07:02 +08:00
parent 6b13f51814
commit c135a7f144
5 changed files with 0 additions and 201 deletions

View File

@@ -58,11 +58,6 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
}
}
if (designerItem is PointDesignerItemViewModel)
{
designerItems = new List<SelectableDesignerItemViewModelBase> { designerItem };
}
designerItems = designerItems.Distinct().ToList();
Interlocked.Increment(ref DiagramViewModel.DoCommandManager.BeginDo);

View File

@@ -32,16 +32,6 @@ namespace AIStudio.Wpf.DiagramDesigner
return (Style)itemsControl.FindResource("gifimageItemStyle");
}
if (item is LinkPointDesignerItemViewModel)
{
return (Style)itemsControl.FindResource("linkpointItemStyle");
}
if (item is PointDesignerItemViewModel)
{
return (Style)itemsControl.FindResource("pointItemStyle");
}
if (item is LogicalGateItemViewModelBase)
{
return (Style)itemsControl.FindResource("logicalItemStyle");

View File

@@ -766,98 +766,6 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="pointItemStyle"
TargetType="{x:Type ContentPresenter}">
<Setter Property="Canvas.Top"
Value="{Binding Top}" />
<Setter Property="Canvas.Left"
Value="{Binding Left}" />
<Setter Property="Canvas.ZIndex"
Value="{Binding ZIndex}" />
<Setter Property="dd:SelectionProps.EnabledForSelection"
Value="{Binding EnabledForSelection}" />
<Setter Property="Visibility"
Value="{Binding Visible,Converter={StaticResource BooleanToVisibilityConverter}}"/>
<Setter Property="Width"
Value="{Binding ItemWidth}" />
<Setter Property="Height"
Value="{Binding ItemHeight}" />
<Setter Property="SnapsToDevicePixels"
Value="True" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid x:Name="selectedGrid" Visibility="{Binding Path=ShowConnectors, Converter={x:Static dd:BoolToVisibilityConverter.Instance}}">
<!-- PART_ConnectorDecorator -->
<Grid Margin="-5"
x:Name="PART_ConnectorDecorator">
<dd:PointConnector DataContext="{Binding TopConnector}" Style="{StaticResource PointConnectorStyle}"/>
</Grid>
<!-- PART_DragThumb -->
<c:DragThumb x:Name="PART_DragThumb"
Cursor="SizeAll" />
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="true">
<Setter TargetName="PART_ConnectorDecorator" Property="Visibility" Value="Visible"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="linkpointItemStyle"
TargetType="{x:Type ContentPresenter}">
<Setter Property="Canvas.Top"
Value="{Binding Top}" />
<Setter Property="Canvas.Left"
Value="{Binding Left}" />
<Setter Property="Canvas.ZIndex"
Value="{Binding ZIndex}" />
<Setter Property="dd:SelectionProps.EnabledForSelection"
Value="{Binding EnabledForSelection}" />
<Setter Property="dd:ItemConnectProps.EnabledForConnection"
Value="{Binding EnabledForConnection}" />
<Setter Property="Visibility"
Value="{Binding Visible,Converter={StaticResource BooleanToVisibilityConverter}}"/>
<Setter Property="Width"
Value="{Binding ItemWidth}" />
<Setter Property="Height"
Value="{Binding ItemHeight}" />
<Setter Property="SnapsToDevicePixels"
Value="True" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid x:Name="selectedGrid">
<!-- PART_ConnectorDecorator -->
<Grid Margin="-5"
x:Name="PART_ConnectorDecorator">
<dd:Connector Content="{Binding Connectors[0]}"
SnapsToDevicePixels="True"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Visibility="{Binding Path=ShowConnectors, Converter={x:Static dd:BoolToVisibilityConverter.Instance}}" />
</Grid>
<!-- PART_DragThumb -->
<c:DragThumb x:Name="PART_DragThumb"
Cursor="SizeAll" />
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="true">
<Setter TargetName="PART_ConnectorDecorator" Property="Visibility" Value="Visible"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>

View File

@@ -1,41 +0,0 @@
using System;
using System.Windows;
namespace AIStudio.Wpf.DiagramDesigner
{
public class LinkPointDesignerItemViewModel : DesignerItemViewModelBase
{
public LinkPointDesignerItemViewModel(Point location) : this(null, location)
{
}
public LinkPointDesignerItemViewModel(IDiagramViewModel root, Point location) : base(root)
{
Left = Math.Max(0, location.X - ItemWidth / 2);
Top = Math.Max(0, location.Y - ItemHeight / 2);
}
protected override void Init(IDiagramViewModel root, bool initNew)
{
base.Init(root, initNew);
}
protected override void InitNew()
{
this.ClearConnectors();
this.AddConnector(new FullyCreatedConnectorInfo(this, ConnectorOrientation.None, true));
ItemWidth = 5;
ItemHeight = 5;
}
public Point CurrentLocation
{
get
{
return new Point() { X = Left + ItemWidth / 2, Y = Top + ItemHeight / 2 };
}
}
}
}

View File

@@ -1,53 +0,0 @@
using System;
using System.Windows;
namespace AIStudio.Wpf.DiagramDesigner
{
public class PointDesignerItemViewModel : DesignerItemViewModelBase
{
public PointDesignerItemViewModel(Point location) : this(null, location)
{
}
public PointDesignerItemViewModel(IDiagramViewModel root, Point location) : base(root)
{
Left = Math.Max(0, location.X - ItemWidth / 2);
Top = Math.Max(0, location.Y - ItemHeight / 2);
}
protected override void Init(IDiagramViewModel root, bool initNew)
{
base.Init(root, initNew);
}
protected override void InitNew()
{
ItemWidth = 5;
ItemHeight = 5;
this.ClearConnectors();
this.AddConnector(new FullyCreatedConnectorInfo(this, ConnectorOrientation.None, true));
}
private bool _showConnectors = false;
public new bool ShowConnectors
{
get
{
return _showConnectors;
}
set
{
SetProperty(ref _showConnectors, value);
}
}
public Point CurrentLocation
{
get
{
return new Point() { X = Left + ItemWidth / 2, Y = Top + ItemHeight / 2 };
}
}
}
}