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>
</ResourceDictionary>
</ItemsControl.Resources>
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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