private void ContextMenu_Click(object sender, EventArgs e) { ((Window)this.GetVisualRoot()).Focus(); IInteractive item = ((RoutedEventArgs)e).Source; if (item.GetType() == typeof(MenuItem)) { Track.Get(_chain)?.Window?.Selection.Action((string)((MenuItem)item).Header); } }
void ActionContextMenu_Click(object sender, EventArgs e) { ((Window)this.GetVisualRoot()).Focus(); IInteractive item = ((RoutedEventArgs)e).Source; if (item.GetType() == typeof(MenuItem)) { Action?.Invoke((string)((MenuItem)item).Header); } }
private void DeviceContextMenu_Click(object sender, EventArgs e) { ((Window)this.GetVisualRoot()).Focus(); IInteractive item = ((RoutedEventArgs)e).Source; if (item.GetType() == typeof(MenuItem)) { Device_Action((string)((MenuItem)item).Header, sender == DeviceContextMenuAfter); } }
void AddContextMenu_Click(object sender, EventArgs e) { ((Window)this.GetVisualRoot()).Focus(); IInteractive item = ((RoutedEventArgs)e).Source; if (item.GetType() == typeof(MenuItem)) { Added?.Invoke(Assembly.GetExecutingAssembly().GetType($"Apollo.Devices.{((string)((MenuItem)item).Header).Replace(" ", "")}")); } }
void TrackContextMenu_Click(object sender, EventArgs e) { this.Focus(); IInteractive item = ((RoutedEventArgs)e).Source; if (item.GetType() == typeof(MenuItem)) { Track_Action((string)((MenuItem)item).Header, true); } }