This commit is contained in:
艾竹
2023-07-09 21:03:35 +08:00
parent 49b95ba881
commit 380c126e33
7 changed files with 47 additions and 23 deletions

View File

@@ -40,7 +40,6 @@
</ControlTemplate> </ControlTemplate>
</ResourceDictionary> </ResourceDictionary>
</ItemsControl.Resources> </ItemsControl.Resources>
<ItemsControl.ItemContainerStyle> <ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}"> <Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template"> <Setter Property="Template">

View File

@@ -277,9 +277,8 @@ namespace AIStudio.Wpf.DiagramDesigner
protected void DesignerCanvas_Loaded(object sender, RoutedEventArgs e) protected void DesignerCanvas_Loaded(object sender, RoutedEventArgs e)
{ {
Mediator.Instance.Register(this); //Mediator.Instance.Register(this);
this.Focus(); this.Focus();
int xx = this.GetHashCode();
_service.PropertyChanged += _service_PropertyChanged; _service.PropertyChanged += _service_PropertyChanged;
} }

View File

@@ -7,9 +7,9 @@ using System.Windows;
namespace AIStudio.Wpf.DiagramDesigner namespace AIStudio.Wpf.DiagramDesigner
{ {
public class ToolBoxData public class ToolBoxData : BindableBase
{ {
public string Text public virtual string Text
{ {
get; protected set; get; protected set;
} }

View File

@@ -7,7 +7,10 @@ namespace AIStudio.Wpf.DiagramDesigner.Services
/// </summary> /// </summary>
public interface IServiceProvider public interface IServiceProvider
{ {
IUIVisualizerService VisualizerService { get; } IUIVisualizerService VisualizerService
{
get; set;
}
IMessageBoxService MessageBoxService { get; } IMessageBoxService MessageBoxService { get; }
//IDatabaseAccessService DatabaseAccessService { get; } //IDatabaseAccessService DatabaseAccessService { get; }
} }
@@ -25,6 +28,10 @@ namespace AIStudio.Wpf.DiagramDesigner.Services
public IUIVisualizerService VisualizerService public IUIVisualizerService VisualizerService
{ {
get { return visualizerService; } get { return visualizerService; }
set
{
visualizerService = value;
}
} }
public IMessageBoxService MessageBoxService public IMessageBoxService MessageBoxService

View File

@@ -502,6 +502,9 @@
</MultiDataTrigger.Conditions> </MultiDataTrigger.Conditions>
<Setter TargetName="PART_ResizeDecorator" Property="Visibility" Value="Visible"/> <Setter TargetName="PART_ResizeDecorator" Property="Visibility" Value="Visible"/>
</MultiDataTrigger> </MultiDataTrigger>
<DataTrigger Binding="{Binding ShowResize}" Value="false">
<Setter TargetName="PART_ResizeDecorator" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding Connectors.Count}" Value="0"> <DataTrigger Binding="{Binding Connectors.Count}" Value="0">
<Setter TargetName="PART_ConnectorDecorator" Property="Visibility" Value="Collapsed" /> <Setter TargetName="PART_ConnectorDecorator" Property="Visibility" Value="Collapsed" />
</DataTrigger> </DataTrigger>

View File

@@ -330,11 +330,6 @@ namespace AIStudio.Wpf.DiagramDesigner
public bool ShowArrow { get; set; } = true; public bool ShowArrow { get; set; } = true;
public bool ShowResized
{
get; set;
}
private bool alwayForResized; private bool alwayForResized;
public bool AlwayForResized public bool AlwayForResized
{ {

View File

@@ -63,10 +63,17 @@ namespace AIStudio.Wpf.DiagramDesigner
} }
if (oldnext != null && first == true) if (oldnext != null && first == true)
{ {
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => { //if (this.GetItemHeight() > 0)
await Task.Delay(10); //{
GetLast().AddNext(oldnext, false); // GetLast().AddNext(oldnext, false);
})); //}
//else
{
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
await Task.Delay(10);
GetLast().AddNext(oldnext, false);
}));
}
} }
} }
@@ -162,10 +169,17 @@ namespace AIStudio.Wpf.DiagramDesigner
child.RemoveFromSelection(); child.RemoveFromSelection();
this.GetRootContainItem.AddToSelection(true, true); this.GetRootContainItem.AddToSelection(true, true);
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => { //if (this.GetItemHeight() > 0)
await Task.Delay(10); //{
AlignNext(this.Next); // AlignNext(this.Next);
})); //}
//else
{
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
await Task.Delay(10);
AlignNext(this.Next);
}));
}
} }
public virtual void RemoveChild(BlockDesignerItemViewModel child, BlockItemsContainerInfo container) public virtual void RemoveChild(BlockDesignerItemViewModel child, BlockItemsContainerInfo container)
@@ -180,10 +194,17 @@ namespace AIStudio.Wpf.DiagramDesigner
this.RemoveFromSelection(); this.RemoveFromSelection();
child.AddToSelection(true, true); child.AddToSelection(true, true);
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => { //if (this.GetItemHeight() > 0)
await Task.Delay(10); //{
AlignNext(this.Next); // AlignNext(this.Next);
})); //}
//else
{
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
await Task.Delay(10);
AlignNext(this.Next);
}));
}
} }
public string Flag public string Flag