mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Color brush - Fixed gradient picker not appearing
Gradient picker - Use dialog instead of a popup window
This commit is contained in:
1 parent
a8912076d3
commit
92a3e0d61b
21 files changed
+206
-101
No files matched your search
@@ -46,6 +46,15 @@ namespace Artemis.UI.Shared.Controls
|
||||
set => SetValue(ColorGradientProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the currently selected color gradient
|
||||
/// </summary>
|
||||
public string DialogHost
|
||||
{
|
||||
get => (string) GetValue(DialogHostProperty);
|
||||
set => SetValue(DialogHostProperty, value);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
@@ -67,7 +76,7 @@ namespace Artemis.UI.Shared.Controls
|
||||
|
||||
private void UIElement_OnMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
GradientPickerService.ShowGradientPicker(ColorGradient);
|
||||
GradientPickerService.ShowGradientPicker(ColorGradient, DialogHost);
|
||||
}
|
||||
|
||||
#region Static WPF fields
|
||||
@@ -75,6 +84,9 @@ namespace Artemis.UI.Shared.Controls
|
||||
public static readonly DependencyProperty ColorGradientProperty = DependencyProperty.Register(nameof(ColorGradient), typeof(ColorGradient), typeof(GradientPicker),
|
||||
new FrameworkPropertyMetadata(default(ColorGradient), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, ColorGradientPropertyChangedCallback));
|
||||
|
||||
public static readonly DependencyProperty DialogHostProperty = DependencyProperty.Register(nameof(DialogHost), typeof(string), typeof(GradientPicker),
|
||||
new FrameworkPropertyMetadata(default(string)));
|
||||
|
||||
public static readonly RoutedEvent ColorGradientChangedEvent =
|
||||
EventManager.RegisterRoutedEvent(nameof(ColorGradient), RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<ColorGradient>), typeof(GradientPicker));
|
||||
|
||||
|
||||
Reference in new issue
Block a user