Skip to content

Commit b05aa84

Browse files
committed
User can drag the window with the title (application / settings)
1 parent dbf4c82 commit b05aa84

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

Source/NETworkManager/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@
498498
<RowDefinition Height="Auto" />
499499
<RowDefinition Height="*" />
500500
</Grid.RowDefinitions>
501-
<Border Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" >
502-
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" Style="{StaticResource HeaderTextBlock}" Text="{Binding SelectedApplicationViewInfo.TranslatedName}" Foreground="{DynamicResource GrayBrush3}" Margin="10,0" />
501+
<Border x:Name="HeaderBorder" Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
502+
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" Style="{StaticResource HeaderTextBlock}" Text="{Binding SelectedApplicationViewInfo.TranslatedName}" Foreground="{DynamicResource GrayBrush3}" Margin="0" />
503503
</Border>
504504
<ContentControl x:Name="contentControlApplication" Grid.Row="1" Focusable="False" />
505505
</Grid>
@@ -520,7 +520,7 @@
520520
<RowDefinition Height="Auto" />
521521
<RowDefinition Height="*" />
522522
</Grid.RowDefinitions>
523-
<Border Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" >
523+
<Border Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
524524
<Grid>
525525
<Grid.ColumnDefinitions>
526526
<ColumnDefinition Width="Auto" />

Source/NETworkManager/MainWindow.xaml.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,15 @@ private void ScrollViewer_ManipulationBoundaryFeedback(object sender, Manipulati
815815
{
816816
e.Handled = true;
817817
}
818-
#endregion
818+
#endregion
819+
820+
#region Window helper
821+
// Move the window when the user hold the title...
822+
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
823+
{
824+
if (e.ChangedButton == MouseButton.Left)
825+
DragMove();
826+
}
827+
#endregion
819828
}
820829
}

0 commit comments

Comments
 (0)