Skip to content

Commit e83b9fb

Browse files
Add project files.
1 parent 93d4f45 commit e83b9fb

13 files changed

+636
-0
lines changed

WpfHamburgerMenuApp.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2035
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfHamburgerMenuApp", "WpfHamburgerMenuApp\WpfHamburgerMenuApp.csproj", "{50F68246-31E6-4130-BF2D-C88973E01F5D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {F25858C6-8601-460E-9BBA-D5F6AFCD988D}
24+
EndGlobalSection
25+
EndGlobal

WpfHamburgerMenuApp/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
5+
</startup>
6+
</configuration>

WpfHamburgerMenuApp/App.xaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Application x:Class="WpfHamburgerMenuApp.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:WpfHamburgerMenuApp"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
10+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Indigo.xaml" />
13+
</ResourceDictionary.MergedDictionaries>
14+
</ResourceDictionary>
15+
</Application.Resources>
16+
</Application>

WpfHamburgerMenuApp/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace WpfHamburgerMenuApp
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

WpfHamburgerMenuApp/MainWindow.xaml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<Window x:Class="WpfHamburgerMenuApp.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:WpfHamburgerMenuApp"
7+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
8+
mc:Ignorable="d"
9+
Title="WPF Hamburger Menu Sample"
10+
Height="600"
11+
Width="1080"
12+
Foreground="White"
13+
WindowStartupLocation="Manual">
14+
15+
<Window.Resources>
16+
<Storyboard x:Key="OpenMenu">
17+
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
18+
<EasingDoubleKeyFrame KeyTime="0" Value="50"/>
19+
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="200"/>
20+
</DoubleAnimationUsingKeyFrames>
21+
</Storyboard>
22+
<Storyboard x:Key="CloseMenu">
23+
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
24+
<EasingDoubleKeyFrame KeyTime="0" Value="200"/>
25+
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="50"/>
26+
</DoubleAnimationUsingKeyFrames>
27+
</Storyboard>
28+
</Window.Resources>
29+
30+
<Window.Triggers>
31+
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpenMenu">
32+
<BeginStoryboard Storyboard="{StaticResource OpenMenu}"/>
33+
</EventTrigger>
34+
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonCloseMenu">
35+
<BeginStoryboard Storyboard="{StaticResource CloseMenu}"/>
36+
</EventTrigger>
37+
</Window.Triggers>
38+
39+
<Grid>
40+
<Grid x:Name="GridMenu" Width="50" HorizontalAlignment="Left" Background="#FF3A3A3A">
41+
<DockPanel>
42+
<Grid x:Name="SettingsView" DockPanel.Dock="Bottom" HorizontalAlignment="Stretch">
43+
<StackPanel Height="100" RenderTransformOrigin="0.3,0.3">
44+
<Grid ToolTip="Help" >
45+
<Button x:Name="ButtonOpenHelp" Margin="0" Height="50" Width="200" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Left" HorizontalContentAlignment="Left" VerticalAlignment="Center" Click="ButtonOpenHelp_Click" >
46+
<Button.Content>
47+
<DockPanel>
48+
<materialDesign:PackIcon Kind="HelpCircle" DockPanel.Dock="Left" Foreground="White" Height="25" Width="25" Margin="-3 0" Padding="0" />
49+
<TextBlock Text="Help" VerticalAlignment="Center" Margin="20 5" />
50+
</DockPanel>
51+
</Button.Content>
52+
</Button>
53+
</Grid>
54+
<Grid ToolTip="Settings">
55+
<Button x:Name="ButtonOpenSettings" Margin="0" Height="50" Width="200" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Left" HorizontalContentAlignment="Left" VerticalAlignment="Center" Click="ButtonOpenSettings_Click" >
56+
<Button.Content>
57+
<DockPanel>
58+
<materialDesign:PackIcon Kind="Settings" DockPanel.Dock="Left" Foreground="White" Height="25" Width="25" Margin="-3 0" Padding="0" />
59+
<TextBlock Text="Settings" VerticalAlignment="Center" Margin="20 5" />
60+
</DockPanel>
61+
</Button.Content>
62+
</Button>
63+
</Grid>
64+
</StackPanel>
65+
</Grid>
66+
67+
<Grid Height="50" RenderTransformOrigin="0.3,0.3" DockPanel.Dock="Top">
68+
<Button x:Name="ButtonOpenMenu" Margin="0" Height="50" Width="50" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="ButtonOpenMenu_Click">
69+
<materialDesign:PackIcon Kind="Menu" Foreground="White" Height="25" Width="25" Margin="-10" Padding="0" />
70+
</Button>
71+
<Button x:Name="ButtonCloseMenu" Visibility="Collapsed" Margin="0" Height="50" Width="50" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="ButtonCloseMenu_Click">
72+
<materialDesign:PackIcon Kind="Menu" Foreground="White" Height="25" Width="25" Margin="-10" Padding="0" />
73+
</Button>
74+
</Grid>
75+
76+
<ListView x:Name="ListViewMenu" Foreground="White" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="ListViewMenu_SelectionChanged">
77+
<ListViewItem Height="50" ToolTip="Inventory" IsSelected="True">
78+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
79+
<materialDesign:PackIcon Kind="PhoneLog" VerticalAlignment="Center" Height="25" Width="25"/>
80+
<TextBlock Text="Inventory" VerticalAlignment="Center" Margin="15 5" />
81+
</StackPanel>
82+
</ListViewItem>
83+
<ListViewItem Height="50" ToolTip="Line Tests">
84+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
85+
<materialDesign:PackIcon Kind="TestTube" VerticalAlignment="Center" Height="25" Width="25"/>
86+
<TextBlock Text="Line Tests" VerticalAlignment="Center" Margin="15 5" />
87+
</StackPanel>
88+
</ListViewItem>
89+
<ListViewItem Height="50" ToolTip="Orders">
90+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
91+
<materialDesign:PackIcon Kind="Basket" VerticalAlignment="Center" Height="25" Width="25"/>
92+
<TextBlock Text="Orders" VerticalAlignment="Center" Margin="15 5" />
93+
</StackPanel>
94+
</ListViewItem>
95+
<ListViewItem Height="50" ToolTip="Bulk Edits">
96+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
97+
<materialDesign:PackIcon Kind="AutoFix" VerticalAlignment="Center" Height="25" Width="25"/>
98+
<TextBlock Text="Bulk Edits" VerticalAlignment="Center" Margin="15 5" />
99+
</StackPanel>
100+
</ListViewItem>
101+
<ListViewItem Height="50" ToolTip="Telcos">
102+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
103+
<materialDesign:PackIcon Kind="RadioTower" VerticalAlignment="Center" Height="25" Width="25"/>
104+
<TextBlock Text="Telcos" VerticalAlignment="Center" Margin="15 5" />
105+
</StackPanel>
106+
</ListViewItem>
107+
<ListViewItem Height="50" ToolTip="CMS Locations">
108+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
109+
<materialDesign:PackIcon Kind="Compass" VerticalAlignment="Center" Height="25" Width="25"/>
110+
<TextBlock Text="CMS Locations" VerticalAlignment="Center" Margin="15 5" />
111+
</StackPanel>
112+
</ListViewItem>
113+
<ListViewItem Height="50" ToolTip="CMS Profiles">
114+
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
115+
<materialDesign:PackIcon Kind="Compare" VerticalAlignment="Center" Height="25" Width="25"/>
116+
<TextBlock Text="CMS Profiles" VerticalAlignment="Center" Margin="15 5" />
117+
</StackPanel>
118+
</ListViewItem>
119+
</ListView>
120+
</DockPanel>
121+
</Grid>
122+
</Grid>
123+
</Window>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 WpfHamburgerMenuApp
17+
{
18+
/// <summary>
19+
/// Interaction logic for MainWindow.xaml
20+
/// </summary>
21+
public partial class MainWindow : Window
22+
{
23+
public MainWindow()
24+
{
25+
InitializeComponent();
26+
}
27+
28+
private void ButtonOpenMenu_Click(object sender, RoutedEventArgs e)
29+
{
30+
ButtonCloseMenu.Visibility = Visibility.Visible;
31+
ButtonOpenMenu.Visibility = Visibility.Collapsed;
32+
}
33+
34+
private void ButtonCloseMenu_Click(object sender, RoutedEventArgs e)
35+
{
36+
ButtonCloseMenu.Visibility = Visibility.Collapsed;
37+
ButtonOpenMenu.Visibility = Visibility.Visible;
38+
}
39+
40+
private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
41+
{
42+
//TODO
43+
//UserControl usc = null;
44+
//GridMain.Children.Clear();
45+
46+
//switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
47+
//{
48+
// case "ItemHome":
49+
// usc = new UserControlHome();
50+
// GridMain.Children.Add(usc);
51+
// break;
52+
// case "ItemCreate":
53+
// usc = new UserControlCreate();
54+
// GridMain.Children.Add(usc);
55+
// break;
56+
// default:
57+
// break;
58+
//}
59+
}
60+
61+
private void ButtonOpenSettings_Click(object sender, RoutedEventArgs e)
62+
{
63+
64+
}
65+
66+
private void ButtonOpenHelp_Click(object sender, RoutedEventArgs e)
67+
{
68+
69+
}
70+
}
71+
}
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("WpfHamburgerMenuApp2")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("WpfHamburgerMenuApp2")]
15+
[assembly: AssemblyCopyright("Copyright © 2018")]
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")]

WpfHamburgerMenuApp/Properties/Resources.Designer.cs

Lines changed: 63 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)