From d97938cc2bcfd290732b2e2154930d8fd3281cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E7=AB=B9?= Date: Wed, 15 Mar 2023 23:05:41 +0800 Subject: [PATCH] link --- .../NullableToVisibilityConverter.cs | 2 +- AIStudio.Wpf.Mind/Controls/LinkControl.xaml | 58 +++++++++++++++---- .../Controls/LinkControl.xaml.cs | 45 +++++++++++++- AIStudio.Wpf.Mind/Controls/RateControl.xaml | 13 +---- .../Controls/ToolBoxControl.xaml | 4 +- AIStudio.Wpf.Mind/Themes/Generic.xaml | 2 +- AIStudio.Wpf.Mind/Themes/MindNode.xaml | 15 +++-- .../ViewModels/MindDiagramViewModel.cs | 13 ++++- 8 files changed, 113 insertions(+), 39 deletions(-) diff --git a/AIStudio.Wpf.DiagramDesigner/Converters/NullableToVisibilityConverter.cs b/AIStudio.Wpf.DiagramDesigner/Converters/NullableToVisibilityConverter.cs index 94389a3..84d4356 100644 --- a/AIStudio.Wpf.DiagramDesigner/Converters/NullableToVisibilityConverter.cs +++ b/AIStudio.Wpf.DiagramDesigner/Converters/NullableToVisibilityConverter.cs @@ -14,7 +14,7 @@ namespace AIStudio.Wpf.DiagramDesigner public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return value == null ? NullValue : NotNullValue; + return string.IsNullOrEmpty(value?.ToString()) ? NullValue : NotNullValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/AIStudio.Wpf.Mind/Controls/LinkControl.xaml b/AIStudio.Wpf.Mind/Controls/LinkControl.xaml index 5a3eb24..1cd2d9f 100644 --- a/AIStudio.Wpf.Mind/Controls/LinkControl.xaml +++ b/AIStudio.Wpf.Mind/Controls/LinkControl.xaml @@ -1,12 +1,46 @@ - - - - - + + + + + - + - + - - + + - + diff --git a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs index 0acb79c..0461451 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs @@ -625,12 +625,12 @@ namespace AIStudio.Wpf.Mind.ViewModels private void ExecuteAddLinkCommand(object obj) { - + SelectedItems.OfType().ToList().ForEach(p => p.LinkInfo = new LinkInfo() { Url = "https://naotu.baidu.com", Text = "https://naotu.baidu.com" }); } private void ExecuteRemoveLinkCommand(object obj) { - + SelectedItems.OfType().ToList().ForEach(p => p.LinkInfo = null); } private void ExecuteAddImageCommand(object obj) @@ -667,7 +667,14 @@ namespace AIStudio.Wpf.Mind.ViewModels private void ExecuteAddRatioCommand(object obj) { - + if (double.TryParse(obj.ToString(), out var rate)) + { + SelectedItems.OfType().ToList().ForEach(p => p.Rate = rate); + } + else + { + SelectedItems.OfType().ToList().ForEach(p => p.Rate = null); + } } private void ExecuteAddTagCommand(object obj)