private static void OnIsFullscreenOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FullscreenVisual f = (FullscreenVisual)d; if ((bool)e.NewValue) { if (f.LastActiveComponent != null) { f.LastActiveComponent.IsFullscreen = true; } } else { if (f.LastActiveComponent != null) { f.LastActiveComponent.IsFullscreen = false; } f.ActiveComponent = null; } if (f.Open != null) { f.Open.Invoke(f, new EventArgs()); } f.OnPropertyChanged("ActivePresentation"); }
private static void OnActiveComponentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FullscreenVisual f = (FullscreenVisual)d; ComponentVisual newBin = (ComponentVisual)e.NewValue; ComponentVisual oldBin = (ComponentVisual)e.OldValue; if (newBin != null) { newBin.IsActive = true; newBin.IsFullscreen = true; } if (oldBin != null) { f.LastActiveComponent = oldBin; if (oldBin != newBin) { oldBin.IsFullscreen = false; oldBin.IsActive = false; } } f.OnPropertyChanged("HasComponentPresentation"); f.OnPropertyChanged("HasComponentSetting"); f.OnPropertyChanged("ActivePresentation"); }