private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                // create a new instance of the flyout
                SettingsFlyout settings = new SettingsFlyout();
                // set the desired width.  If you leave this out, you will get Narrow (346px)
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());

                // optionally change header and content background colors away from defaults (recommended)
                //settings.Background = new SolidColorBrush(Colors.Red);
                settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                settings.HeaderText = "Foo Bar Custom Settings";

                // provide some logo (preferrably the smallogo the app uses)
                BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));
                settings.SmallLogoImageSource = bmp;

                // set the content for the flyout
                settings.Content = new SettingsContent();

                // open it
                settings.IsOpen = true;

                // this is only for the test app and not needed
                // you would not use this code in your real app
                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
Example #2
0
        private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Add(new SettingsCommand("about", "About", x =>
            {
                _flyout = new SettingsFlyout
                {
                    HeaderText = "About",
                    Content = new AboutView(),
                    IsOpen = true,
                    ContentBackgroundBrush = new SolidColorBrush(Colors.Black),
                    ContentForegroundBrush = new SolidColorBrush(Colors.White)
                };
            }));
            args.Request.ApplicationCommands.Add(new SettingsCommand("privacy", "Privacy", x =>
            {
                _flyout = new SettingsFlyout
                {
                    HeaderText = "Privacy",
                    Content = new PrivacyView(),
                    IsOpen = true,
                    ContentBackgroundBrush = new SolidColorBrush(Colors.Black),
                    ContentForegroundBrush = new SolidColorBrush(Colors.White)
                };

            }));
        }
        private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());
                //settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                //settings.Background = new SolidColorBrush(Colors.White);
                settings.HeaderText = "Foo Bar Custom Settings";

                BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));

                settings.SmallLogoImageSource = bmp;

                StackPanel sp = new StackPanel();

                ToggleSwitch ts = new ToggleSwitch();
                ts.Header = "Download updates automatically";

                Button b = new Button();
                b.Content = "Test";

                sp.Children.Add(ts);
                sp.Children.Add(b);

                settings.Content = sp;

                settings.IsOpen = true;

                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
Example #4
0
        private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                // create a new instance of the flyout
                SettingsFlyout settings = new SettingsFlyout();
                // set the desired width.  If you leave this out, you will get Narrow (346px)
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());

                // optionally change header and content background colors away from defaults (recommended)
                // if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
                // settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
                settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                settings.HeaderText = string.Format("{0} Custom Settings", App.VisualElements.DisplayName);

                // provide some logo (preferrably the smallogo the app uses)
                BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
                settings.SmallLogoImageSource = bmp;

                // set the content for the flyout
                settings.Content = new SettingsContent();

                // open it
                settings.IsOpen = true;

                // this is only for the test app and not needed
                // you would not use this code in your real app
                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
Example #5
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add an About command
            var about = new SettingsCommand("about", "Über", (handler) =>
            {
                var settings     = new Callisto.Controls.SettingsFlyout();
                settings.Content = new AboutUserControl();

                var backgroundBrush = ResourceService.Get <SolidColorBrush>("AppBackgroundColorBrush");
                // settings.HeaderBrush = backgroundBrush;
                settings.ContentBackgroundBrush = backgroundBrush;
                settings.HeaderText             = "Über";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(about);

            // Add a Preferences command
            var preferences = new SettingsCommand("preferences", "Einstellungen", (handler) =>
            {
                var settings     = new Callisto.Controls.SettingsFlyout();
                settings.Content = new PreferencesUserControl();

                var backgroundBrush = ResourceService.Get <SolidColorBrush>("AppBackgroundColorBrush");
                // settings.HeaderBrush = backgroundBrush;
                settings.ContentBackgroundBrush = backgroundBrush;
                settings.HeaderText             = "Einstellungen";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(preferences);
        }
 private void HandlePrivacyPolocySettingsCommand(IUICommand command)
 {
     var settings = new SettingsFlyout();
     settings.Content = new PrivacyPolicySettingsView();
     settings.HeaderText = "Privacy Policy";
     settings.IsOpen = true;
 }
 private void itemListView_ItemClick_1(object sender, ItemClickEventArgs e)
 {
     Gig g = e.ClickedItem as Gig;
     sf = new SettingsFlyout();
     createSettingsFlyout(sf, g);
     sf.IsOpen = true;
 }
Example #8
0
        public ExtendedSplash(SplashScreen splashScreen, bool loadState)
        {
            this.InitializeComponent();

            settings = new SettingsFlyout();

            settings.Closed += settings_Closed;

            SettingsPane.GetForCurrentView().CommandsRequested += BlankPage_CommandsRequested;

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(Current_SizeChanged);

            _splash = splashScreen;

            if (_splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                _splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                this.Loaded += ExtendedSplash_Loaded;

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = _splash.ImageLocation;
                PositionImage();
            }

            // Create a Frame to act as the navigation context 
            rootFrame = new Frame();

            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);
        }
Example #9
0
 private void About_Click(IUICommand cmd) {
     SettingsFlyout settings = new SettingsFlyout();
     settings.Background = new SolidColorBrush(Colors.White);
     settings.HeaderBrush = new SolidColorBrush(Colors.Black);
     settings.Content = new AboutPanel();
     settings.HeaderText = "About";
     settings.IsOpen = true;
     RestoreCursor(); }
        /// <summary>
        /// Shows a settings flyout panel for the specified model.
        /// </summary>
        /// <param name="viewModel">The settings view model.</param>
        /// <param name="commandLabel">The settings command label.</param>
        /// <param name="viewSettings">The optional dialog settings.</param>
        public async void ShowSettingsFlyout(object viewModel, string commandLabel, IDictionary<string, object> viewSettings = null) {
            var view = ViewLocator.LocateForModel(viewModel, null, null);
            ViewModelBinder.Bind(viewModel, view, null);

            viewSettings = viewSettings ?? new Dictionary<string, object>();

            var width = viewSettings.ContainsKey("width")
                            ? (SettingsFlyout.SettingsFlyoutWidth) viewSettings["width"]
                            : SettingsFlyout.SettingsFlyoutWidth.Narrow;

            // extract the header color/logo from the appmanifest.xml
            var visualElements = await Callisto.Controls.Common.AppManifestHelper.GetManifestVisualElementsAsync();

            // enable the overriding of these, but default to manifest
            var headerBackground = viewSettings.ContainsKey("headerbackground")
                                       ? (SolidColorBrush) viewSettings["headerbackground"]
                                       : new SolidColorBrush(visualElements.BackgroundColor);

            var smallLogoUri = viewSettings.ContainsKey("smalllogouri")
                                   ? (Uri) viewSettings["smalllogouri"]
                                   : visualElements.SmallLogoUri;

            var smallLogo = new BitmapImage(smallLogoUri);

            // use real property names for ApplySettings
            if (!viewSettings.ContainsKey("FlyoutWidth"))
                viewSettings["FlyoutWidth"] = width;
            if (!viewSettings.ContainsKey("HeaderBrush"))
                viewSettings["HeaderBrush"] = headerBackground;
            if (!viewSettings.ContainsKey("SmallLogoImageSource"))
                viewSettings["SmallLogoImageSource"] = smallLogo;

            var settingsFlyout = new SettingsFlyout
                {
                    HeaderText = commandLabel,
                    Content = view,
                };

            ApplySettings(settingsFlyout, viewSettings);
            settingsFlyout.IsOpen = true;

            var deactivator = viewModel as IDeactivate;
            if (deactivator != null) {
                EventHandler<object> closed = null;
                closed = (s, e) => {
                    settingsFlyout.Closed -= closed;
                    deactivator.Deactivate(true);
                };

                settingsFlyout.Closed += closed;
            }

            var activator = viewModel as IActivate;
            if (activator != null) {
                activator.Activate();
            }
        }
        public static void ShowSettingsFlyout(SettingsFlyout flyout)
        {
            var detailPage = GetCurrentContentPage();
            if (null != detailPage)
            {
                FixWebViewZOrderProblem(flyout, detailPage);
            }

            flyout.IsOpen = true;
        }
        private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Note this is kept here for posterity but shouldn't be used
            // see the next sample of using the Windows.UI.Xaml.Controls.SettingsFlyout
            // in Windows 8.1 for the replacement if you were using this code example before.
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                // create a new instance of the flyout
                Callisto.Controls.SettingsFlyout settings = new Callisto.Controls.SettingsFlyout();
                // set the desired width.  If you leave this out, you will get Narrow (346px)
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());
                // optionally change header and content background colors away from defaults (recommended)
                settings.HeaderBrush = new SolidColorBrush(Colors.Orange);

                // optionally change header and content background colors away from defaults (recommended)
                // if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
                // settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
                settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                settings.HeaderText = string.Format("{0} Custom Settings", App.VisualElements.DisplayName);

                // provide some logo (preferrably the smallogo the app uses)
                BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
                settings.SmallLogoImageSource = bmp;

                // set the content for the flyout
                settings.Content = new SettingsContent();

                // open it
                settings.IsOpen = true;

                // this is only for the test app and not needed
                // you would not use this code in your real app
                ObjectTracker.Track(settings);
            });

            // note this is the new and preferred way in Windows 8.1 using
            // Windows.UI.Xaml.Controls.SettingsFlyout
            // This sample is kept here to show an example of this
            SettingsCommand cmd2 = new SettingsCommand("sample2", "Sample 2", (x) =>
            {
                Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout();
                settings.Width = 500;
                settings.HeaderBackground = new SolidColorBrush(Colors.Orange);
                settings.HeaderForeground = new SolidColorBrush(Colors.Black);
                settings.Title = string.Format("{0} Custom 2", App.VisualElements.DisplayName);
                settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo);
                settings.Content = new SettingsContent();
                settings.Show();
                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
            args.Request.ApplicationCommands.Add(cmd2);
        }
Example #13
0
        private void HandleProfileSettingsCommandRequest(IUICommand command)
        {
            var settings = new SettingsFlyout();
            settings.Content = settingsView;
            settingsView.DataContext = settingsViewModel;
            settingsViewModel.LoadProperties();
            settingsViewModel.PictureReceived += (sender, args) => HandleProfileSettingsCommandRequest(command);
            settings.HeaderText = "Profile Settings";
            settings.IsOpen = true;

        }
Example #14
0
        public static void ShowSettingsFlyout(Callisto.Controls.SettingsFlyout flyout)
        {
            var detailPage = GetCurrentContentPage();

            if (null != detailPage)
            {
                FixWebViewZOrderProblem(flyout, detailPage);
            }

            flyout.IsOpen = true;
        }
Example #15
0
        private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Note this is kept here for posterity but shouldn't be used
            // see the next sample of using the Windows.UI.Xaml.Controls.SettingsFlyout
            // in Windows 8.1 for the replacement if you were using this code example before.
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                // create a new instance of the flyout
                Callisto.Controls.SettingsFlyout settings = new Callisto.Controls.SettingsFlyout();
                // set the desired width.  If you leave this out, you will get Narrow (346px)
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());

                // optionally change header and content background colors away from defaults (recommended)
                // if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
                // settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
                settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                settings.HeaderText  = string.Format("{0} Custom Settings", App.VisualElements.DisplayName);

                // provide some logo (preferrably the smallogo the app uses)
                BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
                settings.SmallLogoImageSource = bmp;

                // set the content for the flyout
                settings.Content = new SettingsContent();

                // open it
                settings.IsOpen = true;

                // this is only for the test app and not needed
                // you would not use this code in your real app
                ObjectTracker.Track(settings);
            });

            // note this is the new and preferred way in Windows 8.1 using
            // Windows.UI.Xaml.Controls.SettingsFlyout
            // This sample is kept here to show an example of this
            SettingsCommand cmd2 = new SettingsCommand("sample2", "Sample 2", (x) =>
            {
                Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout();
                settings.Width            = 500;
                settings.HeaderBackground = new SolidColorBrush(Colors.Orange);
                settings.HeaderForeground = new SolidColorBrush(Colors.Black);
                settings.Title            = string.Format("{0} Custom 2", App.VisualElements.DisplayName);
                settings.IconSource       = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo);
                settings.Content          = new SettingsContent();
                settings.Show();
                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
            args.Request.ApplicationCommands.Add(cmd2);
        }
Example #16
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var privacyPolicy = new SettingsCommand("privacyPolicy", "Privacy Policy", (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.Content = new PrivacyPolicy();
                settings.HeaderBrush = new SolidColorBrush(background);
                settings.Background = new SolidColorBrush(background);
                settings.HeaderText = "Privacy Policy";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(privacyPolicy);
        }
Example #17
0
        public void GoToLogin()
        {
            Callisto.Controls.SettingsFlyout AboutFlyout = new Callisto.Controls.SettingsFlyout();


            AboutFlyout.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Wide;
            AboutFlyout.HeaderText = International.Translation.Login_Title;
            AboutFlyout.Content = new MultiPlatform.W8.UI.Views.UC.Login();
            AboutFlyout.IsOpen = true;




        }
Example #18
0
 private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     //SettingsPane.GetForCurrentView().CommandsRequested -= OnCommandsRequested;
     args.Request.ApplicationCommands.Clear();
     var about = new SettingsCommand("about", "Acerca de...", (handler) =>
     {
         var settings = new SettingsFlyout();
         settings.Content = new AcercaNotasRapidas();
         settings.HeaderBrush = new SolidColorBrush(_background);
         settings.HeaderText = "Acerca de Notas Rapidas";
         settings.IsOpen = true;
     });
     args.Request.ApplicationCommands.Add(about);
 }
Example #19
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Agregar un comando About
            var about = new SettingsCommand("about", "Acerca de", (handler) =>
            {
                var settings         = new Callisto.Controls.SettingsFlyout();
                settings.Content     = new AboutUserControl();
                settings.HeaderBrush = new SolidColorBrush(_background);
                settings.Background  = new SolidColorBrush(_background);
                settings.HeaderText  = "Acerca de";
                settings.IsOpen      = true;
            });

            args.Request.ApplicationCommands.Add(about);
        }
Example #20
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add an About command
            var about = new SettingsCommand("about", "About", (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.Content = new AboutUserControl();
                settings.HeaderBrush = new SolidColorBrush(_background);
                settings.Background = new SolidColorBrush(_background);
                settings.HeaderText = "About";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(about);
        }
Example #21
0
        private void OnSettingsRequested(IList<SettingsCommand> commands)
        {
            SettingsCommand settingsCommand = new SettingsCommand("FeedsSetting", "Feeds", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();
                settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Wide;
                settings.HeaderText = "Feeds";

                var view = new SettingsView();
                settings.Content = view;
                settings.HorizontalContentAlignment = HorizontalAlignment.Stretch;
                settings.VerticalContentAlignment = VerticalAlignment.Stretch;
                settings.IsOpen = true;
            });
            commands.Add(settingsCommand);
        }
Example #22
0
        private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add a Preferences command
            var preferences = new SettingsCommand("preferences", "Preferences", (handler)
                                                  =>
            {
                var settings         = new Callisto.Controls.SettingsFlyout();
                settings.Content     = new PreferencesUserControl();
                settings.HeaderBrush = new SolidColorBrush(_background);
                settings.Background  = new SolidColorBrush(_background);
                settings.HeaderText  = "Preferences";
                settings.IsOpen      = true;
            });

            args.Request.ApplicationCommands.Add(preferences);
        }
Example #23
0
        private void DisplayPrivacyPolicy(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add a Preferences command
            var privacyPolicyCommand = new SettingsCommand("privacy policy", "Privacy Policy", (handler)
                                                           =>
            {
                var pp         = new Callisto.Controls.SettingsFlyout();
                pp.Content     = new ppUserControl();
                pp.HeaderBrush = new SolidColorBrush(_background);
                pp.Background  = new SolidColorBrush(_background);
                pp.HeaderText  = "Privacy Policy";
                pp.IsOpen      = true;
            });

            args.Request.ApplicationCommands.Add(privacyPolicyCommand);
        }
Example #24
0
        private void DisplayAbout(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add a Preferences command
            var aboutCommand = new SettingsCommand("about", "About", (handler)
                                                   =>
            {
                var about         = new Callisto.Controls.SettingsFlyout();
                about.Content     = new aboutUserControl();
                about.HeaderBrush = new SolidColorBrush(_background);
                about.Background  = new SolidColorBrush(_background);
                about.HeaderText  = "About";
                about.IsOpen      = true;
            });

            args.Request.ApplicationCommands.Add(aboutCommand);
        }
        private void onCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand command = new SettingsCommand("CompteId", "Compte", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();

                settings.Content = this;
                settings.HeaderBrush = new SolidColorBrush(Color.FromArgb(255, 0, 77, 96));
                settings.Background = new SolidColorBrush(Colors.White);
                settings.HeaderText = "Compte";
                settings.Width = 646;
                settings.IsOpen = true;
            });
            args.Request.ApplicationCommands.Add(command);
            // and so on.. add the other commands you need to show 
        }
Example #26
0
        private void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("settings", "Settings", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout
                    {
                        HeaderBrush = new SolidColorBrush(Colors.Orange),
                        HeaderText = "Weather Settings",
                        ContentBackgroundBrush = new SolidColorBrush(Colors.Black)
                    };
                BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));
                settings.SmallLogoImageSource = bmp;
                settings.Content = new SettingsUserControl();
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
        public void InitializeFlyout() {
            flyout = new SettingsFlyout {
                HeaderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x1A, 0x91, 0xDB)),
                HeaderText = Header,
                Background = new SolidColorBrush(Colors.Transparent),
                ContentBackgroundBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0xF0, 0xF0, 0xF0)),
                FlyoutWidth = SettingsFlyout.SettingsFlyoutWidth.Narrow,
                Content = this
            };

            flyout.BackClicked += (sender, args) => {
                args.Cancel = true;
                flyout.IsOpen = false;
            };

            if (Image != null) {
                flyout.SmallLogoImageSource = new BitmapImage(Image);
            }
        }
        //SettingsFlyout settings = null;
        public void OnSettingsPaneCommandsRequested(object sender, object args)
        {
            SettingsCommand settingsCommand = new SettingsCommand(0,resourcesService.GetString("Settings"), (x) =>
            {
                settings = new SettingsFlyout();
                settings.Closed += settings_Closed;
                settings.Content = new SettingsControl();
                settings.HeaderText = resourcesService.GetString("Settings");
                Window.Current.Activated += Current_Activated;

               //SolidColorBrush bg = (SolidColorBrush)resourcesService.GetApplicationResource("ApplicationPageBackgroundThemeBrush");
              //  settings.HeaderBrush = bg;
                //settings.Background = new SolidColorBrush(Colors.Red);
                settings.IsOpen = true;
            });
            SettingsPaneCommandsRequestedEventArgs settingsArgs = args as SettingsPaneCommandsRequestedEventArgs;
            if (!settingsArgs.Request.ApplicationCommands.Contains(settingsCommand))
                settingsArgs.Request.ApplicationCommands.Add(settingsCommand);
        }
Example #29
0
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var cmd = new SettingsCommand("Scoreoid", "Scoreoid", (x) =>
            {
                var settings = new SettingsFlyout();
                settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;

                settings.Background = new SolidColorBrush(Colors.White);
                settings.HeaderBrush = new SolidColorBrush(Colors.Blue);
                settings.HeaderText = "Scoreoid";

                BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));
                settings.SmallLogoImageSource = bmp;

                settings.Content = new ScoreoidUI.ScoreoidPane();
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
Example #30
0
        private void Add_Rosette_Click(object sender, RoutedEventArgs e)
        {
            NewRosetteControl nc = new NewRosetteControl();
            nc.RosetteChosen += nc_RosetteChosen;
            
            SettingsFlyout settings = new SettingsFlyout();
            // set the desired width.  If you leave this out, you will get Narrow (346px)
            settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;

            // optionally change header and content background colors away from defaults (recommended)
            // if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
            settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
            settings.HeaderText = "Points"; // string.Format("{0}", App.VisualElements.DisplayName);
            settings.ContentBackgroundBrush = BarrelPathDisplay.CanvasBackgroundBrush;
            // provide some logo (preferrably the smallogo the app uses)
            BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
            settings.SmallLogoImageSource = bmp;
            settings.Content = nc;
            // open it
            settings.IsOpen = true;
        }
Example #31
0
        private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Add(new SettingsCommand("about", "About", x =>
            {
                _flyout = new SettingsFlyout
                {
                    HeaderText = "About",
                    Content = new AboutView(),
                    IsOpen = true,
                };
            }));
            args.Request.ApplicationCommands.Add(new SettingsCommand("privacy", "Privacy", x =>
            {
                _flyout = new SettingsFlyout
                {
                    HeaderText = "Privacy",
                    Content = new PrivacyView(),
                    IsOpen = true,
                };

            }));
        }
Example #32
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var c = new Color()
            {
                R = 46,
                G = 46,
                B = 46
            };

            // Add an About command
            var about = new SettingsCommand("about",
                                            "Über",
                                            (handler) =>
            {
                var aboutFlyout     = new Callisto.Controls.SettingsFlyout();
                aboutFlyout.Content = new AboutControl();

                aboutFlyout.ContentBackgroundBrush = new SolidColorBrush(c);
                aboutFlyout.HeaderText             = "Über";

                WebViewFlyoutFixes.ShowSettingsFlyout(aboutFlyout);
            });

            args.Request.ApplicationCommands.Add(about);

            // Add a Preferences command
            var preferences = new SettingsCommand("preferences", "Einstellungen", (handler) =>
            {
                var settings     = new Callisto.Controls.SettingsFlyout();
                settings.Content = new PreferencesUserControl();

                settings.ContentBackgroundBrush = new SolidColorBrush(c);
                settings.HeaderText             = "Einstellungen";

                WebViewFlyoutFixes.ShowSettingsFlyout(settings);
            });

            args.Request.ApplicationCommands.Add(preferences);
        }
Example #33
0
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand settingBackendUrl = new SettingsCommand("SettingBackendUrl", "Settings", (e) =>
            {
                SettingsFlyout settingsFlyout = new SettingsFlyout();
                settingsFlyout.FlyoutWidth = SettingsFlyout.SettingsFlyoutWidth.Narrow;
                settingsFlyout.HeaderText = "Settings";
                settingsFlyout.Content = new Settings();
                settingsFlyout.IsOpen = true; 
            });
            args.Request.ApplicationCommands.Add(settingBackendUrl);

            SettingsCommand settingPrivacyPolicy = new SettingsCommand("PrivacyPolicy", "PrivacyPolicy", (e) =>
            {
                SettingsFlyout settingsFlyout = new SettingsFlyout();
                settingsFlyout.FlyoutWidth = SettingsFlyout.SettingsFlyoutWidth.Narrow;
                settingsFlyout.HeaderText = "Privacy Policy";
                settingsFlyout.Content = new PrivacyPolicy();
                settingsFlyout.IsOpen = true;
            });
            args.Request.ApplicationCommands.Add(settingPrivacyPolicy); 

        }
Example #34
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var c = new Color()
            {
                R = 46,
                G = 46,
                B = 46
            };

            // Add an About command
            var about = new SettingsCommand("about",
                                            "About",
                                            (handler) =>
            {
                var settings                    = new Callisto.Controls.SettingsFlyout();
                settings.Content                = new About();
                settings.HeaderText             = "About";
                settings.ContentBackgroundBrush = new SolidColorBrush(c);
                settings.IsOpen                 = true;
            });

            args.Request.ApplicationCommands.Add(about);
        }
Example #35
0
        //***************************************************************************************
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs eventArgs)
        {
            // Acerca de (información de contacto)
            SettingsCommand about =
            new SettingsCommand("About", "Acerca de", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();
                settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;
                settings.HeaderText = "Acerca de";
                settings.HeaderBrush = new SolidColorBrush(Color.FromArgb(255,44,97,193));
                settings.Background = new SolidColorBrush(Colors.White);

                settings.Content = new MyUserControl1();

                settings.IsOpen = true;
            });
            eventArgs.Request.ApplicationCommands.Add(about);

            // Política de privacidad
            SettingsCommand privacyPolicyCommand =
            new SettingsCommand("politicaPrivacidad",
            "Política de privacidad", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();
                settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;
                settings.HeaderText = "Política de privacidad";
                settings.HeaderBrush = new SolidColorBrush(Color.FromArgb(255, 44, 97, 193));
                settings.Background = new SolidColorBrush(Colors.White);

                settings.Content = new MyUserControl2();

                settings.IsOpen = true;
            }
            );
            eventArgs.Request.ApplicationCommands.Add(privacyPolicyCommand);

            // Política de privacidad
            SettingsCommand ayuda =
            new SettingsCommand("ayuda",
            "Ayuda", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();
                settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;
                settings.HeaderText = "Ayuda";
                settings.HeaderBrush = new SolidColorBrush(Color.FromArgb(255, 44, 97, 193));
                settings.Background = new SolidColorBrush(Colors.White);

                settings.Content = new MyUserControl3();

                settings.IsOpen = true;
            }
            );
            eventArgs.Request.ApplicationCommands.Add(ayuda);
        }
Example #36
0
        /// <summary>
        /// Show a settings flyout using the Callisto toolkit (http://callistotoolkit.com/)
        /// </summary>
        /// <param name="title">Name of flyout</param>
        /// <param name="content">UserControl containing the content to be displayed in the flyout</param>
        /// <param name="width">Flyout width (narrow or wide)</param>
        private async void ShowFlyout(string title, Windows.UI.Xaml.Controls.UserControl content,
            SettingsFlyout.SettingsFlyoutWidth width = SettingsFlyout.SettingsFlyoutWidth.Narrow)
        {
            // grab app theme color from resources (optional)
            SolidColorBrush color = null;
            if (App.Current.Resources.Keys.Contains("AppThemeBrush"))
                color = App.Current.Resources["AppThemeBrush"] as SolidColorBrush;

            // create the flyout
            var flyout = new SettingsFlyout();
            if (color != null) flyout.HeaderBrush = color;
            flyout.HeaderText = title;
            flyout.FlyoutWidth = width;

            // access the small logo from the manifest
            flyout.SmallLogoImageSource = new BitmapImage((await AppManifestHelper.GetManifestVisualElementsAsync()).SmallLogoUri);

            // assign content and show
            flyout.Content = content;
            flyout.IsOpen = true;
        }
Example #37
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Callisto.Controls.SettingsFlyout sf = this.Ancestors <Callisto.Controls.SettingsFlyout>().FirstOrDefault() as Callisto.Controls.SettingsFlyout;
     sf.IsOpen = false;
 }
Example #38
0
 private static void FixWebViewZOrderProblem(Callisto.Controls.SettingsFlyout flyout, IWebViewFlyoutFixes page)
 {
     flyout.Closed += (s, e) => page.OnFlyoutClose();
     page.OnFlyoutOpen();
 }
Example #39
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var c = new Color()
            {
                R = 46,
                G = 46,
                B = 46
            };

            // Add an About command
            var about = new SettingsCommand("about",
                "Über",
                (handler) =>
                {
                    var aboutFlyout = new Callisto.Controls.SettingsFlyout();
                    aboutFlyout.Content = new AboutControl();

                    aboutFlyout.ContentBackgroundBrush = new SolidColorBrush(c);
                    aboutFlyout.HeaderText = "Über";

                    WebViewFlyoutFixes.ShowSettingsFlyout(aboutFlyout);
                });

            args.Request.ApplicationCommands.Add(about);

            // Add a Preferences command
            var preferences = new SettingsCommand("preferences", "Einstellungen", (handler) =>
            {
                var settings = new Callisto.Controls.SettingsFlyout();
                settings.Content = new PreferencesUserControl();

                settings.ContentBackgroundBrush = new SolidColorBrush(c);
                settings.HeaderText = "Einstellungen";

                WebViewFlyoutFixes.ShowSettingsFlyout(settings);
            });

            args.Request.ApplicationCommands.Add(preferences);
        }
Example #40
0
 private void DisplayAbout(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     // Add a Preferences command
     var aboutCommand = new SettingsCommand("about", "About", (handler)
     =>
     {
         var about = new Callisto.Controls.SettingsFlyout();
         about.Content = new aboutUserControl();
         about.HeaderBrush = new SolidColorBrush(_background);
         about.Background = new SolidColorBrush(_background);
         about.HeaderText = "About";
         about.IsOpen = true;
     });
     args.Request.ApplicationCommands.Add(aboutCommand);
 }
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add a command

            var pref = new SettingsCommand("about", "About", (handler) =>
            {

                var settings = new Callisto.Controls.SettingsFlyout();

                settings.Content = new PreferencesUserControl();

                settings.HeaderBrush = new SolidColorBrush(Windows.UI.Colors.DarkRed);

                settings.Background = new SolidColorBrush(Windows.UI.Colors.DarkRed);

                settings.HeaderText = "About";

                settings.IsOpen = true;

            });

            args.Request.ApplicationCommands.Add(pref);
        }