WIn_RustTools/RustTools/Views/HomePage.xaml.cs
2024-07-19 15:36:44 +08:00

67 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using RustTools.ViewModels;
namespace RustTools.Views;
public sealed partial class HomePage : Page
{
public HomePageViewModel ViewModel {
get;
}
public ObservableCollection<Contact> conns = new();
public ObservableCollection<string> Pictures { get; } = new ObservableCollection<string>();
public HomePage()
{
ViewModel= App.GetService<HomePageViewModel>();
Pictures.Add("/Assets/image/a.jpeg");
Pictures.Add("/Assets/image/b.jpeg");
StartAsync();
InitializeComponent();
}
private void StartAsync()
{
var concern = new Contact("DeBug", "Debug", "DeBug");
conns.Add(concern);
conns.Add(concern);
conns.Add(concern);
conns.Add(concern);
conns.Add(concern);
conns.Add(concern);
conns.Add(concern);
conns.Add(concern);
}
public class Contact
{
public string FirstName
{
get; private set;
}
public string LastName
{
get; private set;
}
public string Company
{
get; private set;
}
public string Name => FirstName + " " + LastName;
public Contact(string firstName, string lastName, string company)
{
FirstName = firstName;
LastName = lastName;
Company = company;
}
}
}