diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml index 321f459767..29d20ea36c 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml @@ -8,6 +8,7 @@ xmlns:props="clr-namespace:FancyZonesEditor.Properties" mc:Ignorable="d" Title="" + Height="196" MinWidth="360" BorderThickness="0" xmlns:ui="http://schemas.modernwpf.com/2019" @@ -17,8 +18,9 @@ Background="{DynamicResource PrimaryBackgroundBrush}" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" + ContentRendered="EditorWindow_ContentRendered" Closed="OnClosed"> - + - - + diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml.cs index a165de943c..849e5f54f4 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml.cs @@ -59,5 +59,11 @@ namespace FancyZonesEditor App.Overlay.FocusEditor(); } } + + // This is required to fix a WPF rendering bug when using custom chrome + private void EditorWindow_ContentRendered(object sender, System.EventArgs e) + { + InvalidateVisual(); + } } } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml index f353aeb92e..0395ae46da 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml @@ -8,6 +8,7 @@ xmlns:props="clr-namespace:FancyZonesEditor.Properties" mc:Ignorable="d" Title="" + Height="176" MinWidth="360" BorderThickness="0" xmlns:ui="http://schemas.modernwpf.com/2019" @@ -17,8 +18,9 @@ Background="{DynamicResource PrimaryBackgroundBrush}" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" + ContentRendered="EditorWindow_ContentRendered" Closed="OnClosed"> - + - + diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml.cs index df3b8edf9a..72179e5a2a 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml.cs @@ -38,5 +38,11 @@ namespace FancyZonesEditor } private GridLayoutModel _stashedModel; + + // This is required to fix a WPF rendering bug when using custom chrome + private void EditorWindow_ContentRendered(object sender, System.EventArgs e) + { + InvalidateVisual(); + } } }