2024-09-22 11:05:41 +08:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
2025-04-24 20:56:44 +08:00
|
|
|
|
namespace ShrlAlgoToolkit.Mvvm.Attach;
|
2024-09-22 11:05:41 +08:00
|
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
|
public class TextSearchAssist
|
2024-09-22 11:05:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
// Using a DependencyProperty as the backing store for IsTextMatch. This enables animation, styling, binding, etc...
|
|
|
|
|
|
public static readonly DependencyProperty IsTextMatchProperty = DependencyProperty.RegisterAttached(
|
|
|
|
|
|
"IsTextMatch",
|
|
|
|
|
|
typeof(bool),
|
2025-07-11 09:20:23 +08:00
|
|
|
|
typeof(TextSearchAssist),
|
2024-09-22 11:05:41 +08:00
|
|
|
|
new UIPropertyMetadata(false)
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
// Using a DependencyProperty as the backing store for SearchValue. This enables animation, styling, binding, etc...
|
|
|
|
|
|
public static readonly DependencyProperty SearchValueProperty = DependencyProperty.RegisterAttached(
|
|
|
|
|
|
"SearchValue",
|
|
|
|
|
|
typeof(string),
|
2025-07-11 09:20:23 +08:00
|
|
|
|
typeof(TextSearchAssist),
|
2024-09-22 11:05:41 +08:00
|
|
|
|
new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.Inherits)
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
public static bool GetIsTextMatch(DependencyObject obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (bool)obj.GetValue(IsTextMatchProperty);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetSearchValue(DependencyObject obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (string)obj.GetValue(SearchValueProperty);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void SetIsTextMatch(DependencyObject obj, bool value)
|
|
|
|
|
|
{
|
|
|
|
|
|
obj.SetValue(IsTextMatchProperty, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void SetSearchValue(DependencyObject obj, string value)
|
|
|
|
|
|
{
|
|
|
|
|
|
obj.SetValue(SearchValueProperty, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|