Skip to content

Commit 4322401

Browse files
committed
Merge branch 'master' into release
2 parents b6be969 + 08dc608 commit 4322401

File tree

109 files changed

+2574
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2574
-788
lines changed

MahMaterialDragablzMashUp/Buttons.xaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

MahMaterialDragablzMashUp/Cards.xaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

MahMaterialDragablzMashUp/MahAppsDragablzDemo.csproj

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
<Prefer32Bit>true</Prefer32Bit>
5151
</PropertyGroup>
5252
<ItemGroup>
53-
<Reference Include="Dragablz, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
54-
<SpecificVersion>False</SpecificVersion>
55-
<HintPath>..\packages\Dragablz.0.0.1.109\lib\net45\Dragablz.dll</HintPath>
53+
<Reference Include="Dragablz, Version=0.0.3.151, Culture=neutral, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Dragablz.0.0.3.151\lib\net45\Dragablz.dll</HintPath>
55+
<Private>True</Private>
5656
</Reference>
5757
<Reference Include="MahApps.Metro, Version=1.2.0.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
5858
<HintPath>..\packages\MahApps.Metro.1.2.0.0\lib\net45\MahApps.Metro.dll</HintPath>
@@ -81,14 +81,6 @@
8181
<Generator>MSBuild:Compile</Generator>
8282
<SubType>Designer</SubType>
8383
</ApplicationDefinition>
84-
<Page Include="Buttons.xaml">
85-
<SubType>Designer</SubType>
86-
<Generator>MSBuild:Compile</Generator>
87-
</Page>
88-
<Page Include="Cards.xaml">
89-
<SubType>Designer</SubType>
90-
<Generator>MSBuild:Compile</Generator>
91-
</Page>
9284
<Page Include="Dialogs.xaml">
9385
<SubType>Designer</SubType>
9486
<Generator>MSBuild:Compile</Generator>
@@ -97,10 +89,6 @@
9789
<SubType>Designer</SubType>
9890
<Generator>MSBuild:Compile</Generator>
9991
</Page>
100-
<Page Include="TextFields.xaml">
101-
<SubType>Designer</SubType>
102-
<Generator>MSBuild:Compile</Generator>
103-
</Page>
10492
<Page Include="Mah.xaml">
10593
<SubType>Designer</SubType>
10694
<Generator>MSBuild:Compile</Generator>
@@ -114,12 +102,6 @@
114102
<DependentUpon>App.xaml</DependentUpon>
115103
<SubType>Code</SubType>
116104
</Compile>
117-
<Compile Include="Buttons.xaml.cs">
118-
<DependentUpon>Buttons.xaml</DependentUpon>
119-
</Compile>
120-
<Compile Include="Cards.xaml.cs">
121-
<DependentUpon>Cards.xaml</DependentUpon>
122-
</Compile>
123105
<Compile Include="Dialogs.xaml.cs">
124106
<DependentUpon>Dialogs.xaml</DependentUpon>
125107
</Compile>
@@ -128,9 +110,6 @@
128110
<DependentUpon>FlyoutContent.xaml</DependentUpon>
129111
</Compile>
130112
<Compile Include="PaletteSelectorViewModel.cs" />
131-
<Compile Include="TextFields.xaml.cs">
132-
<DependentUpon>TextFields.xaml</DependentUpon>
133-
</Compile>
134113
<Compile Include="Mah.xaml.cs">
135114
<DependentUpon>Mah.xaml</DependentUpon>
136115
</Compile>

MahMaterialDragablzMashUp/MainWindow.xaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,11 @@
1919
</controls:FlyoutsControl>
2020
</controls:MetroWindow.Flyouts>
2121
<dockablz:Layout>
22-
<dragablz:TabablzControl TextElement.Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Window}, Path=(TextElement.Foreground)}"
23-
Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Window}, Path=Background}"
24-
BorderThickness="0"
22+
<dragablz:TabablzControl BorderThickness="0"
2523
Margin="0,-1,0,1">
2624
<dragablz:TabablzControl.InterTabController>
2725
<dragablz:InterTabController />
2826
</dragablz:TabablzControl.InterTabController>
29-
<TabItem Header="CARDS">
30-
<mahMaterialDragablzMashUp:Cards Margin="8" />
31-
</TabItem>
32-
<TabItem Header="BUTTONS">
33-
<mahMaterialDragablzMashUp:Buttons Margin="8" />
34-
</TabItem>
35-
<TabItem Header="FIELDS">
36-
<mahMaterialDragablzMashUp:TextFields Margin="8" />
37-
</TabItem>
38-
<TabItem Header="PALETTE">
39-
<mahMaterialDragablzMashUp:PaletteSelector Margin="16">
40-
<mahMaterialDragablzMashUp:PaletteSelector.DataContext>
41-
<mahMaterialDragablzMashUp:PaletteSelectorViewModel />
42-
</mahMaterialDragablzMashUp:PaletteSelector.DataContext>
43-
</mahMaterialDragablzMashUp:PaletteSelector>
44-
</TabItem>
4527
<TabItem Header="DIALOGS">
4628
<mahMaterialDragablzMashUp:Dialogs Margin="8">
4729
<mahMaterialDragablzMashUp:Dialogs.DataContext>
@@ -50,8 +32,15 @@
5032
</mahMaterialDragablzMashUp:Dialogs>
5133
</TabItem>
5234
<TabItem Header="MAHAPPS">
53-
<mahMaterialDragablzMashUp:Mah Margin="8" />
35+
<mahMaterialDragablzMashUp:Mah Margin="16" />
5436
</TabItem>
37+
<TabItem Header="PALETTE">
38+
<mahMaterialDragablzMashUp:PaletteSelector Margin="16">
39+
<mahMaterialDragablzMashUp:PaletteSelector.DataContext>
40+
<mahMaterialDragablzMashUp:PaletteSelectorViewModel />
41+
</mahMaterialDragablzMashUp:PaletteSelector.DataContext>
42+
</mahMaterialDragablzMashUp:PaletteSelector>
43+
</TabItem>
5544
</dragablz:TabablzControl>
5645
</dockablz:Layout>
5746
</controls:MetroWindow>

MahMaterialDragablzMashUp/PaletteSelector.xaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,23 @@
8585
<RowDefinition Height="Auto" />
8686
<RowDefinition Height="*" />
8787
</Grid.RowDefinitions>
88-
<StackPanel Orientation="Horizontal" Margin="8">
89-
<TextBlock VerticalAlignment="Center">Light</TextBlock>
90-
<ToggleButton Margin="8 0 16 0" Command="{Binding ToggleBaseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" />
91-
<TextBlock VerticalAlignment="Center">Dark</TextBlock>
92-
</StackPanel>
88+
<Grid HorizontalAlignment="Left" Margin="16 0 0 4">
89+
<Grid.RowDefinitions>
90+
<RowDefinition />
91+
<RowDefinition />
92+
</Grid.RowDefinitions>
93+
<Grid.ColumnDefinitions>
94+
<ColumnDefinition />
95+
<ColumnDefinition />
96+
<ColumnDefinition />
97+
</Grid.ColumnDefinitions>
98+
<TextBlock VerticalAlignment="Center">Standard Style</TextBlock>
99+
<ToggleButton Grid.Column="1" Margin="8 4 16 4" Command="{Binding ToggleStyleCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" />
100+
<TextBlock Grid.Column="2" VerticalAlignment="Center">Alternate Style</TextBlock>
101+
<TextBlock Grid.Row="1" VerticalAlignment="Center">Light</TextBlock>
102+
<ToggleButton Grid.Row="1" Grid.Column="1" Margin="8 4 16 4" Command="{Binding ToggleBaseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" />
103+
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">Dark</TextBlock>
104+
</Grid>
93105
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
94106
<ItemsControl ItemsSource="{Binding Swatches, Mode=OneTime}">
95107
<ItemsControl.ItemsPanel>
Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
using MaterialDesignColors;
1+
using System;
2+
using MaterialDesignColors;
23
using MaterialDesignThemes.Wpf;
34
using System.Collections.Generic;
5+
using System.Windows;
46
using System.Windows.Input;
57

68
namespace MahMaterialDragablzMashUp
@@ -12,27 +14,46 @@ public PaletteSelectorViewModel()
1214
Swatches = new SwatchesProvider().Swatches;
1315
}
1416

17+
public ICommand ToggleStyleCommand { get; } = new AnotherCommandImplementation(o => ApplyStyle((bool)o));
18+
1519
public ICommand ToggleBaseCommand { get; } = new AnotherCommandImplementation(o => ApplyBase((bool)o));
1620

21+
public IEnumerable<Swatch> Swatches { get; }
22+
23+
public ICommand ApplyPrimaryCommand { get; } = new AnotherCommandImplementation(o => ApplyPrimary((Swatch)o));
24+
25+
public ICommand ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o));
26+
27+
private static void ApplyStyle(bool alternate)
28+
{
29+
var resourceDictionary = new ResourceDictionary
30+
{
31+
Source = new Uri(@"pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml")
32+
};
33+
34+
var styleKey = alternate ? "MaterialDesignAlternateTabablzControlStyle" : "MaterialDesignTabablzControlStyle";
35+
var style = (Style) resourceDictionary[styleKey];
36+
37+
foreach (var tabablzControl in Dragablz.TabablzControl.GetLoadedInstances())
38+
{
39+
tabablzControl.Style = style;
40+
}
41+
}
42+
1743
private static void ApplyBase(bool isDark)
1844
{
1945
new PaletteHelper().SetLightDark(isDark);
2046
}
2147

22-
public IEnumerable<Swatch> Swatches { get; }
23-
24-
public ICommand ApplyPrimaryCommand { get; } = new AnotherCommandImplementation(o => ApplyPrimary((Swatch)o));
25-
2648
private static void ApplyPrimary(Swatch swatch)
2749
{
2850
new PaletteHelper().ReplacePrimaryColor(swatch);
2951
}
3052

31-
public ICommand ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o));
32-
3353
private static void ApplyAccent(Swatch swatch)
3454
{
3555
new PaletteHelper().ReplaceAccentColor(swatch);
3656
}
57+
3758
}
3859
}

0 commit comments

Comments
 (0)