using CommunityToolkit.Mvvm.Messaging; using Livia.Utility; using System.Windows.Controls; namespace MdpC2.Views.Controls; /// /// Interaction logic for Md_Pc_2Control.xaml /// public partial class MdpC2Control { public MdpC2Control(object viewModel) { InitializeComponent(); DataContext = viewModel; } private void TabSelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender is not TabControl tab) return; //This is also fired on start up, ignore those calls. if (!tab.IsLoaded) return; WeakReferenceMessenger.Default.Send(new RoiTabChangedMessage(tab.SelectedIndex)); } }