mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Migrate Search box to WPF control (#2917)
* Replaced UWP searchbox with WPF * Updated foreground color scheme for textbox * Add focus on visibility changed * Updated initial hiding of window * Fixed list box border * vis issue on start, fixing border * Revert "Merge branch 'somil55/MigrateSearchBoxToWPF' into fewTweaks" This reverts commit3525171621, reversing changes made tob5daffca55. * Remove change in startup visibility Co-authored-by: Clint Rutkas <clint@rutkas.com>
This commit is contained in:
committed by
GitHub
parent
245b52d8e2
commit
a1e1d663c3
@@ -1,50 +1,12 @@
|
||||
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
|
||||
public sealed partial class LauncherControl : UserControl
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user