Skip to content

Commit ff1640e

Browse files
authored
Merge pull request #428 from mgnslndh/PopupBoxWindowCommand
Explicit styling of PoupBox used as a Window Command in MahApps
2 parents ffdaaa8 + 607b270 commit ff1640e

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

MahMaterialDragablzMashUp/MainWindow.xaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
66
xmlns:mahMaterialDragablzMashUp="clr-namespace:MahMaterialDragablzMashUp"
77
xmlns:dockablz="clr-namespace:Dragablz.Dockablz;assembly=Dragablz"
8+
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes"
89
WindowTransitionsEnabled="False"
910
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
1011
Background="{DynamicResource MaterialDesignPaper}"
@@ -18,7 +19,18 @@
1819
</controls:Flyout>
1920
</controls:FlyoutsControl>
2021
</controls:MetroWindow.Flyouts>
21-
<dockablz:Layout>
22+
<controls:MetroWindow.LeftWindowCommands>
23+
<controls:WindowCommands>
24+
<wpf:PopupBox Style="{StaticResource WindowCommandsPopupBoxStyle}">
25+
<StackPanel>
26+
<Button Content="Hello World"/>
27+
<Button Content="Nice Popup"/>
28+
<Button Content="Goodbye"/>
29+
</StackPanel>
30+
</wpf:PopupBox>
31+
</controls:WindowCommands>
32+
</controls:MetroWindow.LeftWindowCommands>
33+
<dockablz:Layout>
2234
<dragablz:TabablzControl BorderThickness="0"
2335
Margin="0,-1,0,1">
2436
<dragablz:TabablzControl.InterTabController>

MaterialDesignThemes.MahApps/MaterialDesignThemes.MahApps.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
<SubType>Designer</SubType>
8080
<Generator>MSBuild:Compile</Generator>
8181
</Page>
82+
<Page Include="Themes\MaterialDesignTheme.MahApps.WindowCommands.xaml">
83+
<SubType>Designer</SubType>
84+
<Generator>MSBuild:Compile</Generator>
85+
</Page>
8286
</ItemGroup>
8387
<ItemGroup>
8488
<Compile Include="FlyoutAssist.cs" />

MaterialDesignThemes.MahApps/Themes/MaterialDesignTheme.MahApps.Defaults.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" />
77
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />
88
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.RangeSlider.xaml" />
9+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.WindowCommands.xaml" />
910
</ResourceDictionary.MergedDictionaries>
1011

1112
<Style TargetType="{x:Type controls:RangeSlider}" BasedOn="{StaticResource MaterialDesignRangeSlider}" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes"
4+
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls">
5+
6+
<ResourceDictionary.MergedDictionaries>
7+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
8+
</ResourceDictionary.MergedDictionaries>
9+
10+
<Style x:Key="WindowCommandsPopupBoxStyle" TargetType="{x:Type wpf:PopupBox}" BasedOn="{StaticResource MaterialDesignPopupBox}">
11+
<Setter Property="Opacity" Value="0.5"/>
12+
<Style.Triggers>
13+
<Trigger Property="IsMouseOver" Value="True">
14+
<Setter Property="Opacity" Value="1" />
15+
</Trigger>
16+
</Style.Triggers>
17+
</Style>
18+
19+
</ResourceDictionary>

0 commit comments

Comments
 (0)