enhance: close #1777
This commit is contained in:
1 parent
24e8e0ff7b
commit
4a0f66e519
8 files changed
+35
-4
No files matched your search
@@ -72,6 +72,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelected" Value="true"/>
|
||||||
<Condition Property="IsSelectionActive" Value="false"/>
|
<Condition Property="IsSelectionActive" Value="false"/>
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}"/>
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
|
|||||||
@@ -9252,6 +9252,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -9358,6 +9359,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -11621,6 +11623,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="IsSelectionActive" Value="false" />
|
<Condition Property="IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -11855,6 +11858,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -11907,6 +11911,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
namespace HandyControl.Controls;
|
namespace HandyControl.Controls;
|
||||||
|
|
||||||
public class VisualElement
|
public class VisualElement
|
||||||
{
|
{
|
||||||
public static readonly DependencyProperty HighlightBrushProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty HighlightBrushProperty = DependencyProperty.RegisterAttached(
|
||||||
"HighlightBrush", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits));
|
"HighlightBrush", typeof(Brush), typeof(VisualElement),
|
||||||
|
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
public static void SetHighlightBrush(DependencyObject element, Brush value)
|
public static void SetHighlightBrush(DependencyObject element, Brush value)
|
||||||
=> element.SetValue(HighlightBrushProperty, value);
|
=> element.SetValue(HighlightBrushProperty, value);
|
||||||
@@ -15,7 +17,8 @@ public class VisualElement
|
|||||||
=> (Brush) element.GetValue(HighlightBrushProperty);
|
=> (Brush) element.GetValue(HighlightBrushProperty);
|
||||||
|
|
||||||
public static readonly DependencyProperty HighlightBackgroundProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty HighlightBackgroundProperty = DependencyProperty.RegisterAttached(
|
||||||
"HighlightBackground", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits));
|
"HighlightBackground", typeof(Brush), typeof(VisualElement),
|
||||||
|
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
public static void SetHighlightBackground(DependencyObject element, Brush value)
|
public static void SetHighlightBackground(DependencyObject element, Brush value)
|
||||||
=> element.SetValue(HighlightBackgroundProperty, value);
|
=> element.SetValue(HighlightBackgroundProperty, value);
|
||||||
@@ -24,7 +27,8 @@ public class VisualElement
|
|||||||
=> (Brush) element.GetValue(HighlightBackgroundProperty);
|
=> (Brush) element.GetValue(HighlightBackgroundProperty);
|
||||||
|
|
||||||
public static readonly DependencyProperty HighlightBorderBrushProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty HighlightBorderBrushProperty = DependencyProperty.RegisterAttached(
|
||||||
"HighlightBorderBrush", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits));
|
"HighlightBorderBrush", typeof(Brush), typeof(VisualElement),
|
||||||
|
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
public static void SetHighlightBorderBrush(DependencyObject element, Brush value)
|
public static void SetHighlightBorderBrush(DependencyObject element, Brush value)
|
||||||
=> element.SetValue(HighlightBorderBrushProperty, value);
|
=> element.SetValue(HighlightBorderBrushProperty, value);
|
||||||
@@ -33,7 +37,8 @@ public class VisualElement
|
|||||||
=> (Brush) element.GetValue(HighlightBorderBrushProperty);
|
=> (Brush) element.GetValue(HighlightBorderBrushProperty);
|
||||||
|
|
||||||
public static readonly DependencyProperty HighlightForegroundProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty HighlightForegroundProperty = DependencyProperty.RegisterAttached(
|
||||||
"HighlightForeground", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits));
|
"HighlightForeground", typeof(Brush), typeof(VisualElement),
|
||||||
|
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
public static void SetHighlightForeground(DependencyObject element, Brush value)
|
public static void SetHighlightForeground(DependencyObject element, Brush value)
|
||||||
=> element.SetValue(HighlightForegroundProperty, value);
|
=> element.SetValue(HighlightForegroundProperty, value);
|
||||||
@@ -49,4 +54,14 @@ public class VisualElement
|
|||||||
|
|
||||||
public static string GetText(DependencyObject element)
|
public static string GetText(DependencyObject element)
|
||||||
=> (string) element.GetValue(TextProperty);
|
=> (string) element.GetValue(TextProperty);
|
||||||
|
|
||||||
|
public static readonly DependencyProperty StaysHighlightedProperty = DependencyProperty.RegisterAttached(
|
||||||
|
"StaysHighlighted", typeof(bool), typeof(VisualElement),
|
||||||
|
new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
|
public static void SetStaysHighlighted(DependencyObject element, bool value)
|
||||||
|
=> element.SetValue(StaysHighlightedProperty, value);
|
||||||
|
|
||||||
|
public static bool GetStaysHighlighted(DependencyObject element)
|
||||||
|
=> (bool) element.GetValue(StaysHighlightedProperty);
|
||||||
}
|
}
|
||||||
@@ -85,6 +85,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelected" Value="true"/>
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
@@ -138,6 +139,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelected" Value="true"/>
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelected" Value="true"/>
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelected" Value="true"/>
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelected" Value="true"/>
|
||||||
<Condition Property="IsSelectionActive" Value="false"/>
|
<Condition Property="IsSelectionActive" Value="false"/>
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}"/>
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
|
|||||||
@@ -9371,6 +9371,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -9477,6 +9478,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -11740,6 +11742,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="IsSelectionActive" Value="false" />
|
<Condition Property="IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -11991,6 +11994,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
@@ -12043,6 +12047,7 @@
|
|||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsSelected" Value="true" />
|
<Condition Property="IsSelected" Value="true" />
|
||||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||||
|
<Condition Property="hc:VisualElement.StaysHighlighted" Value="false" />
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
|
|||||||
Reference in new issue
Block a user