mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[FancyZones] Clasify strings in FancyZones to localizable and non-localizable (#5315)
* Clasify strings in FancyZones to localizable and non-localizable * Address PR comments * Better handling of FirePropertyChanged event * Address PR comments * Update properties
This commit is contained in:
@@ -17,7 +17,12 @@ namespace FancyZonesEditor
|
||||
/// </summary>
|
||||
public partial class GridZone : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register("IsSelected", typeof(bool), typeof(GridZone), new PropertyMetadata(false, OnSelectionChanged));
|
||||
// Non-localizable strings
|
||||
private const string ObjectDependencyID = "IsSelected";
|
||||
private const string GridZoneBackgroundBrushID = "GridZoneBackgroundBrush";
|
||||
private const string PropertyIsShiftKeyPressedID = "IsShiftKeyPressed";
|
||||
|
||||
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(ObjectDependencyID, typeof(bool), typeof(GridZone), new PropertyMetadata(false, OnSelectionChanged));
|
||||
|
||||
public event SplitEventHandler Split;
|
||||
|
||||
@@ -45,7 +50,7 @@ namespace FancyZonesEditor
|
||||
|
||||
private void OnSelectionChanged()
|
||||
{
|
||||
Background = IsSelected ? SystemParameters.WindowGlassBrush : App.Current.Resources["GridZoneBackgroundBrush"] as SolidColorBrush;
|
||||
Background = IsSelected ? SystemParameters.WindowGlassBrush : App.Current.Resources[GridZoneBackgroundBrushID] as SolidColorBrush;
|
||||
}
|
||||
|
||||
public bool IsSelected
|
||||
@@ -69,7 +74,7 @@ namespace FancyZonesEditor
|
||||
|
||||
private void ZoneSettings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "IsShiftKeyPressed")
|
||||
if (e.PropertyName == PropertyIsShiftKeyPressedID)
|
||||
{
|
||||
_switchOrientation = ((App)Application.Current).ZoneSettings.IsShiftKeyPressed;
|
||||
if (_lastPos.X != -1)
|
||||
|
||||
Reference in New Issue
Block a user