internal void HandleFlyoutStatusChange(Flyout flyout, CushWindow parentWindow) { if (flyout == null || parentWindow == null) { return; } ReorderZIndices(flyout); var visibleFlyouts = GetFlyouts(Items).Where(i => i.IsOpen).OrderBy(Panel.GetZIndex); parentWindow.HandleFlyoutStatusChange(flyout, visibleFlyouts); }
private void ReorderZIndices(Flyout lastChanged) { var openFlyouts = GetFlyouts(Items).Where(i => i.IsOpen && i != lastChanged).OrderBy(Panel.GetZIndex); var index = 0; foreach (var openFlyout in openFlyouts) { Panel.SetZIndex(openFlyout, index); index++; } if (lastChanged.IsOpen) { Panel.SetZIndex(lastChanged, index); } }
private void AttachHandlers(Flyout flyout) { var isOpenNotifier = new PropertyChangeNotifier(flyout, Flyout.IsOpenProperty); isOpenNotifier.ValueChanged += FlyoutStatusChanged; flyout.IsOpenPropertyChangeNotifier = isOpenNotifier; var themeNotifier = new PropertyChangeNotifier(flyout, Flyout.ThemeProperty); themeNotifier.ValueChanged += FlyoutStatusChanged; flyout.ThemePropertyChangeNotifier = themeNotifier; }