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.
34 lines
885 B
34 lines
885 B
using System.Diagnostics;
|
|
|
|
namespace MauiUI
|
|
{
|
|
public partial class MainPage : ContentPage
|
|
{
|
|
public const double MyFontSize = 28;
|
|
|
|
private string _fileName = Path.Combine(FileSystem.AppDataDirectory, "notes.txt");
|
|
|
|
public MainPage()
|
|
{
|
|
InitializeComponent();
|
|
if (File.Exists(_fileName))
|
|
editor.Text = File.ReadAllText(_fileName);
|
|
}
|
|
|
|
private void LoginButton_Clicked(object sender, EventArgs e)
|
|
{
|
|
Debug.WriteLine("Clicked!");
|
|
}
|
|
|
|
private void OnSaveButton_Clicked(object sender, EventArgs e)
|
|
{
|
|
File.WriteAllText(_fileName, editor.Text);
|
|
}
|
|
|
|
private void OnDeleteButton_Clicked(object sender, EventArgs e)
|
|
{
|
|
editor.Text = "";
|
|
File.WriteAllText(_fileName, editor.Text);
|
|
}
|
|
}
|
|
}
|
|
|