private static RadialMenuItemStyleSetSpecs ApplyStyle(params RadialMenuItemStyleSetSpecs[] args) { var output = new RadialMenuItemStyleSetSpecs(); foreach (var s in args) { if (s == null) { continue; } ApplyStyle(output.Base, s.Base); ApplyStyle(output.Active, s.Active); } ApplyStyle(output.Active, output.Base, true); return(output); }
public CustomRadialMenuItem(RadialMenuItemSpecs specs, RadialMenuItemStyleSetSpecs defaultStyle) : this() { KeyCommand = specs.KeyCommand; Command = new RelayCommand(() => { // Press key App.Instance.InputSimulator.SimulateKeyPress(KeyCommand); // Collapse menu/window var window = Window.GetWindow(this); if (!(window is RadialMenuWindow)) { return; } var radialMenuwindow = (RadialMenuWindow)window; radialMenuwindow.SetVisibility(false); }); StyleSetSpecs = ApplyStyle(App.Instance.Config.Layout.DefaultRadialMenuItemStyle, defaultStyle, specs.Style); }