示例#1
0
 /// <summary>
 /// Transitions the thumb into the appropriate common state.
 /// </summary>
 private void UpdateCommonState()
 {
     if (IsEnabled)
     {
         if (IsDragging)
         {
             VisualStateGroups.GoToState("common", "pressed");
         }
         else
         {
             if (IsMouseOver)
             {
                 VisualStateGroups.GoToState("common", "hover");
             }
             else
             {
                 VisualStateGroups.GoToState("common", "normal");
             }
         }
     }
     else
     {
         VisualStateGroups.GoToState("common", "disabled");
     }
 }
示例#2
0
        /// <summary>
        /// Transitions the combo box into the appropriate visual states.
        /// </summary>
        private void UpdateVisualState()
        {
            if (IsEnabled)
            {
                if (IsMouseOver)
                {
                    VisualStateGroups.GoToState("common", "hover");
                }
                else
                {
                    VisualStateGroups.GoToState("common", "normal");
                }
            }
            else
            {
                VisualStateGroups.GoToState("common", "disabled");
            }

            if (IsDropDownOpen)
            {
                VisualStateGroups.GoToState("opened", "open");
            }
            else
            {
                VisualStateGroups.GoToState("opened", "closed");
            }
        }
示例#3
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");
            }
        }