using CommunityToolkit.Mvvm.Messaging.Messages; using CommunityToolkit.Mvvm.Messaging; using HandyControl.Controls; using HandyControl.Tools.Extension; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using LiveTools.Data; namespace LiveTools.Content { /// /// LeftMainContent.xaml 的交互逻辑 /// public partial class LeftMainContent { public LeftMainContent() { InitializeComponent(); } private void ButtonAscending_OnClick(object sender, RoutedEventArgs e) { if (sender is ToggleButton button && button.Tag is ItemsControl itemsControl) { if (button.IsChecked == true) { itemsControl.Items.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); } else { itemsControl.Items.SortDescriptions.Clear(); } } } private void Border_Loaded(object sender, RoutedEventArgs e) { WeakReferenceMessenger.Default.Send("login"); WeakReferenceMessenger.Default.Send(new MsgToken("") { ID = MsgTokenId.Login, From = "LeftMain", Msg = "222" }); } private void ListViewItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var item= (ListViewItem)sender; if (item.Tag is string str) { WeakReferenceMessenger.Default.Send(str); } } } }