Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
calloncampbell committed Jun 20, 2018
1 parent 93d4f45 commit e83b9fb
Show file tree
Hide file tree
Showing 13 changed files with 636 additions and 0 deletions.
25 changes: 25 additions & 0 deletions WpfHamburgerMenuApp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfHamburgerMenuApp", "WpfHamburgerMenuApp\WpfHamburgerMenuApp.csproj", "{50F68246-31E6-4130-BF2D-C88973E01F5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50F68246-31E6-4130-BF2D-C88973E01F5D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F25858C6-8601-460E-9BBA-D5F6AFCD988D}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions WpfHamburgerMenuApp/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
</configuration>
16 changes: 16 additions & 0 deletions WpfHamburgerMenuApp/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Application x:Class="WpfHamburgerMenuApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfHamburgerMenuApp"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Indigo.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions WpfHamburgerMenuApp/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WpfHamburgerMenuApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
123 changes: 123 additions & 0 deletions WpfHamburgerMenuApp/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<Window x:Class="WpfHamburgerMenuApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfHamburgerMenuApp"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="WPF Hamburger Menu Sample"
Height="600"
Width="1080"
Foreground="White"
WindowStartupLocation="Manual">

<Window.Resources>
<Storyboard x:Key="OpenMenu">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
<EasingDoubleKeyFrame KeyTime="0" Value="50"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="200"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="CloseMenu">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
<EasingDoubleKeyFrame KeyTime="0" Value="200"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="50"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>

<Window.Triggers>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpenMenu">
<BeginStoryboard Storyboard="{StaticResource OpenMenu}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonCloseMenu">
<BeginStoryboard Storyboard="{StaticResource CloseMenu}"/>
</EventTrigger>
</Window.Triggers>

<Grid>
<Grid x:Name="GridMenu" Width="50" HorizontalAlignment="Left" Background="#FF3A3A3A">
<DockPanel>
<Grid x:Name="SettingsView" DockPanel.Dock="Bottom" HorizontalAlignment="Stretch">
<StackPanel Height="100" RenderTransformOrigin="0.3,0.3">
<Grid ToolTip="Help" >
<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" >
<Button.Content>
<DockPanel>
<materialDesign:PackIcon Kind="HelpCircle" DockPanel.Dock="Left" Foreground="White" Height="25" Width="25" Margin="-3 0" Padding="0" />
<TextBlock Text="Help" VerticalAlignment="Center" Margin="20 5" />
</DockPanel>
</Button.Content>
</Button>
</Grid>
<Grid ToolTip="Settings">
<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" >
<Button.Content>
<DockPanel>
<materialDesign:PackIcon Kind="Settings" DockPanel.Dock="Left" Foreground="White" Height="25" Width="25" Margin="-3 0" Padding="0" />
<TextBlock Text="Settings" VerticalAlignment="Center" Margin="20 5" />
</DockPanel>
</Button.Content>
</Button>
</Grid>
</StackPanel>
</Grid>

<Grid Height="50" RenderTransformOrigin="0.3,0.3" DockPanel.Dock="Top">
<Button x:Name="ButtonOpenMenu" Margin="0" Height="50" Width="50" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="ButtonOpenMenu_Click">
<materialDesign:PackIcon Kind="Menu" Foreground="White" Height="25" Width="25" Margin="-10" Padding="0" />
</Button>
<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">
<materialDesign:PackIcon Kind="Menu" Foreground="White" Height="25" Width="25" Margin="-10" Padding="0" />
</Button>
</Grid>

<ListView x:Name="ListViewMenu" Foreground="White" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="ListViewMenu_SelectionChanged">
<ListViewItem Height="50" ToolTip="Inventory" IsSelected="True">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="PhoneLog" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="Inventory" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="50" ToolTip="Line Tests">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="TestTube" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="Line Tests" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="50" ToolTip="Orders">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="Basket" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="Orders" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="50" ToolTip="Bulk Edits">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="AutoFix" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="Bulk Edits" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="50" ToolTip="Telcos">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="RadioTower" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="Telcos" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="50" ToolTip="CMS Locations">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="Compass" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="CMS Locations" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="50" ToolTip="CMS Profiles">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<materialDesign:PackIcon Kind="Compare" VerticalAlignment="Center" Height="25" Width="25"/>
<TextBlock Text="CMS Profiles" VerticalAlignment="Center" Margin="15 5" />
</StackPanel>
</ListViewItem>
</ListView>
</DockPanel>
</Grid>
</Grid>
</Window>
71 changes: 71 additions & 0 deletions WpfHamburgerMenuApp/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfHamburgerMenuApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}

private void ButtonOpenMenu_Click(object sender, RoutedEventArgs e)
{
ButtonCloseMenu.Visibility = Visibility.Visible;
ButtonOpenMenu.Visibility = Visibility.Collapsed;
}

private void ButtonCloseMenu_Click(object sender, RoutedEventArgs e)
{
ButtonCloseMenu.Visibility = Visibility.Collapsed;
ButtonOpenMenu.Visibility = Visibility.Visible;
}

private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//TODO
//UserControl usc = null;
//GridMain.Children.Clear();

//switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
//{
// case "ItemHome":
// usc = new UserControlHome();
// GridMain.Children.Add(usc);
// break;
// case "ItemCreate":
// usc = new UserControlCreate();
// GridMain.Children.Add(usc);
// break;
// default:
// break;
//}
}

private void ButtonOpenSettings_Click(object sender, RoutedEventArgs e)
{

}

private void ButtonOpenHelp_Click(object sender, RoutedEventArgs e)
{

}
}
}
55 changes: 55 additions & 0 deletions WpfHamburgerMenuApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WpfHamburgerMenuApp2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WpfHamburgerMenuApp2")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
63 changes: 63 additions & 0 deletions WpfHamburgerMenuApp/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e83b9fb

Please sign in to comment.