/// <summary>
        /// Method helps to perform product selection change.
        /// </summary>
        private void OnSelectedProductChanged()
        {
            if (this.SelectedProduct == null)
            {
                return;
            }

            selectedthemename = DemoBrowserViewModel.DefaultThemeName;

            // Fluent theme is the default theme.
            selectedtheme   = themelist.FirstOrDefault(theme => theme.ThemeName == "FluentLight");
            Palettes        = new ObservableCollection <Palette>(PaletteList.Where(x => (x.Theme.Equals(selectedthemename))).ToList <Palette>());
            SelectedPalette = Palettes.Where(x => x.Name.Equals("Default")).ToList <Palette>()[0];
            UpdateTitleBarBackgroundandForeground(selectedthemename);
            ProductDemosWindow productDemo = null;

            if (this.isWindowMode)
            {
                productDemo       = new ProductDemosWindow(this);
                productDemo.Owner = DemosNavigationService.MainWindow;
                SfSkinManager.SetTheme(productDemo, new Theme()
                {
                    ThemeName = SelectedThemeName
                });
            }
            else
            {
                if (DemosNavigationService.RootNavigationService.CanGoForward)
                {
                    DemosNavigationService.RootNavigationService.GoForward();
                }
                else
                {
                    DemosNavigationService.RootNavigationService.Navigate(new DemosListView()
                    {
                        DataContext = this
                    });
                }
            }
            if (this.SearchItem == null)
            {
                SelectedSample = this.SelectedProduct.Demos[0];
            }
            else
            {
                if (searchItem.ProductDemoInfo != null && this.SelectedSample != searchItem.ProductDemoInfo)
                {
                    this.SelectedSample = searchItem.ProductDemoInfo;
                    this.SearchText     = null;
                }
            }
            if (ThemeChanged != null)
            {
                ThemeChanged();
            }
            if (productDemo != null)
            {
                productDemo.ShowDialog();
            }
        }
Exemple #2
0
        /// <summary>
        /// Method helps to perform product selection change.
        /// </summary>
        private void OnSelectedProductChanged()
        {
            if (this.SelectedProduct == null)
            {
                return;
            }

            selectedthemename = DemoBrowserViewModel.DefaultThemeName;
            ProductDemosWindow productDemo = null;

            if (this.isWindowMode)
            {
                UpdateTitleBarBackgroundandForeground(SelectedThemeName);
                productDemo       = new ProductDemosWindow(this);
                productDemo.Owner = DemosNavigationService.MainWindow;
                SfSkinManager.SetTheme(productDemo, new Theme()
                {
                    ThemeName = SelectedThemeName
                });
            }
            else
            {
                if (DemosNavigationService.RootNavigationService.CanGoForward)
                {
                    DemosNavigationService.RootNavigationService.GoForward();
                }
                else
                {
                    DemosNavigationService.RootNavigationService.Navigate(new DemosListView()
                    {
                        DataContext = this
                    });
                }
            }
            if (this.SearchItem == null)
            {
                SelectedSample = this.SelectedProduct.Demos[0];
            }
            else
            {
                if (searchItem.ProductDemoInfo != null && this.SelectedSample != searchItem.ProductDemoInfo)
                {
                    this.SelectedSample = searchItem.ProductDemoInfo;
                    this.SearchText     = null;
                }
            }
            if (productDemo != null)
            {
                productDemo.ShowDialog();
            }
        }