Skip to content

Instantly share code, notes, and snippets.

@LanceMcCarthy
Created January 10, 2017 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LanceMcCarthy/acbf4f552c50864b239af109e1de727b to your computer and use it in GitHub Desktop.
Save LanceMcCarthy/acbf4f552c50864b239af109e1de727b to your computer and use it in GitHub Desktop.
ManipulationDrawer demo main page code behind
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
namespace DetailsDrawer
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void HandleGrid_OnManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
{
var themeBrush = Application.Current.Resources["AppBarToggleButtonBackgroundCheckedPointerOver"] as SolidColorBrush;
if (themeBrush != null)
HandleGrid.Background = themeBrush;
}
private void HandleGrid_OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
{
var themeBrush = Application.Current.Resources["AppBarBorderThemeBrush"] as SolidColorBrush;
if (themeBrush != null)
HandleGrid.Background = themeBrush;
}
private void HandleGrid_OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
DrawerContentGrid.Height = DrawerContentGrid.ActualHeight + -e.Delta.Translation.Y;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment