RyLiveTools/Source/Content/LeftMainContent.xaml.cs
如果当时 0ec1400de9 ### 2024-04-12更新
------
####  V1.0.2404.1201
- 新增支持手动运行规则。
- 规则播放时间间隔不再针对全局声效,而只针对当前规则声效。
- 修复规则中播放文件夹可能导致无法执行的BUG。
- 修复规则不勾选礼物和点赞,则无法执行的BUG。
2024-04-13 10:13:30 +08:00

65 lines
2.0 KiB
C#

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
{
/// <summary>
/// LeftMainContent.xaml 的交互逻辑
/// </summary>
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<string>("login");
WeakReferenceMessenger.Default.Send<MsgToken>(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<string>(str);
}
}
}
}