public override void RaiseAutomationPropertyChangedEvent(AutomationPropertyChangedEventArgs e) { if (editableTextExpert.RaiseAutomationPropertyChangedEvent(e)) { return; } base.RaiseAutomationPropertyChangedEvent(e); }
public override void RaiseAutomationPropertyChangedEvent(AutomationPropertyChangedEventArgs e) { if (editableTextExpert.RaiseAutomationPropertyChangedEvent(e)) { return; } if (e.Property == AutomationElementIdentifiers.HasKeyboardFocusProperty) { bool focused = (bool)e.NewValue; Adapter parentAdapter = (Adapter)Parent; if (parentAdapter is List) { ((List)parentAdapter).HandleItemFocus(this, focused); return; } parentAdapter.NotifyStateChange(Atk.StateType.Focused, focused); if (focused) { Atk.Focus.TrackerNotify(parentAdapter); } } else if (e.Property == TogglePatternIdentifiers.ToggleStateProperty) { NotifyStateChange(Atk.StateType.Checked, IsChecked((ToggleState)e.NewValue)); } else if (e.Property == AutomationElementIdentifiers.IsTogglePatternAvailableProperty) { if ((bool)e.NewValue == true) { toggleProvider = (IToggleProvider)Provider.GetPatternProvider(TogglePatternIdentifiers.Pattern.Id); actionExpert.Add("toggle", "toggle", null, DoToggle); } else { toggleProvider = null; actionExpert.Remove("toggle"); } } else { base.RaiseAutomationPropertyChangedEvent(e); } }
public override void RaiseAutomationPropertyChangedEvent(AutomationPropertyChangedEventArgs e) { if (editableTextExpert.RaiseAutomationPropertyChangedEvent(e) || textExpert.RaiseAutomationPropertyChangedEvent(e)) { return; } if (e.Property == AutomationElementIdentifiers.HasKeyboardFocusProperty) { bool focused = (bool)e.NewValue; Adapter parentAdapter = (Adapter)Parent; if (parentAdapter is Tree) { ((Tree)parentAdapter).HandleItemFocus(this, focused); return; } if (parentAdapter is DataGrid) { ((DataGrid)parentAdapter).HandleItemFocus(this, focused); return; } parentAdapter.NotifyStateChange(Atk.StateType.Focused, focused); if (focused) { Atk.Focus.TrackerNotify(parentAdapter); } } else if (e.Property == TogglePatternIdentifiers.ToggleStateProperty) { NotifyStateChange(Atk.StateType.Checked, IsChecked((ToggleState)e.NewValue)); } else if (e.Property == AutomationElementIdentifiers.IsTogglePatternAvailableProperty) { if ((bool)e.NewValue == true) { actionExpert.Add("toggle", "toggle", null, DoToggle); } else { actionExpert.Remove("toggle"); } } else if (e.Property == ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty) { ExpandCollapseState oldValue = (ExpandCollapseState)e.OldValue; ExpandCollapseState newValue = (ExpandCollapseState)e.NewValue; if (oldValue == ExpandCollapseState.LeafNode || newValue == ExpandCollapseState.LeafNode) { NotifyStateChange(Atk.StateType.Expandable, (newValue != ExpandCollapseState.LeafNode)); } if (oldValue == ExpandCollapseState.Expanded || newValue == ExpandCollapseState.Expanded) { bool expanded = (newValue == ExpandCollapseState.Expanded); NotifyStateChange(Atk.StateType.Expanded, expanded); ((Tree)Parent).NotifyRowAdjusted(this, expanded); } } else { base.RaiseAutomationPropertyChangedEvent(e); } }