using System.Windows; using System.Windows.Controls; using CommunityToolkit.Mvvm.Messaging; using Livia.Models.Data; using Livia.Utility; using Livia.ViewModels; using Livia.Views.Utility; namespace Livia.Views.Controls; /// /// Interaction logic for MosaicImageGroupControl.xaml /// public partial class MosaicImageGroupControl { public MosaicImageGroupControl() { InitializeComponent(); } private void ToggleButtonOnChecked(object sender, RoutedEventArgs e) { MosaicImageData? data = ViewUtility.GetDataContextFromSender(sender); if (data == null || DataContext is not MosaicImageGroupControlViewModel viewModel) return; viewModel.SetSelectedMosaicImage(data); } private void PerfusionDataGridJumpButtonOnClick(object sender, RoutedEventArgs e) { if (sender is not Button button) return; if (button.DataContext is not MosaicImageData data) return; WeakReferenceMessenger.Default.Send(new PerfusionDataGridChangeParameterMessage(data.DisplayName, true)); } }