Skip to content

Commit 605b92f

Browse files
committed
Header added to tab windows
1 parent 2841a93 commit 605b92f

17 files changed

Lines changed: 145 additions & 18 deletions

‎Source/NETworkManager/Controls/DragablzDNSLookupTabHostWindow.xaml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
<Controls:WindowButtonCommands Template="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
1212
</Controls:MetroWindow.WindowButtonCommands>
1313
<Grid>
14-
<dragablz:TabablzControl Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
14+
<Grid.RowDefinitions>
15+
<RowDefinition Height="Auto" />
16+
<RowDefinition Height="*" />
17+
</Grid.RowDefinitions>
18+
<Border x:Name="HeaderBorder" Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
19+
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" FontSize="22" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_ApplicationName_DNSLookup}" Foreground="{DynamicResource GrayBrush3}" Margin="0" />
20+
</Border>
21+
<dragablz:TabablzControl Grid.Row="1" Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
1522
<dragablz:TabablzControl.InterTabController>
1623
<dragablz:InterTabController Partition="65F3827B-9222-48CF-A49A-FCE0841D836D" />
1724
</dragablz:TabablzControl.InterTabController>

‎Source/NETworkManager/Controls/DragablzDNSLookupTabHostWindow.xaml.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Dragablz;
22
using MahApps.Metro.Controls;
33
using NETworkManager.Views;
4+
using System.Windows.Input;
45

56
namespace NETworkManager.Controls
67
{
@@ -26,5 +27,14 @@ private void CloseItemAction(ItemActionCallbackArgs<TabablzControl> args)
2627
((args.DragablzItem.Content as DragablzDNSLookupTabItem).View as DNSLookupView).CloseTab();
2728
}
2829
#endregion
30+
31+
#region Window helper
32+
// Move the window when the user hold the title...
33+
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
34+
{
35+
if (e.ChangedButton == MouseButton.Left)
36+
DragMove();
37+
}
38+
#endregion
2939
}
3040
}

‎Source/NETworkManager/Controls/DragablzIPScannerTabHostWindow.xaml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
<Controls:WindowButtonCommands Template="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
1212
</Controls:MetroWindow.WindowButtonCommands>
1313
<Grid>
14-
<dragablz:TabablzControl Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
14+
<Grid.RowDefinitions>
15+
<RowDefinition Height="Auto" />
16+
<RowDefinition Height="*" />
17+
</Grid.RowDefinitions>
18+
<Border x:Name="HeaderBorder" Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
19+
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" FontSize="22" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_ApplicationName_IPScanner}" Foreground="{DynamicResource GrayBrush3}" Margin="0" />
20+
</Border>
21+
<dragablz:TabablzControl Grid.Row="0" Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
1522
<dragablz:TabablzControl.InterTabController>
1623
<dragablz:InterTabController Partition="8BB70C7B-7473-4A28-89A1-BAA205D6A39D" />
1724
</dragablz:TabablzControl.InterTabController>

‎Source/NETworkManager/Controls/DragablzIPScannerTabHostWindow.xaml.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Dragablz;
22
using MahApps.Metro.Controls;
33
using NETworkManager.Views;
4+
using System.Windows.Input;
45

56
namespace NETworkManager.Controls
67
{
@@ -26,5 +27,14 @@ private void CloseItemAction(ItemActionCallbackArgs<TabablzControl> args)
2627
((args.DragablzItem.Content as DragablzIPScannerTabItem).View as IPScannerView).CloseTab();
2728
}
2829
#endregion
30+
31+
#region Window helper
32+
// Move the window when the user hold the title...
33+
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
34+
{
35+
if (e.ChangedButton == MouseButton.Left)
36+
DragMove();
37+
}
38+
#endregion
2939
}
3040
}

‎Source/NETworkManager/Controls/DragablzPingTabHostWindow.xaml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
<Controls:WindowButtonCommands Template="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
1212
</Controls:MetroWindow.WindowButtonCommands>
1313
<Grid>
14-
<dragablz:TabablzControl Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
14+
<Grid.RowDefinitions>
15+
<RowDefinition Height="Auto" />
16+
<RowDefinition Height="*" />
17+
</Grid.RowDefinitions>
18+
<Border x:Name="HeaderBorder" Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
19+
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" FontSize="22" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_ApplicationName_Ping}" Foreground="{DynamicResource GrayBrush3}" Margin="0" />
20+
</Border>
21+
<dragablz:TabablzControl Grid.Row="1" Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
1522
<dragablz:TabablzControl.InterTabController>
1623
<dragablz:InterTabController Partition="DF0DC56F-0C28-4917-B1B1-5DA7A9C8FFA5" />
1724
</dragablz:TabablzControl.InterTabController>

‎Source/NETworkManager/Controls/DragablzPingTabHostWindow.xaml.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Dragablz;
22
using MahApps.Metro.Controls;
33
using NETworkManager.Views;
4+
using System.Windows.Input;
45

56
namespace NETworkManager.Controls
67
{
@@ -26,5 +27,14 @@ private void CloseItemAction(ItemActionCallbackArgs<TabablzControl> args)
2627
((args.DragablzItem.Content as DragablzPingTabItem).View as PingView).CloseTab();
2728
}
2829
#endregion
30+
31+
#region Window helper
32+
// Move the window when the user hold the title...
33+
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
34+
{
35+
if (e.ChangedButton == MouseButton.Left)
36+
DragMove();
37+
}
38+
#endregion
2939
}
3040
}

‎Source/NETworkManager/Controls/DragablzPortScannerTabHostWindow.xaml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
<Controls:WindowButtonCommands Template="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
1212
</Controls:MetroWindow.WindowButtonCommands>
1313
<Grid>
14-
<dragablz:TabablzControl Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
14+
<Grid.RowDefinitions>
15+
<RowDefinition Height="Auto" />
16+
<RowDefinition Height="*" />
17+
</Grid.RowDefinitions>
18+
<Border x:Name="HeaderBorder" Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
19+
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" FontSize="22" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_ApplicationName_PortScanner}" Foreground="{DynamicResource GrayBrush3}" Margin="0" />
20+
</Border>
21+
<dragablz:TabablzControl Grid.Row="1" Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
1522
<dragablz:TabablzControl.InterTabController>
1623
<dragablz:InterTabController Partition="E6BFC741-E391-43D3-92D7-0227277D256E" />
1724
</dragablz:TabablzControl.InterTabController>

‎Source/NETworkManager/Controls/DragablzPortScannerTabHostWindow.xaml.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Dragablz;
22
using MahApps.Metro.Controls;
33
using NETworkManager.Views;
4+
using System.Windows.Input;
45

56
namespace NETworkManager.Controls
67
{
@@ -26,5 +27,14 @@ private void CloseItemAction(ItemActionCallbackArgs<TabablzControl> args)
2627
((args.DragablzItem.Content as DragablzPortScannerTabItem).View as PortScannerView).CloseTab();
2728
}
2829
#endregion
30+
31+
#region Window helper
32+
// Move the window when the user hold the title...
33+
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
34+
{
35+
if (e.ChangedButton == MouseButton.Left)
36+
DragMove();
37+
}
38+
#endregion
2939
}
3040
}

‎Source/NETworkManager/Controls/DragablzPuTTYTabHostWindow.xaml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
<Controls:WindowButtonCommands Template="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
1313
</Controls:MetroWindow.WindowButtonCommands>
1414
<Grid>
15-
<dragablz:TabablzControl Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
15+
<Grid.RowDefinitions>
16+
<RowDefinition Height="Auto" />
17+
<RowDefinition Height="*" />
18+
</Grid.RowDefinitions>
19+
<Border x:Name="HeaderBorder" Grid.Row="0" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,0,0,1" MouseDown="HeaderBorder_MouseDown">
20+
<TextBlock VerticalAlignment="Center" Height="48" TextAlignment="Center" FontSize="22" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_ApplicationName_PuTTY}" Foreground="{DynamicResource GrayBrush3}" Margin="0" />
21+
</Border>
22+
<dragablz:TabablzControl Grid.Row="1" Name="TabsContainer" ClosingItemCallback="{Binding CloseItemCommand}">
1623
<dragablz:TabablzControl.InterTabController>
1724
<dragablz:InterTabController Partition="70BF46A6-B55D-4DC2-B8BD-6B61EFC95883" />
1825
</dragablz:TabablzControl.InterTabController>

‎Source/NETworkManager/Controls/DragablzPuTTYTabHostWindow.xaml.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Dragablz;
22
using MahApps.Metro.Controls;
3+
using System.Windows.Input;
34

45
namespace NETworkManager.Controls
56
{
@@ -25,5 +26,14 @@ private void CloseItemAction(ItemActionCallbackArgs<TabablzControl> args)
2526
((args.DragablzItem.Content as DragablzPuTTYTabItem).View as PuTTYControl).OnClose();
2627
}
2728
#endregion
29+
30+
#region Window helper
31+
// Move the window when the user hold the title...
32+
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
33+
{
34+
if (e.ChangedButton == MouseButton.Left)
35+
DragMove();
36+
}
37+
#endregion
2838
}
2939
}

0 commit comments

Comments
 (0)