You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.0 KiB
111 lines
3.0 KiB
/**************************************************************************************
|
|
|
|
Toolkit for WPF
|
|
|
|
Copyright (C) 2007-2016 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
For more features, controls, and fast professional support,
|
|
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
|
|
|
|
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
|
|
|
|
**************************************************************************************/
|
|
using System.Diagnostics;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MaterialHamburgerView.xaml
|
|
/// </summary>
|
|
public partial class MaterialHamburgerView : MaterialDemoView
|
|
{
|
|
#region Constructors
|
|
|
|
public MaterialHamburgerView()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#if !OPEN_SOURCE
|
|
|
|
#region EventHandlers
|
|
|
|
private void CheckedContentComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
|
|
{
|
|
if( materialHamburger == null )
|
|
return;
|
|
|
|
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
|
|
{
|
|
var selection = e.AddedItems[ 0 ] as ComboBoxItem;
|
|
if( selection != null )
|
|
{
|
|
if( selection.Tag != null )
|
|
{
|
|
materialHamburger.CheckedContent = selection.Tag;
|
|
}
|
|
else
|
|
{
|
|
materialHamburger.ClearValue( MaterialHamburger.CheckedContentProperty );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void UncheckedContentComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
|
|
{
|
|
if( materialHamburger == null )
|
|
return;
|
|
|
|
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
|
|
{
|
|
var selection = e.AddedItems[ 0 ] as ComboBoxItem;
|
|
if( selection != null )
|
|
{
|
|
if( selection.Tag != null )
|
|
{
|
|
materialHamburger.UncheckedContent = selection.Tag;
|
|
}
|
|
else
|
|
{
|
|
materialHamburger.ClearValue( MaterialHamburger.UncheckedContentProperty );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void MenuLocationComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
|
|
{
|
|
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
|
|
{
|
|
var menuLocation = ( HamburgerLocation )e.AddedItems[ 0 ];
|
|
materialHamburgerMenu.CloseButtonLocation = ( menuLocation == HamburgerLocation.Right ) ? Location.Left : Location.Right;
|
|
}
|
|
}
|
|
|
|
private void IconButton_Click( object sender, RoutedEventArgs e )
|
|
{
|
|
var button = sender as IconButton;
|
|
if( button != null )
|
|
{
|
|
Process.Start( new ProcessStartInfo( button.Tag as string ) );
|
|
}
|
|
}
|
|
|
|
private void ApplyButton_Click( object sender, RoutedEventArgs e )
|
|
{
|
|
materialHamburger.IsChecked = false;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endif
|
|
}
|
|
}
|
|
|