0

I've made a custom title bar and I'm struggling with the window drag function. This question is clearly not a duplicate...

My Grid:

    <Grid VerticalAlignment="Top" x:Name="TitleBar" Panel.ZIndex="1" MouseLeftButtonDown="WindowDrag">
        
        <StackPanel Height="30" WindowChrome.IsHitTestVisibleInChrome="True"   
                    VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal">

            <Button Width="30" Style="{StaticResource DisabledButton}">
                <StackPanel>
                    <Ellipse Fill="#00CA4E" Width="10" Height="10"/>
                </StackPanel>
            </Button>

        </StackPanel>

I've also tried adding MouseLeftButtonDown to the StackPanel it didn't work either.

My Code:

    private void WindowDrag(object sender, MouseButtonEventArgs e)
    {
         this.DragMove();
    }
GoekhanDev
  • 326
  • 2
  • 4
  • 20

0 Answers0