Skip to content

Commit 65043f0

Browse files
committed
MahApps dialogs cookin'
1 parent d62a78f commit 65043f0

16 files changed

+515
-4
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<UserControl x:Class="MahMaterialDragablzMashUp.Dialogs"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:MahMaterialDragablzMashUp"
7+
xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
8+
mc:Ignorable="d"
9+
dialogs:DialogParticipation.Register="{Binding}"
10+
d:DesignHeight="300" d:DesignWidth="300"
11+
d:DataContext="{d:DesignInstance local:DialogsViewModel}">
12+
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
13+
<Button Command="{Binding ShowInputDialogCommand}">INPUT DIALOG</Button>
14+
</StackPanel>
15+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MahMaterialDragablzMashUp
17+
{
18+
/// <summary>
19+
/// Interaction logic for Dialogs.xaml
20+
/// </summary>
21+
public partial class Dialogs : UserControl
22+
{
23+
public Dialogs()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Input;
9+
using MahApps.Metro.Controls.Dialogs;
10+
11+
namespace MahMaterialDragablzMashUp
12+
{
13+
public class DialogsViewModel
14+
{
15+
public ICommand ShowInputDialogCommand { get; }
16+
17+
public DialogsViewModel()
18+
{
19+
ShowInputDialogCommand = new AnotherCommandImplementation(_ => InputDialog());
20+
}
21+
22+
private void InputDialog()
23+
{
24+
var metroDialogSettings = new MetroDialogSettings
25+
{
26+
CustomResourceDictionary =
27+
new ResourceDictionary
28+
{
29+
Source = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.MahApps.Dialogs.xaml")
30+
},
31+
NegativeButtonText = "CANCEL",
32+
SuppressDefaultResources = true
33+
};
34+
35+
DialogCoordinator.Instance.ShowInputAsync(this, "MahApps Dialog", "Using Material Design Themes", metroDialogSettings);
36+
}
37+
}
38+
}

MahMaterialDragablzMashUp/MahMaterialDragablzMashUp.csproj

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@
5252
<SpecificVersion>False</SpecificVersion>
5353
<HintPath>..\packages\Dragablz.0.0.1.109\lib\net45\Dragablz.dll</HintPath>
5454
</Reference>
55-
<Reference Include="MahApps.Metro, Version=1.1.3.15, Culture=neutral, processorArchitecture=MSIL">
56-
<HintPath>..\packages\MahApps.Metro.1.1.3-ALPHA015\lib\net45\MahApps.Metro.dll</HintPath>
55+
<Reference Include="MahApps.Metro, Version=1.1.3.157, Culture=neutral, processorArchitecture=MSIL">
56+
<HintPath>..\packages\MahApps.Metro.1.1.3-ALPHA157\lib\net45\MahApps.Metro.dll</HintPath>
57+
<Private>True</Private>
5758
</Reference>
5859
<Reference Include="System" />
5960
<Reference Include="System.Data" />
6061
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61-
<HintPath>..\packages\MahApps.Metro.1.1.3-ALPHA015\lib\net45\System.Windows.Interactivity.dll</HintPath>
62+
<HintPath>..\packages\MahApps.Metro.1.1.3-ALPHA157\lib\net45\System.Windows.Interactivity.dll</HintPath>
63+
<Private>True</Private>
6264
</Reference>
6365
<Reference Include="System.Xml" />
6466
<Reference Include="Microsoft.CSharp" />
@@ -85,6 +87,10 @@
8587
<SubType>Designer</SubType>
8688
<Generator>MSBuild:Compile</Generator>
8789
</Page>
90+
<Page Include="Dialogs.xaml">
91+
<SubType>Designer</SubType>
92+
<Generator>MSBuild:Compile</Generator>
93+
</Page>
8894
<Page Include="TextFields.xaml">
8995
<SubType>Designer</SubType>
9096
<Generator>MSBuild:Compile</Generator>
@@ -108,6 +114,10 @@
108114
<Compile Include="Cards.xaml.cs">
109115
<DependentUpon>Cards.xaml</DependentUpon>
110116
</Compile>
117+
<Compile Include="Dialogs.xaml.cs">
118+
<DependentUpon>Dialogs.xaml</DependentUpon>
119+
</Compile>
120+
<Compile Include="DialogsViewModel.cs" />
111121
<Compile Include="PaletteSelectorViewModel.cs" />
112122
<Compile Include="TextFields.xaml.cs">
113123
<DependentUpon>TextFields.xaml</DependentUpon>

MahMaterialDragablzMashUp/MainWindow.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
</mahMaterialDragablzMashUp:PaletteSelector.DataContext>
3232
</mahMaterialDragablzMashUp:PaletteSelector>
3333
</TabItem>
34+
<TabItem Header="DIALOGS">
35+
<mahMaterialDragablzMashUp:Dialogs Margin="8">
36+
<mahMaterialDragablzMashUp:Dialogs.DataContext>
37+
<mahMaterialDragablzMashUp:DialogsViewModel />
38+
</mahMaterialDragablzMashUp:Dialogs.DataContext>
39+
</mahMaterialDragablzMashUp:Dialogs>
40+
</TabItem>
3441
<TabItem Header="MAHAPPS">
3542
<mahMaterialDragablzMashUp:Mah Margin="8" />
3643
</TabItem>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Dragablz" version="0.0.1.109" targetFramework="net45" />
4-
<package id="MahApps.Metro" version="1.1.3-ALPHA015" targetFramework="net45" />
4+
<package id="MahApps.Metro" version="1.1.3-ALPHA157" targetFramework="net45" />
55
</packages>
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{81556A2D-D467-43E7-945B-FD987C676CF6}</ProjectGuid>
8+
<OutputType>library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MaterialDesignThemes.MahApps</RootNamespace>
11+
<AssemblyName>MaterialDesignThemes.MahApps</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15+
<WarningLevel>4</WarningLevel>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Data" />
37+
<Reference Include="System.Xml" />
38+
<Reference Include="Microsoft.CSharp" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xaml">
44+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
45+
</Reference>
46+
<Reference Include="WindowsBase" />
47+
<Reference Include="PresentationCore" />
48+
<Reference Include="PresentationFramework" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<Page Include="Themes\Dialog.xaml">
52+
<SubType>Designer</SubType>
53+
<Generator>MSBuild:Compile</Generator>
54+
</Page>
55+
</ItemGroup>
56+
<ItemGroup>
57+
<Compile Include="Properties\AssemblyInfo.cs">
58+
<SubType>Code</SubType>
59+
</Compile>
60+
<Compile Include="Properties\Resources.Designer.cs">
61+
<AutoGen>True</AutoGen>
62+
<DesignTime>True</DesignTime>
63+
<DependentUpon>Resources.resx</DependentUpon>
64+
</Compile>
65+
<Compile Include="Properties\Settings.Designer.cs">
66+
<AutoGen>True</AutoGen>
67+
<DependentUpon>Settings.settings</DependentUpon>
68+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
69+
</Compile>
70+
<EmbeddedResource Include="Properties\Resources.resx">
71+
<Generator>ResXFileCodeGenerator</Generator>
72+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
73+
</EmbeddedResource>
74+
<None Include="Properties\Settings.settings">
75+
<Generator>SettingsSingleFileGenerator</Generator>
76+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
77+
</None>
78+
<AppDesigner Include="Properties\" />
79+
</ItemGroup>
80+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
81+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
82+
Other similar extension points exist, see Microsoft.Common.targets.
83+
<Target Name="BeforeBuild">
84+
</Target>
85+
<Target Name="AfterBuild">
86+
</Target>
87+
-->
88+
</Project>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("MaterialDesignThemes.MahApps")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("MaterialDesignThemes.MahApps")]
15+
[assembly: AssemblyCopyright("Copyright © 2015")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly:ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

MaterialDesignThemes.MahApps/Properties/Resources.Designer.cs

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)