Esempio n. 1
0
		public override void OnRefStateSet (ref Atk.StateSet states)
		{
			IExpandCollapseProvider expandCollapse
				= peer.GetPattern (PatternInterface.ExpandCollapse)
					as IExpandCollapseProvider;
			if (expandCollapse != null) {
				var state = expandCollapse.ExpandCollapseState;

				// If it's not a leaf, it can be expanded
				if (state != ExpandCollapseState.LeafNode)
					states.AddState (Atk.StateType.Expandable);

				if (state == ExpandCollapseState.Expanded
				    || state == ExpandCollapseState.PartiallyExpanded)
					states.AddState (Atk.StateType.Expanded);
				else
					states.RemoveState (Atk.StateType.Expanded);
			}

			IToggleProvider toggle
				= peer.GetPattern (PatternInterface.Toggle)
					as IToggleProvider;
			if (toggle != null) {
				states.RemoveState (Atk.StateType.Checked);
				states.RemoveState (Atk.StateType.Indeterminate);

				var state = toggle.ToggleState;
				if (state == ToggleState.On)
					states.AddState (Atk.StateType.Checked);
				else if (state == ToggleState.Indeterminate)
					states.AddState (Atk.StateType.Indeterminate);
			}
		}
Esempio n. 2
0
		public override void OnRefStateSet (ref Atk.StateSet states)
		{
			bool? isSelected = IsSelected;
			if (!isSelected.HasValue)
				return;

			states.AddState (Atk.StateType.Selectable);

			if (isSelected.Value)
				states.AddState (Atk.StateType.Selected);
			else
				states.RemoveState (Atk.StateType.Selected);
		}
Esempio n. 3
0
		public override void OnRefStateSet (ref Atk.StateSet states)
		{
			var selectionItem = peer.GetPattern (
				PatternInterface.SelectionItem)
					as ISelectionItemProvider;
			if (selectionItem == null)
				return;

			if (selectionItem.IsSelected)
				states.AddState (Atk.StateType.Checked);
			else
				states.RemoveState (Atk.StateType.Checked);
		}
		public void UpdateStates (Atk.StateSet states)
		{
			if (Editable)
				states.AddState (Atk.StateType.Editable);
			else
				states.RemoveState (Atk.StateType.Editable);
		}
Esempio n. 5
0
		public override void OnRefStateSet (ref Atk.StateSet states)
		{
			if (valueProvider.IsReadOnly)
				states.RemoveState (Atk.StateType.Editable);
			else
				states.AddState (Atk.StateType.Editable);
		}