2024-12-06 01:26:57 +00:00
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Diagnostics;
|
2024-08-03 11:49:28 +00:00
|
|
|
|
using Microsoft.UI.Xaml;
|
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
2024-12-06 01:26:57 +00:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using RustTools.DataList;
|
2024-08-03 11:49:28 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
2024-12-06 01:26:57 +00:00
|
|
|
|
public ObservableCollection<CommunityList.Data> communitylist = new();
|
|
|
|
|
public ObservableCollection<MovingInfo.Data> MovingInfoList = new();
|
|
|
|
|
private bool IsLogin = false;
|
2024-08-03 11:49:28 +00:00
|
|
|
|
public ConcernPage()
|
|
|
|
|
{
|
|
|
|
|
ViewModels = App.GetService<ConcernViewModel>();
|
|
|
|
|
InitializeComponent();
|
2024-08-13 14:00:12 +00:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>½
|
2024-12-06 01:26:57 +00:00
|
|
|
|
|
|
|
|
|
Init();
|
|
|
|
|
if (IsLogin)
|
2024-08-13 14:00:12 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2024-08-03 11:49:28 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-12-06 01:26:57 +00:00
|
|
|
|
private async void Init()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var ini = new IniHelper();
|
|
|
|
|
ini.Load(IniHelper.FILE.User);
|
|
|
|
|
var account = ini.GetValue(IniHelper.CODE.User, IniHelper.KEY.account);
|
|
|
|
|
var value = await ApiFox.community.getList(account, true, 0);
|
|
|
|
|
//Debug.WriteLine(value);
|
|
|
|
|
if (value == string.Empty) return;
|
|
|
|
|
var response = JsonConvert.DeserializeObject<CommunityList>(value);
|
|
|
|
|
var a = new CommunityList.Data
|
|
|
|
|
{
|
|
|
|
|
UserName = "ȫ<><C8AB>",
|
|
|
|
|
HeadIcon = "/Assets/tool.png"
|
|
|
|
|
};
|
|
|
|
|
communitylist.Add(a);
|
|
|
|
|
foreach (var item in response.data)
|
|
|
|
|
{
|
|
|
|
|
//item.UserName
|
|
|
|
|
item.HeadIcon = item.HeadIcon.Replace("..", wl.api);
|
|
|
|
|
communitylist.Add(item);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-06 01:29:28 +00:00
|
|
|
|
if (ListViewA.Items.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
ListViewA.SelectedIndex = 0;
|
|
|
|
|
}
|
2024-12-06 01:26:57 +00:00
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
Debug.WriteLine(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ÿ<><C3BF><EFBFBD><EFBFBD>ע<EFBFBD>Ķ<EFBFBD>̬<EFBFBD><CCAC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void dongtaixiaoxi()
|
|
|
|
|
{
|
|
|
|
|
MovingInfoList.Clear();
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("<22>Ѿ<EFBFBD><D1BE><EFBFBD>д<EFBFBD><D0B4>"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-08-03 11:49:28 +00:00
|
|
|
|
|
2024-08-05 11:38:55 +00:00
|
|
|
|
|
2024-08-03 11:49:28 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2024-08-05 11:38:55 +00:00
|
|
|
|
ListViewA.Height = height - 36;
|
2024-08-03 11:49:28 +00:00
|
|
|
|
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>ֵ
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-05 11:38:55 +00:00
|
|
|
|
|
|
|
|
|
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);
|
2024-12-06 01:26:57 +00:00
|
|
|
|
dongtaixiaoxi();
|
2024-08-05 11:38:55 +00:00
|
|
|
|
}
|
2024-08-03 11:49:28 +00:00
|
|
|
|
}
|