WIn_RustTools/RustTools/Views/HomePage.xaml.cs

67 lines
1.6 KiB
C#
Raw Normal View History

2024-07-14 11:24:10 +00:00
using System;
using System.Collections.Generic;
2024-07-19 07:36:44 +00:00
using System.Collections.ObjectModel;
2024-07-14 11:24:10 +00:00
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using RustTools.ViewModels;
2024-07-19 07:36:44 +00:00
namespace RustTools.Views;
2024-07-14 11:24:10 +00:00
public sealed partial class HomePage : Page
{
public HomePageViewModel ViewModel {
get;
}
2024-07-19 07:36:44 +00:00
public ObservableCollection<Contact> conns = new();
2024-07-14 11:24:10 +00:00
2024-07-19 07:36:44 +00:00
public ObservableCollection<string> Pictures { get; } = new ObservableCollection<string>();
2024-07-14 11:24:10 +00:00
public HomePage()
{
2024-07-15 05:22:53 +00:00
ViewModel= App.GetService<HomePageViewModel>();
2024-07-19 07:36:44 +00:00
Pictures.Add("/Assets/image/a.jpeg");
Pictures.Add("/Assets/image/b.jpeg");
StartAsync();
2024-07-14 11:24:10 +00:00
InitializeComponent();
}
2024-07-19 07:36:44 +00:00
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;
}
}
2024-07-14 11:24:10 +00:00
}