Skip to content

Commit 022c0d3

Browse files
committed
Using MahApps.Metro to get a Metro look for the WPF window
1 parent 398e969 commit 022c0d3

File tree

83 files changed

+36554
-27
lines changed

Some content is hidden

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

83 files changed

+36554
-27
lines changed

.releaseconfig/ReleaseConfig.xml

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,51 @@
1515
<Path>/CHANGELOG.md</Path>
1616
</VersionFile>
1717
</VersionFiles>
18-
<BinaryFiles>
19-
<BinaryFile>
20-
<SourcePath>/AssemblyInfoHelper_WPF/bin/Release/AssemblyInfoHelper_WPF.dll</SourcePath>
21-
<DestinationPath>/bin/AssemblyInfoHelper_WPF.dll</DestinationPath>
22-
</BinaryFile>
23-
<BinaryFile>
24-
<SourcePath>/AssemblyInfoHelper_WPF/bin/Release/Markdig.dll</SourcePath>
25-
<DestinationPath>/bin/Markdig.dll</DestinationPath>
26-
</BinaryFile>
27-
<BinaryFile>
28-
<SourcePath>/AssemblyInfoProject_WPF/bin/Release/AssemblyInfoProject_WPF.exe</SourcePath>
29-
<DestinationPath>/bin/AssemblyInfoProject_WPF.exe</DestinationPath>
30-
</BinaryFile>
31-
</BinaryFiles>
18+
<BinaryObjects>
19+
<BinaryObject xsi:type="BinaryFile">
20+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
21+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\AssemblyInfoHelper_WPF.dll</SourcePath>
22+
<DestinationPath>\bin\AssemblyInfoHelper_WPF.dll</DestinationPath>
23+
</BinaryObject>
24+
<BinaryObject xsi:type="BinaryFile">
25+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
26+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\Markdig.dll</SourcePath>
27+
<DestinationPath>\bin\Markdig.dll</DestinationPath>
28+
</BinaryObject>
29+
<BinaryObject xsi:type="BinaryFile">
30+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
31+
<SourcePath>\AssemblyInfoProject_WPF\bin\Release\AssemblyInfoProject_WPF.exe</SourcePath>
32+
<DestinationPath>\bin\AssemblyInfoProject_WPF.exe</DestinationPath>
33+
</BinaryObject>
34+
<BinaryObject xsi:type="BinaryFile">
35+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
36+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\ControlzEx.dll</SourcePath>
37+
<DestinationPath>\bin\ControlzEx.dll</DestinationPath>
38+
</BinaryObject>
39+
<BinaryObject xsi:type="BinaryFile">
40+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
41+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\MahApps.Metro.dll</SourcePath>
42+
<DestinationPath>\bin\MahApps.Metro.dll</DestinationPath>
43+
</BinaryObject>
44+
<BinaryObject xsi:type="BinaryFile">
45+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
46+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\MahApps.Metro.IconPacks.Core.dll</SourcePath>
47+
<DestinationPath>\bin\MahApps.Metro.IconPacks.Core.dll</DestinationPath>
48+
</BinaryObject>
49+
<BinaryObject xsi:type="BinaryFile">
50+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
51+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\MahApps.Metro.IconPacks.dll</SourcePath>
52+
<DestinationPath>\bin\MahApps.Metro.IconPacks.dll</DestinationPath>
53+
</BinaryObject>
54+
<BinaryObject xsi:type="BinaryFile">
55+
<RemoveWhileBuilding>true</RemoveWhileBuilding>
56+
<SourcePath>\AssemblyInfoHelper_WPF\bin\Release\Microsoft.Xaml.Behaviors.dll</SourcePath>
57+
<DestinationPath>\bin\Microsoft.Xaml.Behaviors.dll</DestinationPath>
58+
</BinaryObject>
59+
</BinaryObjects>
3260
<ReleaseBuildProcesses>
3361
<BuildProcess>
34-
<Executablepath>C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe</Executablepath>
62+
<Executablepath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe</Executablepath>
3563
<Arguments>AssemblyInfoProject.sln /p:Configuration=Release</Arguments>
3664
<WorkDir>\</WorkDir>
3765
</BuildProcess>

AssemblyInfoHelper_WPF/AssemblyInfoHelper_WPF.csproj

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,34 @@
3030
<ErrorReport>prompt</ErrorReport>
3131
<WarningLevel>4</WarningLevel>
3232
</PropertyGroup>
33+
<PropertyGroup>
34+
<PostBuildEvent>copy "$(SolutionDir)README.md" "$(TargetDir)README.md"
35+
copy "$(SolutionDir)CHANGELOG.md" "$(TargetDir)CHANGELOG.md"</PostBuildEvent>
36+
</PropertyGroup>
3337
<ItemGroup>
38+
<Reference Include="ControlzEx, Version=4.0.0.0, Culture=neutral, PublicKeyToken=69f1c32f803d307e, processorArchitecture=MSIL">
39+
<HintPath>..\packages\ControlzEx.4.0.0-alpha0222\lib\net45\ControlzEx.dll</HintPath>
40+
</Reference>
41+
<Reference Include="MahApps.Metro, Version=2.0.0.0, Culture=neutral, PublicKeyToken=51482d6f650b2b3f, processorArchitecture=MSIL">
42+
<HintPath>..\packages\MahApps.Metro.2.0.0-alpha0261\lib\net45\MahApps.Metro.dll</HintPath>
43+
</Reference>
44+
<Reference Include="MahApps.Metro.IconPacks, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0c0d510f9915137a, processorArchitecture=MSIL">
45+
<HintPath>..\packages\MahApps.Metro.IconPacks.3.0.0-alpha0103\lib\net45\MahApps.Metro.IconPacks.dll</HintPath>
46+
</Reference>
47+
<Reference Include="MahApps.Metro.IconPacks.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0c0d510f9915137a, processorArchitecture=MSIL">
48+
<HintPath>..\packages\MahApps.Metro.IconPacks.3.0.0-alpha0103\lib\net45\MahApps.Metro.IconPacks.Core.dll</HintPath>
49+
</Reference>
3450
<Reference Include="Markdig, Version=0.15.2.0, Culture=neutral, processorArchitecture=MSIL">
3551
<HintPath>..\packages\Markdig.0.15.2\lib\net40\Markdig.dll</HintPath>
3652
</Reference>
53+
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.0.1\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
55+
</Reference>
3756
<Reference Include="PresentationCore" />
3857
<Reference Include="PresentationFramework" />
3958
<Reference Include="System" />
59+
<Reference Include="System.ComponentModel.DataAnnotations" />
60+
<Reference Include="System.Configuration" />
4061
<Reference Include="System.Core" />
4162
<Reference Include="System.Drawing" />
4263
<Reference Include="System.Windows" />

AssemblyInfoHelper_WPF/WindowAssemblyInfo.xaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1-
<Window x:Class="AssemblyInfoHelper_WPF.WindowAssemblyInfo"
1+
<MetroControls:MetroWindow x:Class="AssemblyInfoHelper_WPF.WindowAssemblyInfo"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:AssemblyInfoHelper_WPF"
7+
xmlns:MetroControls="http://metro.mahapps.com/winfx/xaml/controls"
8+
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
9+
xmlns:MetroDialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
710
mc:Ignorable="d"
8-
Title="Assembly info" Height="375" Width="800" MinHeight="375" Loaded="Window_Loaded" >
11+
Title="Assembly info" Height="375" Width="800" MinHeight="400" Loaded="Window_Loaded" >
12+
13+
<MetroControls:MetroWindow.RightWindowCommands>
14+
<MetroControls:WindowCommands>
15+
<Button Click="BtnAssemblyVerion_Click" ToolTip="AssemblyInfoHelper version">
16+
<iconPacks:PackIconModern Width="22" Height="22" Kind="InformationCircle" />
17+
</Button>
18+
</MetroControls:WindowCommands>
19+
</MetroControls:MetroWindow.RightWindowCommands>
20+
921
<Grid>
10-
<TabControl>
22+
<MetroControls:MetroTabControl MetroControls:TabControlHelper.Underlined="SelectedTabItem">
1123
<TabItem Header="General infos">
12-
<Grid>
24+
<Grid Margin="10">
1325
<Grid.RowDefinitions>
1426
<RowDefinition Height="30"/>
1527
<RowDefinition Height="30"/>
@@ -57,6 +69,6 @@
5769
<TabItem Header="Changelog">
5870
<WebBrowser x:Name="webBrowser_Changelog"/>
5971
</TabItem>
60-
</TabControl>
72+
</MetroControls:MetroTabControl>
6173
</Grid>
62-
</Window>
74+
</MetroControls:MetroWindow>

AssemblyInfoHelper_WPF/WindowAssemblyInfo.xaml.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@
1414
using System.Windows.Shapes;
1515

1616
using Markdig;
17+
using MahApps.Metro.Controls;
18+
using MahApps.Metro.Controls.Dialogs;
1719
using System.IO;
1820

1921
namespace AssemblyInfoHelper_WPF
2022
{
2123
/// <summary>
2224
/// Interaktionslogik für WindowAssemblyInfo.xaml
2325
/// </summary>
24-
public partial class WindowAssemblyInfo : Window
26+
public partial class WindowAssemblyInfo : MetroWindow
2527
{
28+
public string AssemblyInfoHelperVersion
29+
{
30+
get { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
31+
}
32+
2633
private string _readmePath;
2734
private string _changeLogPath;
2835

@@ -78,5 +85,10 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
7885
webBrowser_Readme.NavigateToString(readmeText);
7986
webBrowser_Changelog.NavigateToString(changelogText);
8087
}
88+
89+
private async void BtnAssemblyVerion_Click(object sender, RoutedEventArgs e)
90+
{
91+
await this.ShowMessageAsync("AssemblyInfoHelper Version", AssemblyInfoHelperVersion, MessageDialogStyle.Affirmative, new MetroDialogSettings() { OwnerCanCloseWithDialog = true });
92+
}
8193
}
8294
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="ControlzEx" version="4.0.0-alpha0222" targetFramework="net45" />
4+
<package id="MahApps.Metro" version="2.0.0-alpha0261" targetFramework="net45" />
5+
<package id="MahApps.Metro.IconPacks" version="3.0.0-alpha0103" targetFramework="net45" />
36
<package id="Markdig" version="0.15.2" targetFramework="net45" />
7+
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.0.1" targetFramework="net45" />
48
</packages>

AssemblyInfoProject_WPF/App.xaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
xmlns:local="clr-namespace:AssemblyInfoProject_WPF"
55
StartupUri="MainWindow.xaml">
66
<Application.Resources>
7-
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
10+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
12+
<!-- Accent and AppTheme setting -->
13+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
14+
</ResourceDictionary.MergedDictionaries>
15+
</ResourceDictionary>
816
</Application.Resources>
917
</Application>

AssemblyInfoProject_WPF/AssemblyInfoProject_WPF.csproj

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,32 @@
3232
<ErrorReport>prompt</ErrorReport>
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
35+
<PropertyGroup>
36+
<PostBuildEvent>copy "$(SolutionDir)README.md" "$(TargetDir)README.md"
37+
copy "$(SolutionDir)CHANGELOG.md" "$(TargetDir)CHANGELOG.md"</PostBuildEvent>
38+
</PropertyGroup>
3539
<ItemGroup>
3640
<Reference Include="AssemblyInfoHelper_WPF">
3741
<HintPath>..\AssemblyInfoHelper_WPF\bin\Debug\AssemblyInfoHelper_WPF.dll</HintPath>
3842
</Reference>
43+
<Reference Include="ControlzEx, Version=4.0.0.0, Culture=neutral, PublicKeyToken=69f1c32f803d307e, processorArchitecture=MSIL">
44+
<HintPath>..\packages\ControlzEx.4.0.0-alpha0222\lib\net45\ControlzEx.dll</HintPath>
45+
</Reference>
46+
<Reference Include="MahApps.Metro, Version=2.0.0.0, Culture=neutral, PublicKeyToken=51482d6f650b2b3f, processorArchitecture=MSIL">
47+
<HintPath>..\packages\MahApps.Metro.2.0.0-alpha0261\lib\net45\MahApps.Metro.dll</HintPath>
48+
</Reference>
49+
<Reference Include="MahApps.Metro.IconPacks, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0c0d510f9915137a, processorArchitecture=MSIL">
50+
<HintPath>..\packages\MahApps.Metro.IconPacks.3.0.0-alpha0103\lib\net45\MahApps.Metro.IconPacks.dll</HintPath>
51+
</Reference>
52+
<Reference Include="MahApps.Metro.IconPacks.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0c0d510f9915137a, processorArchitecture=MSIL">
53+
<HintPath>..\packages\MahApps.Metro.IconPacks.3.0.0-alpha0103\lib\net45\MahApps.Metro.IconPacks.Core.dll</HintPath>
54+
</Reference>
55+
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
56+
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.0.1\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
57+
</Reference>
3958
<Reference Include="System" />
59+
<Reference Include="System.ComponentModel.DataAnnotations" />
60+
<Reference Include="System.Configuration" />
4061
<Reference Include="System.Data" />
4162
<Reference Include="System.Drawing" />
4263
<Reference Include="System.Xml" />
@@ -89,6 +110,7 @@
89110
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
90111
<SubType>Designer</SubType>
91112
</EmbeddedResource>
113+
<None Include="packages.config" />
92114
<None Include="Properties\Settings.settings">
93115
<Generator>SettingsSingleFileGenerator</Generator>
94116
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
<Window x:Class="AssemblyInfoProject_WPF.MainWindow"
1+
<MetroControls:MetroWindow x:Class="AssemblyInfoProject_WPF.MainWindow"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:AssemblyInfoProject_WPF"
7+
xmlns:MetroControls="http://metro.mahapps.com/winfx/xaml/controls"
8+
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
79
mc:Ignorable="d"
8-
Title="MainWindow" Height="450" Width="800" Icon="Resources/Info.png">
10+
Title="MainWindow" Height="450" Width="800">
11+
12+
<MetroControls:MetroWindow.IconTemplate>
13+
<DataTemplate>
14+
<iconPacks:PackIconMaterial Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Margin="2" Padding="4" Foreground="{DynamicResource IdealForegroundColorBrush}" Kind="Information" />
15+
</DataTemplate>
16+
</MetroControls:MetroWindow.IconTemplate>
17+
918
<Grid>
1019
<Button x:Name="btn_showAssemblyInfo" Content="Show assembly info" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="128" Click="btn_showAssemblyInfo_Click"/>
1120

1221
</Grid>
13-
</Window>
22+
</MetroControls:MetroWindow>

AssemblyInfoProject_WPF/MainWindow.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
using System.Windows.Media.Imaging;
1313
using System.Windows.Navigation;
1414
using System.Windows.Shapes;
15+
using MahApps.Metro.Controls;
1516

1617
namespace AssemblyInfoProject_WPF
1718
{
1819
/// <summary>
1920
/// Interaktionslogik für MainWindow.xaml
2021
/// </summary>
21-
public partial class MainWindow : Window
22+
public partial class MainWindow : MetroWindow
2223
{
2324
public MainWindow()
2425
{
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="ControlzEx" version="4.0.0-alpha0222" targetFramework="net45" />
4+
<package id="MahApps.Metro" version="2.0.0-alpha0261" targetFramework="net45" />
5+
<package id="MahApps.Metro.IconPacks" version="3.0.0-alpha0103" targetFramework="net45" />
6+
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.0.1" targetFramework="net45" />
7+
</packages>

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Project: AssemblyInfoProject / AssemblyInfoHelper
44

55
## [%version%] - %date%
66

7+
- Using MahApps.Metro to get a Metro look for the WPF window
78

89
## [v3.0] - 09.09.2018 23:03
910

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)