mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
|
|
using System.ComponentModel;
|
||
|
|
using System.Diagnostics;
|
||
|
|
using System.Runtime.CompilerServices;
|
||
|
|
using Windows.UI.Xaml;
|
||
|
|
using Windows.UI.Xaml.Controls;
|
||
|
|
using Windows.UI.Xaml.Media;
|
||
|
|
|
||
|
|
namespace PowerLauncher.UI
|
||
|
|
{
|
||
|
|
public sealed partial class LauncherControl : UserControl, INotifyPropertyChanged
|
||
|
|
{
|
||
|
|
private Brush _borderBrush;
|
||
|
|
|
||
|
|
public LauncherControl()
|
||
|
|
{
|
||
|
|
InitializeComponent();
|
||
|
|
}
|
||
|
|
|
||
|
|
public Brush SolidBorderBrush
|
||
|
|
{
|
||
|
|
get { return _borderBrush; }
|
||
|
|
set { Set(ref _borderBrush, value); }
|
||
|
|
}
|
||
|
|
|
||
|
|
private void Set<T>(ref T storage, T value, [CallerMemberName]string propertyName = null)
|
||
|
|
{
|
||
|
|
if (Equals(storage, value))
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
storage = value;
|
||
|
|
OnPropertyChanged(propertyName);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void UserControl_ActualThemeChanged(FrameworkElement sender, object args)
|
||
|
|
{
|
||
|
|
SolidBorderBrush = Application.Current.Resources["SystemChromeLow"] as SolidColorBrush;
|
||
|
|
}
|
||
|
|
|
||
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||
|
|
{
|
||
|
|
SolidBorderBrush = Application.Current.Resources["SystemChromeLow"] as SolidColorBrush;
|
||
|
|
}
|
||
|
|
|
||
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
||
|
|
|
||
|
|
private void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||
|
|
}
|
||
|
|
}
|