public ExtendedSplash(SplashScreen splashscreen, bool loadState) { InitializeComponent(); AppTheme = DataShareManager.Current.AppTheme; if (InformationHelper.IsMobile) { //StatusBarHelper.ShowStatusBar(AppTheme == ElementTheme.Dark); } else { StatusBarHelper.ShowStatusBar(AppTheme == ElementTheme.Dark); } // Listen for window resize events to reposition the extended splash screen image accordingly. // This ensures that the extended splash screen formats properly in response to window resizing. Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize); 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); // Retrieve the window coordinates of the splash screen image. splashImageRect = splash.ImageLocation; ScaleFactor = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; PositionElement(); } PrepareSDK(); }
public MasterDetailPageViewModel() { AppTheme = DataShareManager.Current.AppTheme; User = DataShareManager.Current.User; StatusBarHelper.ShowStatusBar(AppTheme == ElementTheme.Dark); DataShareManager.Current.DataChanged += Current_DataChanged; }
/// <summary> /// 切换日夜间模式 /// </summary> public void DayNightMode() { if (AppTheme == ElementTheme.Dark) { DataShareManager.Current.UpdateAppTheme(ElementTheme.Light); StatusBarHelper.ShowStatusBar(false); } else { DataShareManager.Current.UpdateAppTheme(ElementTheme.Dark); StatusBarHelper.ShowStatusBar(true); } }