Example #1
0
 private void RaiseSplitViewDisplayModeChanged(SplitViewDisplayMode splitViewDisplayMode)
 {
     if (SplitViewDisplayModeChanged != null)
     {
         SplitViewDisplayModeChanged(null, splitViewDisplayMode);
     }
 }
Example #2
0
 void DisplayModePropertyChanged(SplitViewDisplayMode previous, SplitViewDisplayMode value)
 {
     // this will keep the two properties in sync
     if (ShellSplitView.DisplayMode != value)
     {
         ShellSplitView.DisplayMode = value;
     }
     HamburgerButtonGridWidth = (value == SplitViewDisplayMode.CompactInline) ? PaneWidth : squareWidth;
 }
Example #3
0
 public override void UpdateCommonProperties(SplitViewDisplayMode splitViewDisplayMode)
 {
     base.UpdateCommonProperties(splitViewDisplayMode);
     if (splitViewDisplayMode == SplitViewDisplayMode.Overlay)
     {
         AppBarRow        = 2;
         AppBarColumn     = 0;
         AppBarColumnSpan = 2;
     }
 }
		public override void UpdateCommonProperties(SplitViewDisplayMode splitViewDisplayMode)
        {
            base.UpdateCommonProperties(splitViewDisplayMode);
            if (splitViewDisplayMode == SplitViewDisplayMode.Overlay)
            {
                AppBarRow = 3;
                AppBarColumn = 0;
                AppBarColumnSpan = 2;
            }
        }
            public object Convert(object value, Type targetType, object parameter, string language)
            {
                HamburgerType        ht  = (HamburgerType)value;
                SplitViewDisplayMode sdm = SplitViewDisplayMode.Overlay;

                switch (ht)
                {
                case HamburgerType.LeftSide:
                    break;

                case HamburgerType.RightSide:
                    break;

                case HamburgerType.LeftSideCompact:
                {
                    sdm = SplitViewDisplayMode.CompactOverlay;
                    break;
                }

                case HamburgerType.RightSideCompact:
                {
                    sdm = SplitViewDisplayMode.CompactOverlay;
                    break;
                }

                case HamburgerType.LeftSideInLine:
                {
                    sdm = SplitViewDisplayMode.Inline;
                    break;
                }

                case HamburgerType.RightSideInLine:
                {
                    sdm = SplitViewDisplayMode.Inline;
                    break;
                }

                case HamburgerType.LeftSideCompactInLine:
                {
                    sdm = SplitViewDisplayMode.CompactInline;
                    break;
                }

                case HamburgerType.RightSideCompactInLine:
                {
                    sdm = SplitViewDisplayMode.CompactInline;
                    break;
                }

                default:
                    break;
                }
                return(sdm);
            }
        private void OnDisplayModeChanged(SplitViewDisplayMode displayMode)
        {
            if (this.MenuShell.DisplayMode != displayMode)
            {
                this.MenuShell.DisplayMode = displayMode;
            }

            this.AppMenuButtonWidth = this.MenuShell.DisplayMode == SplitViewDisplayMode.CompactInline
                                          ? this.OpenPaneWidth
                                          : 48;
        }
Example #7
0
        private void UpdateDisplayMode(SplitViewDisplayMode displayMode, bool autoClose = true)
        {
            switch (displayMode)
            {
            case SplitViewDisplayMode.Inline:
                curToOpenState       = SplitViewState.InlineOpen;
                curToCloseState      = SplitViewState.InlineClose;
                isTransitionsEnabled = EnableInlineAnimation;
                break;

            case SplitViewDisplayMode.Overlay:
                curToOpenState       = SplitViewState.OverlayOpen;
                curToCloseState      = SplitViewState.OverlayClose;
                isTransitionsEnabled = true;
                break;

            case SplitViewDisplayMode.CompactInline:
                curToOpenState       = SplitViewState.CompactInlineOpen;
                curToCloseState      = SplitViewState.CompactInlineClose;
                isTransitionsEnabled = EnableInlineAnimation;
                break;

            case SplitViewDisplayMode.CompactOverlay:
                curToOpenState       = SplitViewState.CompactOverlayOpen;
                curToCloseState      = SplitViewState.CompactOverlayClose;
                isTransitionsEnabled = true;
                break;

            default: break;
            }
            //Update state
            if (IsPaneOpen)
            {
                if (autoClose)
                {
                    IsPaneOpen = false;
                }
                else
                {
                    SwitchToState(curToCloseState);
                    UpdateOnIsPaneOpenChanged(IsPaneOpen);
                }
            }
            else
            {
                SwitchToState(curToCloseState);
            }
            //Adapt margin if need
            if (IsInlineAdaptEnabled)
            {
                UpdateAdaptMetricsChanged();
            }
        }
Example #8
0
        private void DisplayModeRadioButtonChecked(object sender, RoutedEventArgs e)
        {
            if (!_splitViewLoaded)
            {
                return;
            }

            RadioButton          rb             = sender as RadioButton;
            SplitViewDisplayMode newDisplayMode = (SplitViewDisplayMode)Enum.Parse(typeof(SplitViewDisplayMode), rb.Content as string);

            splitView.DisplayMode = newDisplayMode;
        }
Example #9
0
 private void UpdateSpacier(SplitViewDisplayMode mode)
 {
     if (mode == SplitViewDisplayMode.Overlay)
     {
         VisualStateManager.GoToState(this, "HamburgerButtonState", false);
         TitleTextBlock.Text = Title; //required to reapply Typography.Capitals
     }
     else
     {
         VisualStateManager.GoToState(this, "NormalState", false);
         TitleTextBlock.Text = Title; //required to reapply Typography.Capitals
     }
 }
Example #10
0
 public virtual void UpdateCommonProperties(SplitViewDisplayMode splitViewDisplayMode)
 {
     if (splitViewDisplayMode == SplitViewDisplayMode.Overlay)
     {
         PageTitleMargin = new Thickness(69, 0, 12, 0);
     }
     else
     {
         PageTitleMargin  = new Thickness(21, 0, 12, 0);
         AppBarRow        = 0;
         AppBarColumn     = 1;
         AppBarColumnSpan = 1;
     }
 }
Example #11
0
 public virtual void UpdateCommonProperties(SplitViewDisplayMode splitViewDisplayMode)
 {
     if (splitViewDisplayMode == SplitViewDisplayMode.Overlay)
     {
         PageTitleMargin = new Thickness(69, 0, 12, 0);
     }
     else
     {
         PageTitleMargin = new Thickness(21, 0, 12, 0);
         AppBarRow = 0;
         AppBarColumn = 1;
         AppBarColumnSpan = 1;
     }
 }
 private void adjustSize()
 {
     //System.Diagnostics.Debug.WriteLine(bounds.Width);
     //For some reason if the app starts with a width under 1008, the splitter is visible
     if (Window.Current.Bounds.Width < 1008)
     {
         Splitter.DisplayMode = SplitViewDisplayMode.Overlay;
     }
     else
     {
         SplitViewDisplayMode prevDisplayMode = Splitter.DisplayMode;
         Splitter.DisplayMode = SplitViewDisplayMode.Inline;
         if (prevDisplayMode == SplitViewDisplayMode.Overlay)
         {
             Splitter.IsPaneOpen = true;
         }
     }
 }
        private void SetDisplayMode(SplitViewDisplayMode mode)
        {
            if (_isInitialized)
            {
                switch (mode)
                {
                case SplitViewDisplayMode.CompactOverlay:
                case SplitViewDisplayMode.CompactInline:
                    _headerContainer.Margin = new Thickness(0);
                    break;

                case SplitViewDisplayMode.Overlay:
                case SplitViewDisplayMode.Inline:
                    _headerContainer.Margin = new Thickness(48, 0, 0, 0);
                    break;
                }
            }
        }
Example #14
0
        public void HideMenu()
        {
            var groups = VisualStateManager.GetVisualStateGroups(rootGrid);

            foreach (var group in groups)
            {
                visualStateGroups.Add(group);
            }

            groups.Clear();

            previousSplitViewDisplayMode = ShellSplitView.DisplayMode;
            ShellSplitView.DisplayMode   = SplitViewDisplayMode.Overlay;
            ShellSplitView.IsPaneOpen    = false;
            togglePaneButton.Visibility  = Visibility.Collapsed;

            if (ShellSplitView.Pane != null)
            {
                ShellSplitView.Pane.Visibility = Visibility.Collapsed;
            }

            OnPaneSizeChanged();
        }
        private void OnCoreWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            if (DemoModuleView == null || DemoModuleView.SplitView == null)
            {
                return;
            }
            double width = e.Size.Width;
            SplitViewDisplayMode newMode = GetSplitViewDisplayMode(width);

            if (newMode == DemoModuleView.SplitView.DisplayMode)
            {
                return;
            }
            DemoModuleView.SplitView.DisplayMode = newMode;
            bool isOptionsPaneOpen = false;

            if (newMode == SplitViewDisplayMode.Inline)
            {
                isOptionsPaneOpen = OptionsButtonWasAffected ? PreferedOptionsVisibility : PreferedOptionsVisibility && !DemoModuleView.HideOptionsInitially;
            }

            SetIsOptionsPaneOpenSilently(isOptionsPaneOpen);
            DemoModuleView.SplitView.IsPaneOpen = isOptionsPaneOpen;
        }
Example #16
0
 private void Current_DisplayModeChanged(object sender, SplitViewDisplayMode e)
 {
     UpdateSpacier(e);
 }
Example #17
0
 private void UpdateDisplayMode(SplitViewDisplayMode oldValue, SplitViewDisplayMode newValue)
 {
     ChangeVisualState(true);
 }
Example #18
0
 private void RaiseSplitViewDisplayModeChanged(SplitViewDisplayMode splitViewDisplayMode)
 {
     if (SplitViewDisplayModeChanged != null)
     {
         SplitViewDisplayModeChanged(null, splitViewDisplayMode);
     }
 }
Example #19
0
 private void WindowSizeChanged(double width)
 {
     if (!_checkSizeChanged)
     {
         return;
     }
     if (width <= 800)
     {
         this.SplitViewDisplayMode = SplitViewDisplayMode.Overlay;
     }
     else
     {
         this.SplitViewDisplayMode = SplitViewDisplayMode.CompactOverlay;
     }
 }
Example #20
0
 protected virtual void OnDisplayModeChanged(SplitViewDisplayMode mode)
 {
 }
Example #21
0
 private void FullScreenModeChanged(object sender, bool isFullScreenModeEnabled)
 {
     IsFullScreen = isFullScreenModeEnabled;
     if (IsFullScreen)
     {
         _checkSizeChanged = false;
         this.SplitViewDisplayMode = SplitViewDisplayMode.Overlay;
     }
     else
     {
         _checkSizeChanged = true;
         WindowSizeChanged(Window.Current.Bounds.Width);
     }
 }
Example #22
0
 internal LauncherSideMenuDisplayModeChangedEventArgs(SplitViewDisplayMode displayMode)
 {
     DisplayMode = displayMode;
 }
Example #23
0
 public void SetSplitViewDisplayMode(SplitViewDisplayMode mode)
 {
     ensureSplitViewInitialized();
     _appFrameSplitView.DisplayMode = mode;
 }
Example #24
0
 public static void SetNewSplitViewDisplayMode(DependencyObject obj, SplitViewDisplayMode value)
 {
     obj.SetValue(NewSplitViewDisplayModeProperty, value);
 }
        public ClientWindowViewModel()
        {
            var core    = ((App)Application.Current).Core;
            var library = core.Library;

            var client = new Client(new LibraryFront(library), core).AddTo(this.Disposables);

            this.Client = client;
            this.Core   = core;

            this.KeyReceiver = new KeyReceiver <object>().AddTo(this.Disposables);

            this.WindowTitle = client.SelectedPage
                               .CombineLatest(client.ViewerDisplaying, (Page, Item) => new { Page, Item })
                               .Select(x =>
            {
                var file = (x.Page == PageType.Viewer) ? x.Item?.FileName : null;
                return((file == null) ? core.AppName : (file + " - " + core.AppName));
            })
                               .ToReadOnlyReactiveProperty()
                               .AddTo(this.Disposables);

            this.SelectedInformationPage = new ReactiveProperty <OptionPaneType>
                                               (core.IsViewerPageLeftBarFixed ? OptionPaneType.ItemInfo : OptionPaneType.None)
                                           .AddTo(this.Disposables);

            this.IsPaneOpen = new ReactiveProperty <bool>(core.IsViewerPageLeftBarFixed)
                              .AddTo(this.Disposables);


            this.IsPaneFixed = core
                               .ToReactivePropertyAsSynchronized(x => x.IsViewerPageLeftBarFixed)
                               .AddTo(this.Disposables);

            this.SelectedTab = client.SelectedPage
                               .Select(x =>
            {
                switch (x)
                {
                case PageType.Search:
                    return(0);

                case PageType.Catalog:
                    return(1);

                case PageType.Viewer:
                    return(2);

                default:
                    return(0);
                }
            })
                               .ToReactiveProperty(0)
                               .AddTo(this.Disposables);


            this.SelectedTab.Subscribe(x =>
            {
                if (this.IsPaneOpen.Value)
                {
                    if (this.IsPaneFixed.Value)
                    {
                        this.ShowInformationPane();
                    }
                    else
                    {
                        this.IsPaneOpen.Value = false;
                    }
                }
            })
            .AddTo(this.Disposables);

            this.Client.FeaturedGroupChanged.Subscribe(x =>
            {
                if (client.SelectedPage.Value == PageType.Catalog && this.IsPaneOpen.Value)
                {
                    this.ShowInformationPane();
                }
            })
            .AddTo(this.Disposables);


            this.PaneSelectedPath = new ReactiveProperty <string>((string)null)
                                    .AddTo(this.Disposables);
            this.PaneSelectedPath.Where(x => !string.IsNullOrWhiteSpace(x))
            .Subscribe(x => this.StartPathOrTagSearch(FileProperty.DirectoryPathStartsWith, x))
            .AddTo(this.Disposables);

            this.PaneSelectedTag = new ReactiveProperty <TagInformation>((TagInformation)null)
                                   .AddTo(this.Disposables);
            this.PaneSelectedTag.Where(x => x != null)
            .Subscribe(x => this.StartPathOrTagSearch(FileProperty.ContainsTag, x.Id))
            .AddTo(this.Disposables);

            this.DefaultPaneMode = client.SelectedPage
                                   .Select(x => (x == PageType.Viewer) ? PaneMode.HideInClosing
                    : PaneMode.AlwaysVisible)
                                   .ToReactiveProperty(PaneMode.AlwaysVisible)
                                   .AddTo(this.Disposables);



            this.IsOptionPageOpen = this.SelectedInformationPage
                                    .Select(x => x > 0)
                                    .ToReactiveProperty()
                                    .AddTo(this.Disposables);


            //情報
            this.IsInformationPaneOpen = this.SelectedInformationPage
                                         .Select(x => this.IsInformationPane(x))
                                         .ToReactiveProperty(false)
                                         .AddTo(this.Disposables);

            this.OpenInformationPaneCommand = new ReactiveCommand()
                                              .WithSubscribe(_ =>
            {
                if (this.IsInformationPaneOpen.Value)
                {
                    if (this.prevPaneSelected == OptionPaneType.None)
                    {
                        this.prevPaneSelected = OptionPaneType.NoInformation;
                    }
                    this.ShowInformationPane(true);
                }
                else
                {
                    if (this.SelectedInformationPage.Value != OptionPaneType.Setting)
                    {
                        this.SelectedInformationPage.Value = OptionPaneType.None;
                    }
                }
            }, this.Disposables);



            //設定
            this.IsSettingPaneOpen = this.SelectedInformationPage
                                     .Select(x => x == OptionPaneType.Setting)
                                     .ToReactiveProperty(false)
                                     .AddTo(this.Disposables);

            this.OpenSettingPaneCommand = new ReactiveCommand()
                                          .WithSubscribe(_ =>
            {
                if (this.IsSettingPaneOpen.Value)
                {
                    this.SelectedInformationPage.Value = OptionPaneType.Setting;
                    this.IsPaneOpen.Value = true;
                }
                else
                {
                    if (this.SelectedInformationPage.Value == OptionPaneType.Setting)
                    {
                        this.SelectedInformationPage.Value = OptionPaneType.None;
                    }
                }
            }, this.Disposables);



            //ヘルプ
            this.IsHelpPaneOpen = this.SelectedInformationPage
                                  .Select(x => x == OptionPaneType.Help)
                                  .ToReactiveProperty(false)
                                  .AddTo(this.Disposables);

            this.OpenHelpPaneCommand = new ReactiveCommand()
                                       .WithSubscribe(_ =>
            {
                if (this.IsHelpPaneOpen.Value)
                {
                    this.SelectedInformationPage.Value = OptionPaneType.Help;
                    this.IsPaneOpen.Value = true;
                }
                else
                {
                    if (this.SelectedInformationPage.Value == OptionPaneType.Help)
                    {
                        this.SelectedInformationPage.Value = OptionPaneType.None;
                    }
                }
            }, this.Disposables);



            this.OptionPaneVisibility = this.SelectedInformationPage
                                        .Select(x => VisibilityHelper.Set(x > 0))
                                        .ToReactiveProperty()
                                        .AddTo(this.Disposables);

            this.FrameWidth = new ReactiveProperty <double>(300).AddTo(this.Disposables);

            this.IsFullScreen = client.SelectedPage.Select(_ => false).ToReactiveProperty().AddTo(this.Disposables);

            this.PageChangedSubject = new Subject <SplitViewDisplayMode>().AddTo(this.Disposables);

            this.PaneDisplayMode = this.IsPaneFixed
                                   .CombineLatest(this.DefaultPaneMode,
                                                  (paneFixed, defaultMode) =>
                                                  (defaultMode == PaneMode.Disabled) ? SplitViewDisplayMode.Overlay
                    : (paneFixed) ? SplitViewDisplayMode.CompactInline
                    : (defaultMode == PaneMode.HideInClosing) ? SplitViewDisplayMode.Overlay
                    : SplitViewDisplayMode.CompactOverlay)
                                   .ToReactiveProperty()
                                   .AddTo(this.Disposables);

            this.IsPaneOpen
            .Subscribe(x =>
            {
                if (!x)
                {
                    this.IsPaneFixed.Value             = false;
                    this.SelectedInformationPage.Value = OptionPaneType.None;
                    if (this.PaneDisplayMode.Value == SplitViewDisplayMode.CompactInline)
                    {
                        this.PaneDisplayMode.Value = SplitViewDisplayMode.CompactOverlay;
                    }
                }
            })
            .AddTo(this.Disposables);


            this.PaneOpenButtonVisibility = new ReactiveProperty <Visibility>(Visibility.Collapsed)
                                            .ToReactiveProperty()
                                            .AddTo(this.Disposables);

            var isWide = this.FrameWidth.Select(y => y > middleWindowWidth).Publish().RefCount();

            this.PaneFixButtonVisibility = isWide.Select(y => VisibilityHelper.Set(y))
                                           .ToReactiveProperty().AddTo(this.Disposables);
            isWide.Where(y => !y).Skip(2).Subscribe(y => this.IsPaneFixed.Value = false).AddTo(this.Disposables);

            this.JumpListWidth = this.IsOptionPageOpen.Select(x => x ? compactPaneWidth : openPaneWidth)
                                 .ToReactiveProperty().AddTo(this.Disposables);

            this.IsOptionPageOpen.Subscribe(x =>
            {
                if (x && this.SelectedInformationPage.Value != OptionPaneType.NoInformation &&
                    !core.IsAutoInformationPaneDisabled)
                {
                    this.IsPaneOpen.Value = true;
                }
            }).AddTo(this.Disposables);



            this.OpenSettingWindowCommand = new ReactiveCommand()
                                            .WithSubscribe(_ => ((App)Application.Current).ShowSettingWindow(-1), this.Disposables);

            this.OptionPageCommand = new ReactiveCommand <string>().AddTo(this.Disposables);



            this.IsPopupOpen = new ReactiveProperty <bool>(false).AddTo(this.Disposables);

            this.IsPopupOpen
            .Subscribe(x => this.KeyReceiver.Mode
                           = (int)(x ? KeyReceiverMode.PopupIsOpened : KeyReceiverMode.Normal))
            .AddTo(this.Disposables);



            this.prevPaneMode     = this.PaneDisplayMode.Value;
            this.prevPaneOpen     = this.IsPaneOpen.Value;
            this.prevPaneSelected = (OptionPaneType)this.SelectedInformationPage.Value;

            this.SelectedItems.ObserveProperty(x => x.Count).Pairwise().Subscribe(x =>
            {
                var autoOpen = !core.IsAutoInformationPaneDisabled;

                if (x.OldItem <= 0 && x.NewItem > 0)
                {
                    this.prevPaneMode     = this.PaneDisplayMode.Value;
                    this.prevPaneOpen     = this.IsPaneOpen.Value;
                    this.prevPaneSelected = (OptionPaneType)this.SelectedInformationPage.Value;

                    if (autoOpen && this.FrameWidth.Value > wideWindowWidth)
                    {
                        this.PaneDisplayMode.Value = SplitViewDisplayMode.CompactInline;
                        this.IsPaneOpen.Value      = true;
                    }

                    this.ShowInformationPane();
                }
                else if (x.OldItem > 0 && x.NewItem > 0 &&
                         (this.FrameWidth.Value > wideWindowWidth || this.IsPaneOpen.Value))
                {
                    this.ShowInformationPane();
                }
                else if (x.OldItem > 0 && x.NewItem <= 0)
                {
                    if (autoOpen)
                    {
                        this.PaneDisplayMode.Value = this.prevPaneMode;
                    }

                    this.ShowInformationPane();

                    if (autoOpen)
                    {
                        this.IsPaneOpen.Value = this.prevPaneOpen;
                    }
                }
            })
            .AddTo(this.Disposables);


            this.IsPaneFixed
            .Subscribe(x =>
            {
                if (x)
                {
                    this.prevPaneMode = SplitViewDisplayMode.CompactInline;
                    this.prevPaneOpen = true;
                }
                else
                {
                    this.prevPaneMode = SplitViewDisplayMode.CompactOverlay;
                    this.prevPaneOpen = false;
                }
            })
            .AddTo(this.Disposables);

            this.TagSelectorSortMode = core
                                       .ToReactivePropertyAsSynchronized(x => x.TagSelectorSortMode)
                                       .AddTo(this.Disposables);

            this.ExifVisibilityCheck = new ReactiveProperty <bool>(false).AddTo(this.Disposables);
            this.ExifVisibilityCheck
            .Skip(1)
            .Subscribe(x => core.Library.ExifManager.EnableAll(x)).AddTo(this.Disposables);

            this.IsExifEnabled = core.Library.ExifManager.HasVisibleItem
                                 .ToReadOnlyReactiveProperty().AddTo(this.Disposables);


            this.BackCommand = client.BackHistoryCount
                               .Select(x => x > 0)
                               .ToReactiveCommand()
                               .WithSubscribe(_ => client.Back(), this.Disposables);

            this.MoveToSearchPageCommand = new ReactiveCommand()
                                           .WithSubscribe(x => client.MoveToSearch(), this.Disposables);

            this.OpenPaneCommand = new ReactiveCommand()
                                   .WithSubscribe(_ => this.TogglePane(OptionPaneType.None), this.Disposables);

            // ウインドウへのファイルのドラッグ&ドロップ
            this.FileDropCommand = new ReactiveCommand()
                                   .WithSubscribe(obj =>
            {
                var files = obj as string[];
                if (files != null)
                {
                    this.Client.ActivateFiles(files);
                }
            }, this.Disposables);

            this.MouseExButtonSubject = new Subject <bool>().AddTo(this.Disposables);

            this.MouseExButtonLeftCommand = new ReactiveCommand()
                                            .WithSubscribe(_ =>
            {
                if (core.UseExtendedMouseButtonsToSwitchImage &&
                    client.SelectedPage.Value == PageType.Viewer)
                {
                    this.MouseExButtonSubject.OnNext(false);
                }
                else
                {
                    client.Back();
                }
            }, this.Disposables);

            this.MouseExButtonRightCommand = new ReactiveCommand()
                                             .WithSubscribe(_ =>
            {
                if (core.UseExtendedMouseButtonsToSwitchImage &&
                    client.SelectedPage.Value == PageType.Viewer)
                {
                    this.MouseExButtonSubject.OnNext(true);
                }
                else
                {
                    client.Forward();
                }
            }, this.Disposables);


            //Keyboard
            this.RegisterKeyReceiver(client);

            this.Catalog = new CatalogPageViewModel(this).AddTo(this.Disposables);
            this.Viewer  = new ViewerPageViewModel(this).AddTo(this.Disposables);
            this.Search  = new SearchPageViewModel(this).AddTo(this.Disposables);
        }
Example #26
0
		private void UpdateDisplayMode(SplitViewDisplayMode oldValue, SplitViewDisplayMode newValue)
		{
			ChangeVisualState(true);
		}
Example #27
0
 internal HamburgerMenuDisplayModeChangedEventArgs(SplitViewDisplayMode displayMode)
 {
     DisplayMode = displayMode;
 }
Example #28
0
        public void HideMenu()
        {
            var groups = VisualStateManager.GetVisualStateGroups(rootGrid);

            foreach (var group in groups)
                visualStateGroups.Add(group);

            groups.Clear();

            previousSplitViewDisplayMode = ShellSplitView.DisplayMode;
            ShellSplitView.DisplayMode = SplitViewDisplayMode.Overlay;
            ShellSplitView.IsPaneOpen = false;
            togglePaneButton.Visibility = Visibility.Collapsed;

            if (ShellSplitView.Pane != null)
                ShellSplitView.Pane.Visibility = Visibility.Collapsed;

            OnPaneSizeChanged();
        }
Example #29
0
 private void SetDisplayMode(SplitViewDisplayMode mode)
 {
     if (_isInitialized)
     {
         switch (mode)
         {
             case SplitViewDisplayMode.CompactOverlay:
             case SplitViewDisplayMode.CompactInline:
                 _headerContainer.Margin = new Thickness(0);
                 break;
             case SplitViewDisplayMode.Overlay:
             case SplitViewDisplayMode.Inline:
                 _headerContainer.Margin = new Thickness(48, 0, 0, 0);
                 break;
         }
     }
 }
Example #30
0
 void DisplayModePropertyChanged(SplitViewDisplayMode previous, SplitViewDisplayMode value)
 {
     // this will keep the two properties in sync
     if (ShellSplitView.DisplayMode != value)
     {
         ShellSplitView.DisplayMode = value;
     }
     HamburgerButtonGridWidth = (value == SplitViewDisplayMode.CompactInline) ? PaneWidth : squareWidth;
 }