Exemplo n.º 1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            await TitleBarHelper.SetVisibilityAsync(Windows.UI.Xaml.Visibility.Collapsed);

            TitleBarHelper.SetButtonBackgroundColor(Colors.Transparent);
            TitleBarHelper.SetButtonForegroundColor(Colors.White);

            var snm = SystemNavigationManager.GetForCurrentView();

            snm.BackRequested -= App.GlobalBackRequested;
            snm.BackRequested += LoginPage_BackRequested;

            Messenger.Default.Register <NotificationMessage>(this, message =>
            {
                ShowAlertGridStoryboard.Begin();
                AlertDescriptionTextBlock.Text = message.Notification;
            });

            ViewModel.PropertyChanged += (s, args) =>
            {
                if (args.PropertyName.Equals(nameof(ViewModel.CurrentStep)))
                {
                    SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                        ViewModel.PreviousCommand.CanExecute(null) ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
                }
            };
        }
Exemplo n.º 2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            await TitleBarHelper.SetVisibilityAsync(Windows.UI.Xaml.Visibility.Collapsed);

            TitleBarHelper.SetButtonBackgroundColor(Colors.Transparent);
            TitleBarHelper.SetButtonForegroundColor(Colors.White);
        }
Exemplo n.º 3
0
        private void UpdateBrushesAndTheme()
        {
            if (ViewModel.ColorScheme.Equals("light"))
            {
                ForegroundBrush       = new SolidColorBrush(Color.FromArgb(0xFF, 0x44, 0x44, 0x44));
                BackgroundBrush       = new SolidColorBrush(Colors.White);
                ColorApplicationTheme = ElementTheme.Light;
            }
            else if (ViewModel.ColorScheme.Equals("sepia"))
            {
                ForegroundBrush       = new SolidColorBrush(Colors.Maroon);
                BackgroundBrush       = new SolidColorBrush(Colors.Beige);
                ColorApplicationTheme = ElementTheme.Light;
            }
            else if (ViewModel.ColorScheme.Equals("dark"))
            {
                ForegroundBrush       = new SolidColorBrush(Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC));
                BackgroundBrush       = new SolidColorBrush(Color.FromArgb(0xFF, 0x33, 0x33, 0x33));
                ColorApplicationTheme = ElementTheme.Dark;
            }
            else if (ViewModel.ColorScheme.Equals("black"))
            {
                ForegroundBrush       = new SolidColorBrush(Color.FromArgb(0xFF, 0xB3, 0xB3, 0xB3));
                BackgroundBrush       = new SolidColorBrush(Colors.Black);
                ColorApplicationTheme = ElementTheme.Dark;
            }

            (FindName(nameof(commandsGrid)) as Grid).RequestedTheme = ColorApplicationTheme;
            TitleBarHelper.SetButtonForegroundColor(ForegroundBrush.Color);

            var gradientStops = (TitleBarBackgroundRectangle.Fill as LinearGradientBrush).GradientStops;

            gradientStops[0].Color = BackgroundBrush.Color;

            if (ColorApplicationTheme == ElementTheme.Dark)
            {
                gradientStops[1].Color = Color.FromArgb(1, 0, 0, 0);
            }
            else
            {
                gradientStops[1].Color = Colors.Transparent;
            }
        }
Exemplo n.º 4
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            await TitleBarHelper.SetVisibilityAsync(Visibility.Collapsed);

            TitleBarHelper.SetButtonBackgroundColor(Colors.Transparent);
            TitleBarHelper.SetButtonForegroundColor(ForegroundBrush.Color);

            Messenger.Default.Register <LoadContentMessage>(this, message =>
            {
                HtmlViewer.NavigateToString(ViewModel.FormattedHtml);
            });

            Messenger.Default.Register <TagsEditedMessage>(this, async message =>
            {
                if (message.Item.Id == ViewModel.Item.Model.Id)
                {
                    await HtmlViewer.InvokeScriptAsync("updateTagsElement", new List <string>()
                    {
                        ViewModel.BuildTagsHtml(message.Item)
                    });
                }
            });
        }