You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

1 year ago
using LocalDataStorageWithSQLite.Models;
using LocalDataStorageWithSQLite.StorageUtils;
using Microsoft.Maui.Storage;
namespace LocalDataStorageWithSQLite
{
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
//string src = "Source Sample";
//List<string> srcs = new List<string>() { "src1", "src2", "src3", "src4", "src5" };
//PreferenceStorage ps = new PreferenceStorage();
//FileSystemStorage fs = new FileSystemStorage();
//ps.Set("src", src);
//fs.Set("srcs", srcs);
//var fromPs = ps.Get("src");
//var fromFs = fs.Get<List<string>>("srcs");
//int a = 0;
}
1 year ago
public async void OnNewButtonClicked(object sender, EventArgs args)
1 year ago
{
statusMessage.Text = "";
1 year ago
await App.PersonRepo.AddNewPerson(newPerson.Text);
1 year ago
statusMessage.Text = App.PersonRepo.StatusMessage;
}
1 year ago
public async void OnGetButtonClicked(object sender, EventArgs args)
1 year ago
{
statusMessage.Text = "";
1 year ago
List<Person> people = await App.PersonRepo.GetAllPeople();
1 year ago
peopleList.ItemsSource = people;
}
}
}