/// <summary> /// /// </summary> /// <param name="dependencyObject"></param> /// <param name="args"></param> private static void OnHomeUriPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { FrameWindow frameWindow = dependencyObject as FrameWindow; if (frameWindow == null) { return; } frameWindow.ContentUri = frameWindow.HomeUri; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void OnKeyDown(object sender, KeyEventArgs args) { // esc if (args.Key == Key.Escape) { FrameWindow window = this.DataContext as FrameWindow; if (window != null) { window.CloseMenuCommand.Execute(null); } } args.Handled = false; }
/// <summary> /// /// </summary> /// <param name="dependencyObject"></param> /// <param name="args"></param> private static void OnSelectedMenuItemPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { FrameWindow frameWindow = dependencyObject as FrameWindow; if (frameWindow == null) { return; } MenuItem menuItem = args.NewValue as MenuItem; if (menuItem == null) { return; } frameWindow.ContentUri = menuItem.Source; }
/// <summary> /// /// </summary> /// <param name="dependencyObject"></param> /// <param name="args"></param> private static void OnMenuItemsPropertyChanaged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { FrameWindow frameWindow = dependencyObject as FrameWindow; if (frameWindow == null) { return; } MenuItemCollection menuItems = args.NewValue as MenuItemCollection; if (menuItems == null) { return; } frameWindow.ContentUri = frameWindow.HomeUri; }