| | |
| | | using HMI.Base; |
| | | using HMI.Core.Api; |
| | | using Panuon.WPF.UI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Collections.ObjectModel; |
| | | using System.ComponentModel; |
| | |
| | | |
| | | namespace WPFProject.Controls |
| | | { |
| | | public class TabChangedEventArg |
| | | { |
| | | public IPlugin oldValue { get; set; } |
| | | public IPlugin newValue { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MainTabControl.xaml 的交互逻辑 |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | // Tab切换事件 |
| | | public static readonly RoutedEvent OnTabChangeEvent = |
| | | EventManager.RegisterRoutedEvent("OnTabChange", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MenuTabControl)); |
| | | |
| | | public event RoutedEventHandler OnTabChange |
| | | { |
| | | add |
| | | { |
| | | AddHandler(OnTabChangeEvent, value); |
| | | } |
| | | |
| | | remove |
| | | { |
| | | RemoveHandler(OnTabChangeEvent, value); |
| | | } |
| | | } |
| | | public event EventHandler<TabChangedEventArg> TabChanged; |
| | | |
| | | private ObservableCollection<PluginInfo> _MenuItems; |
| | | |
| | |
| | | { |
| | | page.Child = (UIElement)content; |
| | | } |
| | | TabChanged?.Invoke(this, new TabChangedEventArg { oldValue = last, newValue = newPlugin }); |
| | | } |
| | | } |
| | | |