using ApplicationAvalonia.ViewModels; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.Primitives; using Avalonia.Markup.Xaml; using System; namespace ApplicationAvalonia.Views; public partial class HomeView : UserControl { public HomeView() { InitializeComponent(); } private void ToggleButton_Checked_1(object? sender, Avalonia.Interactivity.RoutedEventArgs e) { var some = (ToggleButton)sender; var myParametr = some.CommandParameter; HomeViewModel.TakeCategory(Convert.ToInt32(myParametr)); } private void ToggleButton_Unchecked_2(object? sender, Avalonia.Interactivity.RoutedEventArgs e) { var some = (ToggleButton)sender; var myParametr = some.CommandParameter; HomeViewModel.TakeCategory(Convert.ToInt32(myParametr)); } }