public MetroExpander()
        {
            Utility.Refresh(this);

            Loaded += delegate
            {
                if (Content == null)
                {
                    IsExpanded = false;
                }
                else if (!CanHide)
                {
                    IsExpanded = true;
                }
                ElementBase.GoToState(this, IsExpanded ? "StartExpand" : "StartNormal");
            };

            CommandBindings.Add(new CommandBinding(ButtonClickCommand, delegate
            {
                if (CanHide && Content != null)
                {
                    IsExpanded = !IsExpanded;
                }
                if (Click != null)
                {
                    Click(this, null);
                }
            }));
        }
Exemplo n.º 2
0
 public AduTabControl()
 {
     Loaded           += delegate { ElementBase.GoToState(this, "SelectionLoaded"); };
     SelectionChanged += delegate(object sender, SelectionChangedEventArgs e) { if (e.Source is AduTabControl)
                                                                                {
                                                                                    SelectionState();
                                                                                }
     };
 }
Exemplo n.º 3
0
 public MetroSwitch()
 {
     Loaded += delegate { ElementBase.GoToState(this, IsOpen ? "OpenLoaded" : "CloseLoaded"); };
     Click  += delegate { IsOpen = !IsOpen; if (StateChanged != null)
                          {
                              StateChanged(this, null);
                          }
     };
 }
Exemplo n.º 4
0
 public MetroTabControl()
 {
     Loaded           += delegate { ElementBase.GoToState(this, "SelectionLoaded"); };
     SelectionChanged += delegate(object sender, SelectionChangedEventArgs e) { if (e.Source is MetroTabControl)
                                                                                {
                                                                                    SelectionState();
                                                                                }
     };
     Utility.Refresh(this);
 }
Exemplo n.º 5
0
        public MetroMenuTabControl()
        {
            Loaded           += delegate { GoToState(); ElementBase.GoToState(this, IconMode ? "SelectionLoadedIconMode" : "SelectionLoaded"); };
            SelectionChanged += delegate(object sender, SelectionChangedEventArgs e) { if (e.Source is MetroMenuTabControl)
                                                                                       {
                                                                                           SelectionState();
                                                                                       }
            };
            CommandBindings.Add(new CommandBinding(IconModeClickCommand, delegate { IconMode = !IconMode; GoToState(); }));

            Utility.Refresh(this);
        }
Exemplo n.º 6
0
 void SelectionState()
 {
     if (IconMode)
     {
         ElementBase.GoToState(this, "SelectionStartIconMode");
         ElementBase.GoToState(this, "SelectionEndIconMode");
     }
     else
     {
         ElementBase.GoToState(this, "SelectionStart");
         ElementBase.GoToState(this, "SelectionEnd");
     }
 }
Exemplo n.º 7
0
 void GoToState()
 {
     ElementBase.GoToState(this, IsSubWindowShow ? "Enabled" : "Disable");
 }
Exemplo n.º 8
0
 void GoToState()
 {
     ElementBase.GoToState(this, IconMode ? "EnterIconMode" : "ExitIconMode");
 }
Exemplo n.º 9
0
 void SelectionState()
 {
     ElementBase.GoToState(this, "SelectionStart");
     ElementBase.GoToState(this, "SelectionEnd");
 }
Exemplo n.º 10
0
 protected override void OnUnchecked(RoutedEventArgs e)
 {
     base.OnChecked(e);
     ElementBase.GoToState(this, "Close");
 }
Exemplo n.º 11
0
 public MetroSwitch()
 {
     Loaded += delegate { ElementBase.GoToState(this, (bool)IsChecked ? "OpenLoaded" : "CloseLoaded"); };
 }
Exemplo n.º 12
0
 void GoToState()
 {
     ElementBase.GoToState(this, IsOpen ? "Open" : "Close");
 }
Exemplo n.º 13
0
 public MiToggleButton()
 {
     EAStyles.Controls.ControlUtility.Refresh(this);
     Loaded += delegate { ElementBase.GoToState(this, (bool)IsChecked ? "OpenLoaded" : "CloseLoaded"); };
 }