Inheritance: ComponentParentAdapter
Example #1
0
		public override void RaiseAutomationPropertyChangedEvent (System.Windows.Automation.AutomationPropertyChangedEventArgs e)
		{
			if (e.Property.Id != ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty.Id) {
				base.RaiseAutomationPropertyChangedEvent (e);
				return;
			}

			ExpandCollapseState newState = (ExpandCollapseState)e.NewValue;
			if (newState == ExpandCollapseState.Expanded) {
				if (fakeWindow == null) {
					fakeWindow = new DropDownWindow ();
					fakeWindow.AddOneChild ((Adapter)RefAccessibleChild (0));
				}
				TopLevelRootItem.Instance.AddOneChild (fakeWindow);
				TopLevelRootItem.Instance.CheckAndHandleNewActiveWindow (fakeWindow);
			} else if (newState == ExpandCollapseState.Collapsed) {
				Atk.Object realWindow = this;
				while (realWindow != null && !(realWindow is Window))
					realWindow = realWindow.Parent;
				if (realWindow != null)
					TopLevelRootItem.Instance.CheckAndHandleNewActiveWindow (fakeWindow, (Window)realWindow);
				TopLevelRootItem.Instance.RemoveChild (fakeWindow, false);
			}
			InnerMenu.RaiseExpandedCollapsed ();
		}
Example #2
0
		internal void WindowDeactivated (Window win)
		{
			if (object.ReferenceEquals (currentActiveWindow, win))
				currentActiveWindow = null;
		}