livia-test/MdpC6/Views/Controls/MdpC6Control.xaml.cs
2025-03-28 14:31:53 +08:00

29 lines
715 B
C#

using CommunityToolkit.Mvvm.Messaging;
using Livia.Utility;
using System.Windows.Controls;
namespace MdpC6.Views.Controls;
/// <summary>
/// Interaction logic for Md_Pc_2Control.xaml
/// </summary>
public partial class MdpC6Control
{
public MdpC6Control(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));
}
}