public DownloadPage() { this.InitializeComponent(); #region 判断api是否支持 if (VersionHelper.Windows10Build15063 == true) { Windows.UI.Xaml.Media.AcrylicBrush acrylic = new Windows.UI.Xaml.Media.AcrylicBrush(); acrylic.TintOpacity = 0.5; acrylic.TintColor = Colors.White; acrylic.BackgroundSource = AcrylicBackgroundSource.HostBackdrop; MyTitleBar.Style = (Style)Application.Current.Resources["GridBackgroud"]; DownBackground.Background = acrylic; } else { MyTitleBar.Background = new SolidColorBrush(Color.FromArgb(100, 244, 244, 244)); DownBackground.Background = new SolidColorBrush(Colors.White); } #endregion if (localsettings.Values["_ThisDeviceis"].ToString() == "Mobile") { MyTitleBarVB.Visibility = Visibility.Collapsed; } }
public Seach2Page() { this.InitializeComponent(); #region 判断api是否支持 if (VersionHelper.Windows10Build15063 == true) { Windows.UI.Xaml.Media.AcrylicBrush acrylic = new Windows.UI.Xaml.Media.AcrylicBrush(); acrylic.TintOpacity = 0.5; acrylic.TintColor = Colors.White; acrylic.BackgroundSource = AcrylicBackgroundSource.HostBackdrop; MyTitleBar.Style = (Style)Application.Current.Resources["GridBackgroud"]; SuggestBackgroud.Style = (Style)Application.Current.Resources["GridBackgroud"]; } else { MyTitleBar.Background = new SolidColorBrush(Color.FromArgb(100, 244, 244, 244)); SuggestBackgroud.Background = new SolidColorBrush(Color.FromArgb(100, 244, 244, 244)); } #endregion NavigationCacheMode = NavigationCacheMode.Enabled; SetText(); if (localsettings.Values["_ThisDeviceis"].ToString() == "Mobile") { MyTitleBarVB.Visibility = Visibility.Collapsed; } TagModes = new ObservableCollection <Yande_post_json>(); Tag_yande = new ObservableCollection <CS.Model.Yande_Tage>(); }
private static void ConfigureSnackBar() { UISettings uiSettings = new UISettings(); SnackBarAppearance.Opacity = 1; SnackBarAppearance.Transition = new PopupThemeTransition(); //check for acrylic support if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase") && Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush")) { //Add acrylic. Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.Backdrop; myBrush.TintColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush.FallbackColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush.Opacity = 0.6; myBrush.TintOpacity = 0.5; SnackBarAppearance.BackgroundBrush = myBrush; } else { //fallback to a solid color. SnackBarAppearance.BackgroundBrush = new SolidColorBrush(uiSettings.GetColorValue(UIColorType.Accent)); } }
//TosatModel tosalmodel = new TosatModel(); public LookImg() { this.InitializeComponent(); ResourceLoader resourceLoader = new ResourceLoader(); if (localsettings.Values["_ThisDeviceis"].ToString() == "Mobile") { MyTitleBarVB.Visibility = Visibility.Collapsed; Compact.Visibility = Visibility.Collapsed; } Getsuface(); my_Image = SeeImage; //分享——订阅 dataTransferManager.DataRequested += DataTransferManger_DataRequestedAsync; TagModes = new ObservableCollection <TagMode>(); if (VersionHelper.Windows10Build15063 == true) { Windows.UI.Xaml.Media.AcrylicBrush acrylic = new Windows.UI.Xaml.Media.AcrylicBrush(); MyTitleBar.Style = (Style)Application.Current.Resources["GridBackgroud"]; Kongzhitai.Background = acrylic; } //Toastpopup.DataContext = tosalmodel; //betatext.Text = System.Windows.Forms.Screen.GetWorkingArea(this); }
internal MainPage() { RequestedTheme = SettingsModel.Instance.THEME; InitializeComponent(); #if DEBUG AppBarButton_Remote.Visibility = Visibility.Visible; BtnSound.Visibility = Visibility.Visible; #else AppBarButton_Remote.Visibility = Visibility.Collapsed; BtnSound.Visibility = Visibility.Collapsed; #endif if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.CommandBar", "DefaultLabelPosition")) { CommandbarControl.DefaultLabelPosition = CommandBarDefaultLabelPosition.Right; CommandbarMunchkin.DefaultLabelPosition = CommandBarDefaultLabelPosition.Right; CommandbarOrder.DefaultLabelPosition = CommandBarDefaultLabelPosition.Right; AppBarButton_Settings.LabelPosition = CommandBarLabelPosition.Collapsed; AppBarButton_Add.LabelPosition = CommandBarLabelPosition.Collapsed; } if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush")) { STDAcrylicBrush = new Windows.UI.Xaml.Media.AcrylicBrush() { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Windows.UI.Color.FromArgb(255, 220, 220, 220), TintColor = Windows.UI.Color.FromArgb(200, 220, 220, 220), Opacity = 100, TintOpacity = 90, }; } }
public void SetBarAndStyle() { if (DeviceInfoManager.GetOsVersion() > 15063) { if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase")) { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.FallbackColor = Colors.Transparent; myBrush.TintColor = Color.FromArgb(255, 15, 15, 15); myBrush.TintOpacity = 0.3; SplitViewPane.Background = myBrush; BarGrid.Background = myBrush; Style buttonReveal = (Style)Application.Current.Resources["ButtonRevealStyle"]; Style itemReveal = (Style)Application.Current.Resources["NavMenuItemRevealStyle"]; PaneOpenButton.Style = buttonReveal; NavMenuPrimaryListView.ItemContainerStyle = itemReveal; NavMenuSecondaryListView.ItemContainerStyle = itemReveal; } } CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.ButtonBackgroundColor = Colors.Transparent; titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; titleBar.ButtonForegroundColor = Colors.White; titleBar.ButtonHoverBackgroundColor = Colors.Gray; }
private void SetBcakGroundColor() //设置背景颜色 { try { if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase")) { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Color.FromArgb(255, (byte)BackGroundColorRedSlider.Value, (byte)BackGroundColorGreenSlider.Value, (byte)BackGroundColorBlueSlider.Value); myBrush.FallbackColor = Color.FromArgb(255, (byte)BackGroundColorRedSlider.Value, (byte)BackGroundColorGreenSlider.Value, (byte)BackGroundColorBlueSlider.Value); myBrush.TintOpacity = BackGroundAcrylicBlueSlider.Value / 100; mainGrid.Background = myBrush; } else { SolidColorBrush color = new SolidColorBrush(Color.FromArgb(255, (byte)BackGroundColorRedSlider.Value, (byte)BackGroundColorGreenSlider.Value, (byte)BackGroundColorBlueSlider.Value)); mainGrid.Background = color; //应用背景颜色 if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) { StatusBar statusBar = StatusBar.GetForCurrentView(); statusBar.BackgroundColor = Color.FromArgb(255, (byte)BackGroundColorRedSlider.Value, (byte)BackGroundColorGreenSlider.Value, (byte)BackGroundColorBlueSlider.Value); //statusBar.ForegroundColor = Color.FromArgb(255, (byte)FontColorRedSlider.Value, (byte)FontColorGreenSlider.Value, (byte)FontColorBlueSlider.Value); statusBar.BackgroundOpacity = 1; }//手机状态栏颜色 } } catch { } }
private void Modo_Oscuro_Toggled(object sender, RoutedEventArgs e) { if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase")) { if (this.ts_Modo_Oscuro.IsOn == true) { Windows.UI.Xaml.Media.AcrylicBrush acrilicoOscuro = new Windows.UI.Xaml.Media.AcrylicBrush(); acrilicoOscuro.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; acrilicoOscuro.TintColor = Colors.Black; acrilicoOscuro.FallbackColor = Colors.DimGray; acrilicoOscuro.TintOpacity = 0.4; main_page_obj.Background = acrilicoOscuro; //nav_view_obj.Background = acrilicoOscuro; } else { Windows.UI.Xaml.Media.AcrylicBrush acrilicoBlanco = new Windows.UI.Xaml.Media.AcrylicBrush(); acrilicoBlanco.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; acrilicoBlanco.TintColor = Colors.WhiteSmoke; acrilicoBlanco.FallbackColor = Colors.DimGray; acrilicoBlanco.TintOpacity = 0.4; main_page_obj.Background = acrilicoBlanco; //nav_view_obj.Background = acrilicoBlanco; } } else { SolidColorBrush myBrush = new SolidColorBrush(Color.FromArgb(255, 202, 24, 37)); main_page_obj.Foreground = myBrush; main_page_obj.Background = myBrush; } }
public MainPage() { this.InitializeComponent(); if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush")) { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Color.FromArgb(47, 54, 64, 100); myBrush.FallbackColor = Color.FromArgb(47, 54, 64, 100); myBrush.TintOpacity = 0.2; page.Background = myBrush; } else { SolidColorBrush myBrush = new SolidColorBrush(Color.FromArgb(255, 202, 24, 37)); page.Background = myBrush; } ApplicationViewTitleBar formattableTitleBar = ApplicationView.GetForCurrentView().TitleBar; formattableTitleBar.ButtonBackgroundColor = Colors.Transparent; CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; playButton.Visibility = Visibility.Collapsed; newSession = new ExtendedExecutionForegroundSession(); newSession.Reason = ExtendedExecutionForegroundReason.Unconstrained; newSession.Description = "Long Running Processing"; newSession.Revoked += SessionRevoked; newSession.RequestExtensionAsync().Completed = (e, s) => { switch (e.GetResults()) { case ExtendedExecutionForegroundResult.Allowed: Debug.WriteLine("Extended session allowed"); break; default: case ExtendedExecutionForegroundResult.Denied: Debug.WriteLine("Extended session denied"); break; } }; cts = new CancellationTokenSource(); bgThread = new Thread(new ParameterizedThreadStart(token => { CancellationToken ct = (CancellationToken)token; while (!ct.IsCancellationRequested) { updateTrackInfo(); Thread.Sleep(250); } })); bgThread.Start(cts.Token); StartServer(); }
void SetTheme() { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); if (Settings.Theme == 0) { if (Application.Current.RequestedTheme == ApplicationTheme.Light) { myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Colors.WhiteSmoke; myBrush.FallbackColor = Colors.WhiteSmoke; myBrush.TintOpacity = 0.75; TitleBarColor(Colors.Black, Color.FromArgb(20, 0, 0, 0)); editor.Foreground = new SolidColorBrush(Colors.Black); } else { myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Color.FromArgb(255, 30, 30, 30); myBrush.FallbackColor = Color.FromArgb(255, 30, 30, 30); myBrush.TintOpacity = 0.75; TitleBarColor(Colors.White, Color.FromArgb(20, 255, 255, 255)); editor.Foreground = new SolidColorBrush(Colors.White); } } if (Settings.Theme == 1) { myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Colors.WhiteSmoke; myBrush.FallbackColor = Colors.WhiteSmoke; myBrush.TintOpacity = 0.75; TitleBarColor(Colors.Black, Color.FromArgb(20, 0, 0, 0)); editor.Foreground = new SolidColorBrush(Colors.Black); } if (Settings.Theme == 2) { myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Color.FromArgb(255, 30, 30, 30); myBrush.FallbackColor = Color.FromArgb(255, 30, 30, 30); myBrush.TintOpacity = 0.75; TitleBarColor(Colors.White, Color.FromArgb(20, 255, 255, 255)); editor.Foreground = new SolidColorBrush(Colors.White); } header.Fill = myBrush; }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (DeviceInfoManager.GetOsVersion() > 15063) { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.FallbackColor = Colors.Transparent; myBrush.TintColor = Color.FromArgb(255, 15, 15, 15); myBrush.TintOpacity = 0.3; TitleGrid.Background = myBrush; CreatureGrid.Background = myBrush; //Style style = (Style)Application.Current.Resources["GridViewItemRevealStyle"]; } }
private async void Page_Loaded(object sender, RoutedEventArgs e) //页面加载完毕 { GetSettings(); timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 1); timer.Tick += Timer_Tick; //每秒触发这个事件,以刷新时间 timer.Start(); //开始计时器 var storageFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync( new Uri("ms-appx:///VoiceCommandDictionary.xml")); await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager .InstallCommandDefinitionsFromStorageFileAsync(storageFile); //加载语音字典 Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; //覆盖电脑状态栏 try //加载秒数统计 { long total; total = await GetTotalSecond(); SaveTotalSecond(total); secondTotalShow.Text = $"你已经贡献了{total}秒"; } catch { } if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase")) { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = Color.FromArgb(255, 255, 255, 255); myBrush.FallbackColor = Color.FromArgb(255, 255, 255, 255); myBrush.TintOpacity = 0.3; mainSplitView.Background = myBrush; } }
public ShowCompactPage() { this.InitializeComponent(); CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; #region 判断api是否支持 if (VersionHelper.Windows10Build15063 == true) { Windows.UI.Xaml.Media.AcrylicBrush acrylic = new Windows.UI.Xaml.Media.AcrylicBrush(); acrylic.TintOpacity = 0.5; acrylic.TintColor = Colors.White; acrylic.BackgroundSource = AcrylicBackgroundSource.HostBackdrop; compactbackground.Background = acrylic; } else { compactbackground.Background = new SolidColorBrush(Colors.White); } #endregion }
private static IDisposable AssignAndObserveAcrylicBrush(AcrylicBrush acrylicBrush, Compositor compositor, BrushSetterHandler brushSetter) { var disposables = new CompositeDisposable(); var compositionBrush = compositor.CreateColorBrush(acrylicBrush.FallbackColorWithOpacity); acrylicBrush.RegisterDisposablePropertyChangedCallback( AcrylicBrush.FallbackColorProperty, (s, colorArg) => compositionBrush.Color = acrylicBrush.FallbackColorWithOpacity ) .DisposeWith(disposables); acrylicBrush.RegisterDisposablePropertyChangedCallback( AcrylicBrush.OpacityProperty, (s, colorArg) => compositionBrush.Color = acrylicBrush.FallbackColorWithOpacity ) .DisposeWith(disposables); brushSetter(compositionBrush); return(disposables); }
//string mystring; public hotitempage() { this.InitializeComponent(); #region 判断api是否支持 if (VersionHelper.Windows10Build15063 == true) { Windows.UI.Xaml.Media.AcrylicBrush acrylic = new Windows.UI.Xaml.Media.AcrylicBrush(); acrylic.TintOpacity = 0.5; acrylic.TintColor = Colors.White; acrylic.BackgroundSource = AcrylicBackgroundSource.HostBackdrop; HotGrid.Background = acrylic; } else { HotGrid.Background = new SolidColorBrush(Color.FromArgb(100, 215, 215, 215)); } #endregion progressrin.IsActive = true; if (localsettings.Values["_ThisDeviceis"].ToString() == "Mobile") { MyTitleBarVB.Visibility = Visibility.Collapsed; } if (MTHub.Hotitemvalue != null) { Mygridview.ItemsSource = MTHub.Hotitemvalue; progressrin.IsActive = false; } else { Getjsonstring(hotapiuri, 0); } NavigationCacheMode = NavigationCacheMode.Enabled; #region 理论上依次加载日,周,月,年 //Getjsonstring(); #endregion }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (DeviceInfoManager.GetOsVersion() > 15063) { Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.FallbackColor = Colors.Transparent; myBrush.TintColor = Color.FromArgb(255, 15, 15, 15); myBrush.TintOpacity = 0.3; AboutGrid.Background = myBrush; Color brush = (Color)Application.Current.Resources["SystemAccentColor"]; Windows.UI.Xaml.Media.AcrylicBrush appInfoBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); appInfoBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; appInfoBrush.FallbackColor = Colors.Transparent; appInfoBrush.TintColor = brush; appInfoBrush.TintOpacity = 0.6; AppInfoGrid.Background = appInfoBrush; TitleGrid.Background = appInfoBrush; } }
public Setting2Page() { this.InitializeComponent(); #region 判断api是否支持 if (VersionHelper.Windows10Build15063 == true) { Windows.UI.Xaml.Media.AcrylicBrush acrylic = new Windows.UI.Xaml.Media.AcrylicBrush(); acrylic.TintOpacity = 0.5; acrylic.TintColor = Colors.White; acrylic.BackgroundSource = AcrylicBackgroundSource.HostBackdrop; MyTitleBar.Style = (Style)Application.Current.Resources["GridBackgroud"]; TopGrid.Background = acrylic; } else { MyTitleBar.Background = new SolidColorBrush(Color.FromArgb(100, 244, 244, 244)); TopGrid.Background = new SolidColorBrush(Color.FromArgb(100, 244, 244, 244)); } #endregion if (localsettings.Values["_ThisDeviceis"].ToString() == "Mobile") { MyTitleBarVB.Visibility = Visibility.Collapsed; } tt = new TranslateTransform(); logo.RenderTransform = tt; Window.Current.SetTitleBar(MyTitleBar); Listslider = (int)listslider.Value; //coreTitleBar.ExtendViewIntoTitleBar = false; //DefualtFilebutton.Content = @"默认保存至系统目录的”保存的图片“"; try { FuckMsSlider.ValueChanged += FuckMsSlider_ValueChanged1; } catch { } // themeColors = ThemeColorsAdd.GetThemeColors(); //返回主题数据 Languagelist = Languages.GetLanguages();//返回语言列表 falclass.FallsHub = (int)listslider.Value; //按下默认下载位置的按钮 //opennum.Text = localsettings.Values["_AppOpenNum"].ToString(); if (localsettings.Values["_Fileuri"].ToString() != a.Path) { DefualtFilebutton.IsChecked = true; } if (localsettings.Values["_password"] != null) { Nowpassword.Text = "当前密码是:" + localsettings.Values["_password"].ToString(); Nowpassword.Visibility = Visibility.Visible; } else { Nowpassword.Visibility = Visibility.Collapsed; } }
public static Windows.UI.Xaml.Media.Brush GetViewBackground() { Windows.UI.Xaml.Media.Brush brush = null; if (OperatingData.AcrylicModel) { switch (OperatingData._Theme) { case _Interface_Theme._Green_: brush = new Windows.UI.Xaml.Media.AcrylicBrush() { BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop, TintOpacity = OperatingData.AcrylicOpacity, TintColor = Color.FromArgb(0x7F, 0xAF, 0xF0, 0x00), FallbackColor = Color.FromArgb(0x7F, 0xAF, 0xF0, 0x00) }; break; case _Interface_Theme._Red_: brush = new Windows.UI.Xaml.Media.AcrylicBrush() { BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop, TintOpacity = OperatingData.AcrylicOpacity, TintColor = Color.FromArgb(0xFF, 0xF0, 0xA9, 0xFF), FallbackColor = Color.FromArgb(0xFF, 0xF0, 0xA9, 0xFF) }; break; case _Interface_Theme._White_: brush = new Windows.UI.Xaml.Media.AcrylicBrush() { BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop, TintOpacity = OperatingData.AcrylicOpacity, TintColor = Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC), FallbackColor = Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC) }; break; case _Interface_Theme._Default_: brush = new Windows.UI.Xaml.Media.AcrylicBrush() { BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop, TintOpacity = OperatingData.AcrylicOpacity, TintColor = Color.FromArgb(0xFF, 0x66, 0xCC, 0xFF), FallbackColor = Color.FromArgb(0xFF, 0x66, 0xCC, 0xFF) }; break; } } else { switch (OperatingData._Theme) { case _Interface_Theme._Green_: brush = new Windows.UI.Xaml.Media.SolidColorBrush() { Color = Color.FromArgb(0x7F, 0xAF, 0xF0, 0x00), Opacity = OperatingData.AcrylicOpacity }; break; case _Interface_Theme._Red_: brush = new Windows.UI.Xaml.Media.SolidColorBrush() { Color = Color.FromArgb(0xFF, 0xF0, 0xA9, 0xFF), Opacity = OperatingData.AcrylicOpacity }; break; case _Interface_Theme._White_: brush = new Windows.UI.Xaml.Media.SolidColorBrush() { Color = Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC), Opacity = OperatingData.AcrylicOpacity }; break; case _Interface_Theme._Default_: brush = new Windows.UI.Xaml.Media.SolidColorBrush() { Color = Color.FromArgb(0xFF, 0x66, 0xCC, 0xFF), Opacity = OperatingData.AcrylicOpacity }; break; } } return(brush); }
private void AddUpperTabClick(object sender, RoutedEventArgs e) { string hex = ("0C"); byte a = (byte)(Convert.ToUInt32(hex.Substring(0, 2), 16)); var fill = GetSolidColorBrush("#0C8484").Color; _tabs = FindName("Tabs") as TabView; Windows.UI.Xaml.Media.AcrylicBrush CodeBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); CodeBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; CodeBrush.FallbackColor = Windows.UI.Color.FromArgb(a, 12, 132, 132); CodeBrush.TintColor = Windows.UI.Color.FromArgb(a, 12, 132, 132); CodeBrush.TintOpacity = 0.7f; /* AppBarButton backWeb = new AppBarButton(); * backWeb.Icon = new SymbolIcon(Symbol.Back); * backWeb.LabelPosition = CommandBarLabelPosition.Collapsed; * backWeb.IsEnabled = false; * backWeb.Click += Back_Click; * backWeb.Name = "back" + tabnumber; * * AppBarButton ForwardWeb = new AppBarButton(); * ForwardWeb.Icon = new SymbolIcon(Symbol.Forward); * ForwardWeb.LabelPosition = CommandBarLabelPosition.Collapsed; * ForwardWeb.IsEnabled = false; * ForwardWeb.Click += Forward_Click; * ForwardWeb.Name = "Forward" + tabnumber; * * AppBarButton RefreshWeb = new AppBarButton(); * RefreshWeb.Icon = new SymbolIcon(Symbol.Refresh); * RefreshWeb.LabelPosition = CommandBarLabelPosition.Collapsed; * RefreshWeb.IsEnabled = false; * RefreshWeb.Click += Refresh_Click; * RefreshWeb.Name = "Refresh" + tabnumber; * * CommandBar S = new CommandBar(); * S.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Collapsed; * S.Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(a, 12, 132, 132)); * S.Background = CodeBrush; * S.PrimaryCommands.Add(backWeb); * S.PrimaryCommands.Add(ForwardWeb); * S.PrimaryCommands.Add(RefreshWeb); * * * AutoSuggestBox WebSearcher = new AutoSuggestBox(); * WebSearcher.QueryIcon = new SymbolIcon(Symbol.Find); * WebSearcher.QuerySubmitted += AutoSuggestBox_QuerySubmitted; * WebSearcher.UseSystemFocusVisuals = false; * WebSearcher.Width = 900f; * WebSearcher.Margin = new Thickness(5); * WebSearcher.HorizontalAlignment = HorizontalAlignment.Right; * WebSearcher.Name = "SearchBox" + tabnumber; * * StackPanel commandsHub = new StackPanel(); * commandsHub.Orientation = Orientation.Horizontal; * commandsHub.Children.Add(S); * * commandsHub.Children.Add(WebSearcher); * * AppBarButton ControlSetting = new AppBarButton(); * ControlSetting.LabelPosition = CommandBarLabelPosition.Collapsed; * ControlSetting.Icon = new SymbolIcon(Symbol.Setting); * ControlSetting.Click += AppBarButton_Click; * * AppBarButton CommandSetting = new AppBarButton(); * CommandSetting.Label = "Settings"; * CommandSetting.Icon = new SymbolIcon(Symbol.Setting); * CommandSetting.Click += AppBarButton_Click; * * AppBarButton refresher = new AppBarButton(); * refresher.Label = "Refresh"; * refresher.Icon = new SymbolIcon(Symbol.Refresh); * refresher.Click += Refresh_Click; * refresher.Name = "Re" + tabnumber; * refresher.Visibility = Visibility.Collapsed; * * AppBarButton CopyLink = new AppBarButton(); * refresher.Label = "Copy URL"; * refresher.Icon = new SymbolIcon(Symbol.Copy); * refresher.Click += CopyUrl_Click; * refresher.Name = "CopyUrl" + tabnumber; * refresher.Visibility = Visibility.Collapsed; * * * AppBarSeparator Seperate1 = new AppBarSeparator(); * * AppBarButton Globe = new AppBarButton(); * refresher.Label = "Open in default browser"; * refresher.Icon = new SymbolIcon(Symbol.Globe); * refresher.Click += DefaultBrowser_Click; * refresher.Name = "DefauktBrowser" + tabnumber; * refresher.Visibility = Visibility.Collapsed; * * AppBarButton FavAdd = new AppBarButton(); * refresher.Label = "Add to Home screen"; * refresher.Icon = new SymbolIcon(Symbol.Add); * refresher.Click += Refresh_Click; * refresher.Name = "Favorites" + tabnumber; * refresher.Visibility = Visibility.Collapsed; * * AppBarButton FullViewMode = new AppBarButton(); * refresher.Label = "Fullscreen mode"; * refresher.Icon = new SymbolIcon(Symbol.FullScreen); * refresher.Click += Fullscreen_Click; * refresher.Name = "Fullscreen" + tabnumber; * refresher.Visibility = Visibility.Collapsed; * * AppBarButton BookMarker = new AppBarButton(); * BookMarker.Label = "Save as bookmark"; * BookMarker.Icon = new SymbolIcon(Symbol.Bookmarks); * * * AppBarButton WebShare = new AppBarButton(); * ControlSetting.Label = "Share"; * ControlSetting.Icon = new SymbolIcon(Symbol.Share); * ControlSetting.Click += ShareItem_Click; * * AppBarButton WebFeedback = new AppBarButton(); * ControlSetting.Label = "Feedback"; * ControlSetting.Icon = new SymbolIcon(Symbol.Comment); * ControlSetting.Click += Feedback_Click; * * * * AppBarSeparator Seperate = new AppBarSeparator(); * * * * CommandBar c = new CommandBar(); * c.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Visible; * c.Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(a, 12, 132, 132)); * //c.Background = new SolidColorBrush(Windows.UI.Color.FromArgb(a, 12, 132, 132)); * c.Background = CodeBrush; * c.Content = commandsHub; * c.PrimaryCommands.Add(ControlSetting); * c.SecondaryCommands.Add(refresher); * c.SecondaryCommands.Add(Seperate1); * c.SecondaryCommands.Add(BookMarker); * c.SecondaryCommands.Add(WebShare); * c.SecondaryCommands.Add(WebFeedback); * c.SecondaryCommands.Add(CommandSetting); * c.SecondaryCommands.Add(Seperate); * c.SecondaryCommands.Add(CopyLink); * c.SecondaryCommands.Add(Globe); * c.SecondaryCommands.Add(FavAdd); * c.SecondaryCommands.Add(FullViewMode); * * * //put buttons in correct order * * * * * Grid SearchGrid = new Grid(); * SearchGrid.Children.Add(c); * SearchGrid.Name = "SearchBar" + tabnumber; * * * WebView we = new WebView(); * we.Name = "webView" + tabnumber; * we.NavigationCompleted += OnNavigationCompleted; * we.NavigationStarting += webView_NavigationStarting; * we.NewWindowRequested += OnNewWindowRequested; * we.NavigationFailed += OnNavigationFailed; * we.ContainsFullScreenElementChanged += webView_ContainsFullScreenElementChanged; * * ProgressRing L = new ProgressRing(); * L.Name = "Loading" + tabnumber; * L.HorizontalAlignment = HorizontalAlignment.Center; * L.VerticalAlignment = VerticalAlignment.Center; * L.Visibility = Visibility.Collapsed; * L.IsActive = _isLoading; * * * Grid Gr = new Grid(); * Gr.Children.Add(we); * Gr.Children.Add(SearchGrid); * Gr.Children.Add(L); * Gr.Name = "Grid" + tabnumber;*/ var F = new UserControls.WebControl(); _tabs.Items.Add(new TabViewItem() { Header = "Search " + tabnumber++, Content = F, Icon = new SymbolIcon(Symbol.Find), Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(a, 12, 132, 132)), }); }
public MainPage() { InitializeComponent(); CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; var titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.BackgroundColor = Colors.Transparent; titleBar.InactiveBackgroundColor = Colors.Transparent; titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; titleBar.ButtonBackgroundColor = Colors.Transparent; //titleBar.BackgroundColor = Windows.UI.Color.FromArgb(255, 41, 41, 41); //titleBar.InactiveBackgroundColor = Windows.UI.Color.FromArgb(255, 65, 65, 65); //titleBar.ButtonBackgroundColor = Windows.UI.Color.FromArgb(255, 41, 41, 41); //titleBar.ButtonInactiveBackgroundColor = Windows.UI.Color.FromArgb(255, 65, 65, 65); //titleBar.ButtonHoverBackgroundColor = Windows.UI.Color.FromArgb(255, 65, 65, 65); //titleBar.ButtonHoverForegroundColor = Windows.UI.Color.FromArgb(255, 255, 255, 255); //titleBar.ButtonPressedBackgroundColor = Windows.UI.Color.FromArgb(255, 80, 80, 80); //titleBar.ButtonPressedForegroundColor = Windows.UI.Color.FromArgb(255, 255, 255, 255); var app = new sparkvial_app.App(new SparkVial(new List <InterfaceType> { new MockInterfaceType() })); LoadApplication(app); var masterDetailPage = app.MainPage as Xamarin.Forms.MasterDetailPage; var masterPage = masterDetailPage.Master; var renderer = Platform.GetRenderer(masterPage) as PageRenderer; Console.WriteLine(renderer); var acrylicBrush = new Windows.UI.Xaml.Media.AcrylicBrush() { BackgroundSource = AcrylicBackgroundSource.Backdrop, TintColor = Windows.UI.Color.FromArgb(255, 40, 40, 40), FallbackColor = Windows.UI.Color.FromArgb(255, 40, 40, 40), TintOpacity = 0.6 }; //renderer.Background = acrylicBrush; //var cmdbar = app.MainPage.FindByName<FormsCommandBar>("CommandBar"); //app.PageAppearing += (object sender, Xamarin.Forms.Page e) => { // var cmdBar1 = VisualTreeHelper.GetChild(this, 0); // var cmdBar2 = VisualTreeHelper.GetChild(cmdBar1, 0) as MasterDetailControl; // var cmdBar3 = cmdBar2.Detail.Parent // ; //}; //var cmdBar1 = VisualTreeHelper.GetChild(this, 0) as Canvas; //var cmdBar2 = VisualTreeHelper.GetChild(cmdBar1, 0) as MasterDetailControl; //var styl = new Windows.UI.Xaml.Style(typeof(MasterDetailControl)); //styl.BasedOn = Xamarin.Forms.Platform.UWP.MasterDetailControl; //styl.Setters.Add(new Windows.UI.Xaml.Setter(MasterDetailControl.ToolbarBackgroundProperty, new SolidColorBrush(Windows.UI.Color.FromArgb(255, 127, 0, 64)))); //cmdBar2.Style = styl; //cmdBar2.MasterTitleVisibility = true; //var cmdBar3 = cmdBar2.FindName("SplitView"); //var cmdBar4 = VisualTreeHelper.GetChild(cmdBar2, 0); ; //cmdBar = VisualTreeHelper.GetChild(cmdBar, 0); //cmdBar = VisualTreeHelper.GetChild(cmdBar, 1); //cmdBar = VisualTreeHelper.GetChild(cmdBar, 0); //cmdBar = VisualTreeHelper.GetChild(cmdBar, 0); //cmdBar = VisualTreeHelper.GetChild(cmdBar, 1); //cmdBar = VisualTreeHelper.GetChild(cmdBar, 0); //app.MainPage.BackgroundColor = Xamarin.Forms.Color.Tomato; }
public AppShellView() { this.InitializeComponent(); coreApplicationView = CoreApplication.GetCurrentView(); //if (coreApplicationView != null) // coreApplicationView.TitleBar.ExtendViewIntoTitleBar = true; applicationView = ApplicationView.GetForCurrentView(); applicationView.TitleBar.BackgroundColor = Colors.Transparent; applicationView.TitleBar.ButtonBackgroundColor = Colors.Transparent; applicationView.TitleBar.InactiveBackgroundColor = Colors.Transparent; uiSettings = new Windows.UI.ViewManagement.UISettings(); NavView.SetBinding(Microsoft.UI.Xaml.Controls.NavigationView.MenuItemsSourceProperty, NepApp.CreateBinding(NepApp.UI, nameof(NepApp.UI.NavigationItems))); inlineNavigationService = WindowManager.GetNavigationManagerForCurrentView().RegisterFrameAsNavigationService(InlineFrame, FrameLevel.Two); windowService = WindowManager.GetWindowServiceForCurrentView(); UpdateSelectedNavigationItems(); NepApp.UI.SetNavigationService(inlineNavigationService); inlineNavigationService.Navigated += InlineNavigationService_Navigated; NepApp.UI.SetOverlayParentAndSnackBarContainer(OverlayPanel, snackBarGrid); App.RegisterUIDialogs(); nowPlayingOverlayCoordinator = new AppShellViewModelNowPlayingOverlayCoordinator(this); NavView.SetBinding(Microsoft.UI.Xaml.Controls.NavigationView.HeaderProperty, NepApp.CreateBinding(NepApp.UI, nameof(NepApp.UI.ViewTitle))); NowPlayingButton.SetBinding(Button.DataContextProperty, NepApp.CreateBinding(NepApp.SongManager, nameof(NepApp.SongManager.CurrentSong))); NepApp.MediaPlayer.MediaEngagementChanged += MediaPlayer_MediaEngagementChanged; NepApp.MediaPlayer.IsPlayingChanged += MediaPlayer_IsPlayingChanged; NepApp.UI.Overlay.OverlayedDialogShown += Overlay_DialogShown; NepApp.UI.Overlay.OverlayedDialogHidden += Overlay_DialogHidden; Messenger.AddTarget(this); DeviceInformation.SubplatformChanged += DeviceInformation_SubplatformChanged; if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase") && Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush")) { //Add acrylic. Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush.FallbackColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush.Opacity = 0.6; myBrush.TintOpacity = 0.5; bottomAppBar.Background = myBrush; } else { bottomAppBar.Background = new SolidColorBrush(uiSettings.GetColorValue(UIColorType.Accent)); } }
public XboxShellView() { this.InitializeComponent(); uiSettings = new Windows.UI.ViewManagement.UISettings(); ///Set up navigation inlineNavigationService = WindowManager.GetNavigationManagerForCurrentView().RegisterFrameAsNavigationService(InlineFrame, FrameLevel.Two); NepApp.UI.SetNavigationService(inlineNavigationService); inlineNavigationService.Navigated += InlineNavigationService_Navigated; inlineNavigationService.PreBackRequested += InlineNavigationService_PreBackRequested; PageTitleTextBlock.SetBinding(TextBlock.TextProperty, NepApp.CreateBinding(NepApp.UI, nameof(NepApp.UI.ViewTitle))); nowPlayingOverlayCoordinator = new XboxShellViewModelNowPlayingOverlayCoordinator(this, inlineNavigationService); ///Set up dialogs NepApp.UI.SetOverlayParentAndSnackBarContainer(OverlayPanel, snackBarGrid); App.RegisterUIDialogs(); NepApp.UI.Overlay.OverlayedDialogShown += Overlay_DialogShown; NepApp.UI.Overlay.OverlayedDialogHidden += Overlay_DialogHidden; NepApp.UI.NoChromeStatusChanged += UI_NoChromeStatusChanged; ///Set up media metadata NowPlayingTrackTextBlock.SetBinding(TextBlock.DataContextProperty, NepApp.CreateBinding(NepApp.SongManager, nameof(NepApp.SongManager.CurrentSong))); NowPlayingArtistTextBlock.SetBinding(TextBlock.DataContextProperty, NepApp.CreateBinding(NepApp.SongManager, nameof(NepApp.SongManager.CurrentSong))); NepApp.MediaPlayer.IsPlayingChanged += Media_IsPlayingChanged; //handler to allow the metadata to animate onto the screen for the first time. CurrentMediaMetadataPanel.SetBinding(Control.VisibilityProperty, NepApp.CreateBinding(NepApp.MediaPlayer, nameof(NepApp.MediaPlayer.IsMediaEngaged), binding => { binding.Converter = new Crystal3.UI.Converters.BooleanToVisibilityConverter(); })); ///Set up messaging Messenger.AddTarget(this); SetInlineFrameMarginPaddingForOverflowScrolling(); if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase")) { //Add acrylic. Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.TintColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush.FallbackColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush.Opacity = 0.6; myBrush.TintOpacity = 0.5; HeaderGrid.Background = myBrush; Windows.UI.Xaml.Media.AcrylicBrush myBrush2 = new Windows.UI.Xaml.Media.AcrylicBrush(); myBrush2.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.Backdrop; myBrush2.TintColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush2.FallbackColor = uiSettings.GetColorValue(UIColorType.AccentDark2); myBrush2.Opacity = 0.6; myBrush2.TintOpacity = 0.5; TransportControlGrid.Background = myBrush; TransportControlGrid.BorderBrush = myBrush; } else { HeaderGrid.Background = new SolidColorBrush(uiSettings.GetColorValue(UIColorType.Accent)); TransportControlGrid.Background = new SolidColorBrush(uiSettings.GetColorValue(UIColorType.Accent)); TransportControlGrid.BorderBrush = new SolidColorBrush(uiSettings.GetColorValue(UIColorType.Accent)); } }