1
Vote

GridSplitter will crash the BorderlessWindow

description

If the BorderlessWindow contains a GridSplitter, it will crash when dragging the splitter. To resolve the problem, an AdornerDecorator layer should be added to the MainWindowControlTemplate:
    <ControlTemplate x:Key="MainWindowControlTemplate" TargetType="{x:Type local:WindowBorderLess}">
        <AdornerDecorator> 
        <Border Background="{DynamicResource MainWindowBackground}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <!-- Captions Buttons to control the window borderless-->
                <ctrl:CaptionButtons Margin="0,0,10,0" Grid.Row="0" HorizontalAlignment="Right" Type="Full"
                                        Foreground="{DynamicResource CaptionButtonColor}" FontSize="14" MarginButton="0,0,5,0"
                                        VerticalAlignment="Center" shell:WindowChrome.IsHitTestVisibleInChrome="True"/>

                <ContentPresenter Margin="6" Grid.Row="1" Content="{TemplateBinding Content}"/>
            </Grid>
        </Border>
        </AdornerDecorator>
    </ControlTemplate>

comments