diff --git a/AIStudio.Wpf.DiagramDesigner/Converters/BrushOpacityConverter.cs b/AIStudio.Wpf.DiagramDesigner/Converters/BrushOpacityConverter.cs new file mode 100644 index 0000000..1c7d1ce --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner/Converters/BrushOpacityConverter.cs @@ -0,0 +1,26 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using System.Windows.Media; + +namespace AIStudio.Wpf.DiagramDesigner +{ + public class BrushOpacityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is SolidColorBrush brush) + { + var opacity = System.Convert.ToDouble(parameter, CultureInfo.InvariantCulture); + return new SolidColorBrush(brush.Color) + { + Opacity = opacity + }; + } + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + => Binding.DoNothing; + } +} diff --git a/AIStudio.Wpf.DiagramDesigner/Styles/Button.xaml b/AIStudio.Wpf.DiagramDesigner/Styles/Button.xaml new file mode 100644 index 0000000..aae20fc --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner/Styles/Button.xaml @@ -0,0 +1,48 @@ + + + + + + \ No newline at end of file diff --git a/AIStudio.Wpf.DiagramDesigner/Themes/Style.xaml b/AIStudio.Wpf.DiagramDesigner/Themes/Style.xaml index 76d04a9..d1b58d2 100644 --- a/AIStudio.Wpf.DiagramDesigner/Themes/Style.xaml +++ b/AIStudio.Wpf.DiagramDesigner/Themes/Style.xaml @@ -1,6 +1,7 @@  + diff --git a/Directory.Build.Props b/Directory.Build.Props index b3d0e9d..4d652c4 100644 --- a/Directory.Build.Props +++ b/Directory.Build.Props @@ -1,7 +1,7 @@ - net461;netcoreapp3.1;net5.0-windows + netcoreapp3.1;net5.0-windows