diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml index b14a5bda23..19c79f6d8c 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml @@ -11,5 +11,4 @@ WindowStyle="None" AllowsTransparency="True" Background="Transparent" - Loaded="onLoad"/> - + Loaded="OnLoaded"/> diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml.cs index e7d6cff72f..5eb8ead2ef 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/EditorOverlay.xaml.cs @@ -70,7 +70,7 @@ namespace FancyZonesEditor Height = _settings.WorkArea.Height; } - void onLoad(object sender, RoutedEventArgs e) + private void OnLoaded(object sender, RoutedEventArgs e) { ShowLayoutPicker(); } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs index 3129a25124..3ca718a949 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Models/Settings.cs @@ -40,26 +40,26 @@ namespace FancyZonesEditor // Initialize the five default layout models: Focus, Columns, Rows, Grid, and PriorityGrid _defaultModels = new List(5); - _focusModel = new CanvasLayoutModel("Focus", c_focusModelId, (int)_workArea.Width, (int)_workArea.Height); + _focusModel = new CanvasLayoutModel("Focus", _focusModelId, (int)_workArea.Width, (int)_workArea.Height); _defaultModels.Add(_focusModel); - _columnsModel = new GridLayoutModel("Columns", c_columnsModelId); + _columnsModel = new GridLayoutModel("Columns", _columnsModelId); _columnsModel.Rows = 1; _columnsModel.RowPercents = new int[1] { c_multiplier }; _defaultModels.Add(_columnsModel); - _rowsModel = new GridLayoutModel("Rows", c_rowsModelId); + _rowsModel = new GridLayoutModel("Rows", _rowsModelId); _rowsModel.Columns = 1; _rowsModel.ColumnPercents = new int[1] { c_multiplier }; _defaultModels.Add(_rowsModel); - _gridModel = new GridLayoutModel("Grid", c_gridModelId); + _gridModel = new GridLayoutModel("Grid", _gridModelId); _defaultModels.Add(_gridModel); - _priorityGridModel = new GridLayoutModel("Priority Grid", c_priorityGridModelId); + _priorityGridModel = new GridLayoutModel("Priority Grid", _priorityGridModelId); _defaultModels.Add(_priorityGridModel); - _blankCustomModel = new CanvasLayoutModel("Create new custom", c_blankCustomModelId, (int)_workArea.Width, (int)_workArea.Height); + _blankCustomModel = new CanvasLayoutModel("Create new custom", _blankCustomModelId, (int)_workArea.Width, (int)_workArea.Height); _zoneCount = ReadRegistryInt("ZoneCount", 3); _spacing = ReadRegistryInt("Spacing", 16); @@ -371,7 +371,7 @@ namespace FancyZonesEditor public static bool IsPredefinedLayout(LayoutModel model) { - return (model.Id >= c_lastPrefinedId); + return model.Id >= _lastPrefinedId; } // implementation of INotifyProeprtyChanged @@ -380,8 +380,7 @@ namespace FancyZonesEditor // FirePropertyChanged -- wrapper that calls INPC.PropertyChanged protected virtual void FirePropertyChanged(string propertyName) { - PropertyChangedEventHandler handler = PropertyChanged; - if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } // storage for Default Layout Models @@ -393,13 +392,13 @@ namespace FancyZonesEditor private GridLayoutModel _priorityGridModel; private CanvasLayoutModel _blankCustomModel; - private static readonly ushort c_focusModelId = 0xFFFF; - private static readonly ushort c_rowsModelId = 0xFFFE; - private static readonly ushort c_columnsModelId = 0xFFFD; - private static readonly ushort c_gridModelId = 0xFFFC; - private static readonly ushort c_priorityGridModelId = 0xFFFB; - private static readonly ushort c_blankCustomModelId = 0xFFFA; - private static readonly ushort c_lastPrefinedId = c_blankCustomModelId; + private static readonly ushort _focusModelId = 0xFFFF; + private static readonly ushort _rowsModelId = 0xFFFE; + private static readonly ushort _columnsModelId = 0xFFFD; + private static readonly ushort _gridModelId = 0xFFFC; + private static readonly ushort _priorityGridModelId = 0xFFFB; + private static readonly ushort _blankCustomModelId = 0xFFFA; + private static readonly ushort _lastPrefinedId = _blankCustomModelId; // hard coded data for all the "Priority Grid" configurations that are unique to "Grid" private static byte[][] _priorityData = new byte[][] diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml index b66c8c2db5..8601aa0a5c 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:FancyZonesEditor" mc:Ignorable="d" Title="Window1" Height="450" Width="800" WindowState="Maximized" @@ -12,7 +11,7 @@ WindowStyle="None" AllowsTransparency="True" Background="Transparent" - Loaded="onLoad" + Loaded="OnLoaded" > diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml.cs index 8711668c6a..7e57c830df 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/WindowLayout.xaml.cs @@ -7,7 +7,7 @@ using System.Windows; namespace FancyZonesEditor { /// - /// Interaction logic for Window1.xaml + /// Interaction logic for WindowLayout.xaml /// public partial class WindowLayout : Window { @@ -16,9 +16,9 @@ namespace FancyZonesEditor InitializeComponent(); } - void onLoad(object sender, RoutedEventArgs e) + private void OnLoaded(object sender, RoutedEventArgs e) { - //WindowEditor window = new WindowEditor(); window.Show(); + // WindowEditor window = new WindowEditor(); window.Show(); } } }