Example #1
0
        private void CreatePopup(ApplicationSettingViewInfo viewInfo)
        {
            var applicationSettingFrame = this.container.Resolve <IApplicationSettingFrame>();

            var settingsWidth = viewInfo.LayoutType == ApplicationSettingLayoutType.Large
                                    ? LargeSettingsWidth
                                    : SettingsWidth;

            var settingsPopup = new Popup();

            settingsPopup.Closed               += this.OnPopupClosed;
            Window.Current.Activated           += this.OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            settingsPopup.Width  = settingsWidth;
            settingsPopup.Height = Window.Current.Bounds.Height;

            ((FrameworkElement)applicationSettingFrame).Height = settingsPopup.Height;
            ((FrameworkElement)applicationSettingFrame).Width  = settingsPopup.Width;

            applicationSettingFrame.SetContent(viewInfo.Title, this.container.Resolve(viewInfo.ViewType));

            settingsPopup.Child = (UIElement)applicationSettingFrame;
            settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - settingsWidth);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;

            this.activePopups.Add(settingsPopup);
        }
Example #2
0
 private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     foreach (var viewInfo in this.GetVisibleSettings())
     {
         ApplicationSettingViewInfo info = viewInfo.Value;
         var command = new SettingsCommand(viewInfo.Key, info.Title, (x) => this.CreatePopup(info));
         args.Request.ApplicationCommands.Add(command);
     }
 }