WindowChrome's impact on layout
Closed this issue · 0 comments
Lizhengbo0304 commented
When the window uses WindowChrome, when the window size is modified from the TOP and LEFT directions of the window, FlyleafHost will be misaligned. Delete this code and there will be no problem. I modified your sample code and the effect is as follows:
<Window
Background="Black"
Height="1080"
ResizeMode="CanResizeWithGrip"
Title="Flyleaf MultiPlayer"
Width="1920"
mc:Ignorable="d"
x:Class="FlyleafMultiPlayer__WPF_.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flwpf="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib.Controls.WPF"
xmlns:local="clr-namespace:FlyleafMultiPlayer__WPF_"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="40" GlassFrameThickness="-1" />
</WindowChrome.WindowChrome>
<Window.Resources>
<ResourceDictionary Source="FlyleafMEOverride.xaml" />
</Window.Resources>
<Grid x:Name="MultiPlayer">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="500" Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="500" />
<RowDefinition />
</Grid.RowDefinitions>
<Border
Background="Aqua"
Grid.Column="0"
Grid.Row="0"
Margin="20" />
<flwpf:FlyleafME
Grid.Column="0"
Grid.Row="0"
Margin="20"
Player="{Binding PlayerView1, Mode=TwoWay}"
x:Name="FlyleafME1" />
<Border
Background="Red"
Grid.Column="1"
Grid.Row="0"
Margin="20" />
<flwpf:FlyleafME
Grid.Column="1"
Grid.Row="0"
Margin="20"
Player="{Binding PlayerView2, Mode=TwoWay}" />
<Border
Background="Aquamarine"
Grid.Column="1"
Grid.Row="1"
Margin="20" />
<flwpf:FlyleafME
Grid.Column="1"
Grid.Row="1"
Margin="20"
Player="{Binding PlayerView3, Mode=TwoWay}" />
<Border
Background="Coral"
Grid.Column="0"
Grid.Row="1"
Margin="20" />
<flwpf:FlyleafME
Grid.Column="0"
Grid.Row="1"
Margin="20"
Player="{Binding PlayerView4, Mode=TwoWay}" />
</Grid>
</Window>