private void VmOnPropertyChanged(object sender, PropertyChangedEventArgs args) { if (args.PropertyName == "MenuPaneState") { var paneState = (sender as MainViewModel).MenuPaneState; _paneState = paneState; HamburgerControl.Width = _paneState ? 250 : 48; HamburgerTopGrid.Width = _paneState ? 250 : 48; } else if (args.PropertyName == "OffContentVisibility") { SplitterColumn.Width = new GridLength(ViewModelLocator.GeneralMain.OffContentVisibility ? 16 : 0); } else if (args.PropertyName == nameof(ViewModelLocator.GeneralMain.AdsContainerVisibility)) { if (ViewModelLocator.GeneralMain.AdsContainerVisibility) { AdControl.Resume(); } else { AdControl.Suspend(); } } }
private void VmOnPropertyChanged(object sender, PropertyChangedEventArgs args) { if (args.PropertyName == "MenuPaneState") { var paneState = (sender as MainViewModel).MenuPaneState; _paneState = paneState; HamburgerControl.Width = paneState ? 250 : 48; HamburgerTopGrid.Width = paneState ? 250 : 48; TitleBarLeft.Margin = new Thickness(Math.Max(_paneState ? 250 : 48, CoreApplication.GetCurrentView().TitleBar.SystemOverlayLeftInset), 0, 0, 0); } else if (args.PropertyName == "OffContentVisibility") { SplitterColumn.Width = new GridLength(ViewModelLocator.GeneralMain.OffContentVisibility ? 16 : 0); var width = ViewModelLocator.GeneralMain.OffContentVisibility ? (DataContext as MainViewModel).OffContentStatusBarWidth + 16 : 0; TitleBarRight.Margin = new Thickness(0, 0, Math.Max(width, CoreApplication.GetCurrentView().TitleBar.SystemOverlayRightInset), 0); } else if (args.PropertyName == nameof(ViewModelLocator.GeneralMain.AdsContainerVisibility)) { if (ViewModelLocator.GeneralMain.AdsContainerVisibility) { AdControl.Resume(); } else { AdControl.Suspend(); } } }
private void GeneralMainOnPropertyChanged(object sender, PropertyChangedEventArgs args) { if (args.PropertyName == nameof(ViewModelLocator.GeneralMain.AdsContainerVisibility)) { if (ViewModelLocator.GeneralMain.AdsContainerVisibility) { AdControl.Resume(); } else { AdControl.Suspend(); } } }
private void StartAdsTimeMeasurements() { var day = ResourceLocator.ApplicationDataService["AdsCurrentDay"]; if (day != null) { if ((int)day != DateTime.Today.DayOfYear) { ResourceLocator.ApplicationDataService["AdsTimeToday"] = 0; } } ResourceLocator.ApplicationDataService["AdsCurrentDay"] = DateTime.Today.DayOfYear; if (Settings.AdsEnable) { _timer = new Timer(AdTimerCallback, null, 0, 10000); ViewModelLocator.GeneralMain.AdsContainerVisibility = true; } else { AdControl.Suspend(); } }
public void Stop_Ads() { adControl_X_L.Suspend(); adControl_X_P.Suspend(); }