WIn_RustTools/RustTools/Views/ConcernPage.xaml.cs

73 lines
1.7 KiB
C#
Raw Permalink Normal View History

using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using RustTools.muqing;
using RustTools.ViewModels;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace RustTools.Views;
/// <summary>
/// <20><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>
/// </summary>
public sealed partial class ConcernPage : Page
{
2024-08-15 01:40:33 +00:00
public ConcernViewModel ViewModels
{
get; set;
}
public ConcernPage()
{
ViewModels = App.GetService<ConcernViewModel>();
InitializeComponent();
2024-08-13 14:00:12 +00:00
//<2F><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>½
if (false)
{
}
}
private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
{
var height = ActualHeight; // ȷ<><C8B7>ʹ<EFBFBD><CAB9>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>ʵ<EFBFBD>ʸ߶<CAB8>
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>ֵ
if (!double.IsNaN(height) && !double.IsInfinity(height) && height > 16)
{
ListViewA.Height = height - 36;
ListViewB.Height = height - 16;
}
else
{
ListViewA.Height = 500; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>Ĭ<EFBFBD><C4AC>ֵ
ListViewB.Height = 500; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>Ĭ<EFBFBD><C4AC>ֵ
}
}
private void ItemsView_ItemInvoked(ItemsView sender, ItemsViewItemInvokedEventArgs args)
{
gj.sc("You invoked ");
}
private void ListViewA_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// <20><>ȡ<EFBFBD><C8A1>ǰѡ<C7B0>е<EFBFBD><D0B5><EFBFBD>Ŀ
var selectedItem = ListViewA.SelectedItem;
gj.sc(selectedItem);
}
private void ListViewA_Loaded(object sender, RoutedEventArgs e)
{
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
if (ListViewA.Items.Count > 0)
{
ListViewA.SelectedIndex = 0;
}
}
}