Skip to content

Commit 970eddd

Browse files
committed
Some tries with dragablz
1 parent 8a49924 commit 970eddd

6 files changed

Lines changed: 91 additions & 18 deletions

File tree

‎Source/NETworkManager/App.xaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
<ResourceDictionary Source="/Resources/Styles/ButtonStyles.xaml" />
2727
<ResourceDictionary Source="/Resources/Styles/ComboBoxStyles.xaml" />
2828
<ResourceDictionary Source="/Resources/Styles/DataGridStyles.xaml" />
29-
<ResourceDictionary Source="/Resources/Styles/DragablzStyles.xaml" />
30-
<ResourceDictionary Source="/Resources/Styles/ExpanderStyles.xaml" />
3129
<ResourceDictionary Source="/Resources/Styles/GroupBoxStyles.xaml" />
3230
<ResourceDictionary Source="/Resources/Styles/NumericUpDownStyles.xaml" />
3331
<ResourceDictionary Source="/Resources/Styles/ScrollBarStyles.xaml" />
@@ -37,6 +35,9 @@
3735
<ResourceDictionary Source="/Resources/Styles/TextBoxStyles.xaml" />
3836
<ResourceDictionary Source="/Resources/Styles/ToogleSwitchStyles.xaml" />
3937
<ResourceDictionary Source="/Resources/Styles/WindowStyles.xaml" />
38+
<!-- Dependent styles -->
39+
<ResourceDictionary Source="/Resources/Styles/DragablzStyles.xaml" /> <!-- Requires button and textbox styles -->
40+
<ResourceDictionary Source="/Resources/Styles/ExpanderStyles.xaml" /> <!-- Required button styles -->
4041
</ResourceDictionary.MergedDictionaries>
4142
</ResourceDictionary>
4243
</Application.Resources>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,95 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:IconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
34
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz">
5+
6+
<Style TargetType="{x:Type Thumb}" x:Key="InvisibleThumbStyle">
7+
<Setter Property="Background" Value="Transparent" />
8+
<Setter Property="Template">
9+
<Setter.Value>
10+
<ControlTemplate>
11+
<Grid Background="{TemplateBinding Background}" />
12+
</ControlTemplate>
13+
</Setter.Value>
14+
</Setter>
15+
</Style>
16+
17+
<Style TargetType="{x:Type Button}" x:Key="MahAppsMenuCommandButtonStyle">
18+
<Setter Property="FocusVisualStyle" Value="{StaticResource MahAppsFocusVisual}"/>
19+
<Setter Property="Background" Value="Transparent"/>
20+
<Setter Property="BorderBrush" Value="Transparent"/>
21+
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
22+
<Setter Property="BorderThickness" Value="0"/>
23+
<Setter Property="HorizontalContentAlignment" Value="Center"/>
24+
<Setter Property="VerticalContentAlignment" Value="Center"/>
25+
<Setter Property="Padding" Value="1"/>
26+
<Setter Property="Opacity" Value=".8"/>
27+
<Setter Property="Width" Value="24"/>
28+
<Setter Property="Height" Value="20"/>
29+
<Setter Property="Template">
30+
<Setter.Value>
31+
<ControlTemplate TargetType="{x:Type Button}">
32+
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
33+
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
34+
</Border>
35+
<ControlTemplate.Triggers>
36+
<Trigger Property="IsDefaulted" Value="true">
37+
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
38+
</Trigger>
39+
<Trigger Property="IsEnabled" Value="false">
40+
<Setter Property="Opacity" TargetName="border" Value=".5"/>
41+
</Trigger>
42+
</ControlTemplate.Triggers>
43+
</ControlTemplate>
44+
</Setter.Value>
45+
</Setter>
46+
<Style.Triggers>
47+
<Trigger Property="IsMouseOver" Value="true">
48+
<Setter Property="Background" Value="{x:Static dragablz:DragablzColors.WindowGlassBrush}"/>
49+
<Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
50+
</Trigger>
51+
<Trigger Property="IsPressed" Value="true">
52+
<Setter Property="Opacity" Value="1"/>
53+
</Trigger>
54+
</Style.Triggers>
55+
</Style>
56+
57+
<Style TargetType="{x:Type Button}" x:Key="AddItemCommandButtonStyle" BasedOn="{StaticResource MahAppsMenuCommandButtonStyle}">
58+
<Setter Property="Template">
59+
<Setter.Value>
60+
<ControlTemplate>
61+
<Rectangle Width="16" Height="16" Margin="10,5,0,5" Fill="{DynamicResource GrayBrush3}">
62+
<Rectangle.OpacityMask>
63+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:PackIconMaterial Kind=Close}" />
64+
</Rectangle.OpacityMask>
65+
</Rectangle>
66+
</ControlTemplate>
67+
</Setter.Value>
68+
</Setter>
69+
</Style>
70+
471
<Style TargetType="{x:Type dragablz:TabablzControl}" BasedOn="{StaticResource MahAppsTabablzControlStyle}" >
572
<Setter Property="BorderBrush" Value="{DynamicResource GrayBrush8}" />
673
<Setter Property="BorderThickness" Value="0,1,0,0" />
74+
<Setter Property="ShowDefaultAddButton" Value="True" />
75+
<Setter Property="HeaderItemTemplate">
76+
<Setter.Value>
77+
<DataTemplate>
78+
<StackPanel Orientation="Horizontal">
79+
<Grid>
80+
<TextBlock Text="{Binding}" FontSize="18" Style="{StaticResource HeaderTextBlock}" Margin="0" />
81+
<Thumb Style="{DynamicResource InvisibleThumbStyle}" dragablz:DragablzItem.IsCustomThumb="True" />
82+
</Grid>
83+
<Button Style="{StaticResource CleanButton}" Command="dragablz:TabablzControl.CloseItemCommand">
84+
<Rectangle Width="16" Height="16" Margin="10,5,0,5" Fill="{DynamicResource GrayBrush3}">
85+
<Rectangle.OpacityMask>
86+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:PackIconMaterial Kind=Close}" />
87+
</Rectangle.OpacityMask>
88+
</Rectangle>
89+
</Button>
90+
</StackPanel>
91+
</DataTemplate>
92+
</Setter.Value>
93+
</Setter>
794
</Style>
895
</ResourceDictionary>

‎Source/NETworkManager/Resources/Styles/ExpanderStyles.xaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
44
xmlns:IconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
55
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls">
6-
<ResourceDictionary.MergedDictionaries>
7-
<ResourceDictionary Source="/Resources/Styles/TextBlockStyles.xaml" />
8-
</ResourceDictionary.MergedDictionaries>
9-
106
<Style x:Key="ExpanderDownHeader" BasedOn="{StaticResource ExpanderDownHeaderStyle}" TargetType="{x:Type ToggleButton}">
117
<Setter Property="Template">
128
<Setter.Value>

‎Source/NETworkManager/Resources/Styles/MetroDialogStyles.xaml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
4-
<ResourceDictionary.MergedDictionaries>
5-
<ResourceDictionary Source="/Resources/Styles/ButtonStyles.xaml" />
6-
</ResourceDictionary.MergedDictionaries>
7-
4+
85
<!-- Override the buttons in MahApps.Metro Dialogs -->
96
<Style BasedOn="{StaticResource DefaultButton}" TargetType="{x:Type Button}" />
107
<Style x:Key="AccentedDialogSquareButton" BasedOn="{StaticResource HighlightedButton}" TargetType="{x:Type Button}" />

‎Source/NETworkManager/Resources/Styles/TextBlockStyles.xaml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3-
<ResourceDictionary.MergedDictionaries>
4-
<!-- MahApps.Metro resource dictionaries. -->
5-
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
6-
</ResourceDictionary.MergedDictionaries>
7-
83
<Style x:Key="DefaultTextBlock" TargetType="{x:Type TextBlock}">
94
<Setter Property="FontSize" Value="14" />
105
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />

‎Source/NETworkManager/Resources/Styles/WindowStyles.xaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
4-
<ResourceDictionary.MergedDictionaries>
5-
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Clean/Clean.xaml" />
6-
</ResourceDictionary.MergedDictionaries>
74
<Style x:Key="DefaultWindow" TargetType="{x:Type Controls:MetroWindow}" BasedOn="{StaticResource CleanWindowStyleKey}" >
85
<Setter Property="TitleCaps" Value="False" />
96
<Setter Property="EnableDWMDropShadow" Value="True" />

0 commit comments

Comments
 (0)