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);
                }
            }));
        }
Esempio n. 2
0
 public AduTabControl()
 {
     Loaded           += delegate { ElementBase.GoToState(this, "SelectionLoaded"); };
     SelectionChanged += delegate(object sender, SelectionChangedEventArgs e) { if (e.Source is AduTabControl)
                                                                                {
                                                                                    SelectionState();
                                                                                }
     };
 }
Esempio n. 3
0
 public MetroSwitch()
 {
     Loaded += delegate { ElementBase.GoToState(this, IsOpen ? "OpenLoaded" : "CloseLoaded"); };
     Click  += delegate { IsOpen = !IsOpen; if (StateChanged != null)
                          {
                              StateChanged(this, null);
                          }
     };
 }
Esempio 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);
 }
Esempio 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);
        }
Esempio n. 6
0
 void SelectionState()
 {
     if (IconMode)
     {
         ElementBase.GoToState(this, "SelectionStartIconMode");
         ElementBase.GoToState(this, "SelectionEndIconMode");
     }
     else
     {
         ElementBase.GoToState(this, "SelectionStart");
         ElementBase.GoToState(this, "SelectionEnd");
     }
 }
Esempio n. 7
0
 void GoToState()
 {
     ElementBase.GoToState(this, IsSubWindowShow ? "Enabled" : "Disable");
 }
Esempio n. 8
0
 void GoToState()
 {
     ElementBase.GoToState(this, IconMode ? "EnterIconMode" : "ExitIconMode");
 }
Esempio n. 9
0
 void SelectionState()
 {
     ElementBase.GoToState(this, "SelectionStart");
     ElementBase.GoToState(this, "SelectionEnd");
 }
Esempio n. 10
0
 protected override void OnUnchecked(RoutedEventArgs e)
 {
     base.OnChecked(e);
     ElementBase.GoToState(this, "Close");
 }
Esempio n. 11
0
 public MetroSwitch()
 {
     Loaded += delegate { ElementBase.GoToState(this, (bool)IsChecked ? "OpenLoaded" : "CloseLoaded"); };
 }
Esempio n. 12
0
 void GoToState()
 {
     ElementBase.GoToState(this, IsOpen ? "Open" : "Close");
 }
Esempio n. 13
0
 public MiToggleButton()
 {
     EAStyles.Controls.ControlUtility.Refresh(this);
     Loaded += delegate { ElementBase.GoToState(this, (bool)IsChecked ? "OpenLoaded" : "CloseLoaded"); };
 }