Пример #1
0
        /// <summary>
        /// Transitions the button into the appropriate check state.
        /// </summary>
        private void UpdateCheckState()
        {
            var isChecked = IsChecked;

            if (isChecked.HasValue)
            {
                if (isChecked.Value)
                {
                    VisualStateGroups.GoToState("checkstate", "checked");
                }
                else
                {
                    VisualStateGroups.GoToState("checkstate", "unchecked");
                }
            }
            else
            {
                VisualStateGroups.GoToState("checkstate", "indeterminate");
            }
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToggleButton"/> class.
 /// </summary>
 /// <param name="uv">The Ultraviolet context.</param>
 /// <param name="name">The element's identifying name within its namescope.</param>
 public ToggleButton(UltravioletContext uv, String name)
     : base(uv, name)
 {
     VisualStateGroups.Create("checkstate", new[] { "unchecked", "checked", "indeterminate" });
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Thumb"/> class.
 /// </summary>
 /// <param name="uv">The Ultraviolet context.</param>
 /// <param name="name">The element's identifying name within its namescope.</param>
 public Thumb(UltravioletContext uv, String name)
     : base(uv, name)
 {
     VisualStateGroups.Create("common", new[] { "normal", "hover", "pressed", "disabled" });
 }