public static async void NotuSil(Notlar not) { if (File.Exists(not.DosyaAdi)) { File.Delete(not.DosyaAdi); } await App.Current.MainPage.Navigation.PopAsync(); }
public static async void NotuKaydet(Notlar not) { if (string.IsNullOrWhiteSpace(not.DosyaAdi)) { // Kaydet var dosyaAdi = Path.Combine(App.DosyaYolu, $"{Path.GetRandomFileName()}.notlar.txt"); File.WriteAllText(dosyaAdi, (not.notMetni).ToString()); } else { // Güncelle File.WriteAllText(not.DosyaAdi, (not.notMetni).ToString()); } await App.Current.MainPage.Navigation.PopAsync(); }