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