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.
 
 
 
MyFirstMAUI/MyFirstMauiApp/NotesNet8/Views/AllNotesPage.xaml.cs

34 lines
836 B

namespace NotesNet8.Views;
public partial class AllNotesPage : ContentPage
{
public AllNotesPage()
{
InitializeComponent();
BindingContext = new Models.AllNotes();
}
protected override void OnAppearing()
{
base.OnAppearing();
((Models.AllNotes)BindingContext).LoadNotes();
}
private async void Add_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(NotePage));
}
private async void notesCollection_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0)
return;
var note = (Models.Note)e.CurrentSelection[0];
await Shell.Current.GoToAsync($"{nameof(NotePage)}?{nameof(NotePage.ItemId)}={note.Filename}");
notesCollection.SelectedItem = null;
}
}