Exemple #1
0
        private void PopulateCommandBar()
        {
            PageService?.AddCommandBarButton(CommandBarButton.Separator);

            // Add page settings button
            PageService?.AddCommandBarButton(PageUtil.CreatePageSettingCommandBarButton(
                                                 PageService,
                                                 new WeatherSettingsControl
            {
                Width      = Constants.DefaultSidePaneContentWidth,
                Background = new SolidColorBrush(Colors.Transparent),
            },
                                                 Common.GetLocalizedText("WeatherSettingHeader/Text")));
            PageService?.AddCommandBarButton(CommandBarButton.Separator);

            // Add refresh button
            PageService?.AddCommandBarButton(new CommandBarButton
            {
                Icon    = new SymbolIcon(Symbol.Refresh),
                Label   = Common.GetLocalizedText("RefreshButton"),
                Handler = async(s, e) =>
                {
                    await RefreshWeatherAsync();
                },
            });
        }
        private void PopulateCommandBar()
        {
            if (PageService.AddCommandBarButton(CommandBarButton.Separator) is AppBarSeparator separator)
            {
                separator.SetBinding(UIElement.VisibilityProperty, new Binding
                {
                    Converter = new BooleanToVisibilityConverter(),
                    Path      = new PropertyPath("IsClearAccountsButtonVisible"),
                    Source    = this,
                    Mode      = BindingMode.OneWay
                });
            }

            if (PageService.AddCommandBarButton(new CommandBarButton
            {
                Icon = new SymbolIcon(Symbol.Clear),
                Label = ClearAccountsButtonContent,
                Handler = ClearAccountsButton_Click,
            }) is AppBarButton appBarButton)
            {
                // Bind button to property so that it's hidden when there are no accounts to clear, or
                // ProcessLauncher is not enabled
                appBarButton.SetBinding(UIElement.VisibilityProperty, new Binding
                {
                    Converter = new BooleanToVisibilityConverter(),
                    Path      = new PropertyPath("IsClearAccountsButtonVisible"),
                    Source    = this,
                    Mode      = BindingMode.OneWay
                });
            }
        }
Exemple #3
0
        private void PopulateCommandBar()
        {
            PageService.AddCommandBarButton(CommandBarButton.Separator);

            PageService.AddCommandBarButton(new CommandBarButton
            {
                Icon    = new SymbolIcon(Symbol.Save),
                Label   = Common.GetLocalizedText("SaveButtonText"),
                Handler = SaveButton_Click,
            });
        }
 private void PopulateCommandBar()
 {
     PageService?.AddCommandBarButton(CommandBarButton.Separator);
     PageService?.AddCommandBarButton(PageUtil.CreatePageSettingCommandBarButton(
                                          PageService,
                                          new TileSettingsControl
     {
         Width      = Constants.DefaultSidePaneContentWidth,
         Background = new SolidColorBrush(Colors.Transparent),
     },
                                          Common.GetLocalizedText("TileSettingHeader/Text")));
 }
        private void PopulateCommandBar()
        {
            PageService.AddCommandBarButton(CommandBarButton.Separator);

            PageService.AddCommandBarButton(new CommandBarButton
            {
                Icon    = new SymbolIcon(Symbol.Add),
                Label   = Common.GetLocalizedText("SelectAllButtonText"),
                Handler = SelectAllButton_Click,
            });

            PageService.AddCommandBarButton(new CommandBarButton
            {
                Icon    = new SymbolIcon(Symbol.Clear),
                Label   = Common.GetLocalizedText("UnselectAllButtonText"),
                Handler = UnselectAllButton_Click,
            });

            if (AppService.AuthManager.IsAadProviderAvailable())
            {
                PageService.AddCommandBarButton(new CommandBarButton
                {
                    Icon    = new SymbolIcon(Symbol.Mail),
                    Label   = Common.GetLocalizedText("EmailSelectedButtonText"),
                    Handler = EmailLogsButton_Click,
                });
            }

            PageService.AddCommandBarButton(new CommandBarButton
            {
                Icon    = new SymbolIcon(Symbol.Delete),
                Label   = Common.GetLocalizedText("DeleteSelectedButtonText"),
                Handler = DeleteLogsButton_Click,
            });

            PageService.AddSecondaryCommandBarButton(new CommandBarButton
            {
                Icon    = new SymbolIcon(Symbol.Help),
                Label   = Common.GetLocalizedText("HelpButtonText"),
                Handler = HelpButton_Click,
            });
        }
 private void PopulateCommandBar()
 {
     PageService.AddCommandBarButton(CommandBarButton.Separator);
     PageService.AddCommandBarButton(new CommandBarButton
     {
         Icon    = new SymbolIcon(Symbol.Up),
         Label   = Common.GetLocalizedText("TestNotificationButtonText"),
         Handler = (s, e) => PageService.ShowNotification(Common.GetLocalizedText("TestNotificationMessage")),
     });
     PageService.AddCommandBarButton(new CommandBarButton
     {
         Icon    = new SymbolIcon(Symbol.Up),
         Label   = Common.GetLocalizedText("TestJumboNotificationButtonText"),
         Handler = (s, e) => PageService.ShowJumboNotification(
             Common.GetLocalizedText("WelcomeMessage"),
             JumboNotificationControl.DefaultColor,
             5000,
             JumboNotificationControl.DefaultSymbol),
     });
 }