Note
model that will store data about each note in the application.Editor
for text input, and two Button
instances that direct the application to save or delete a file. The two Button
instances are horizontally laid out in a Grid
, with the Editor
and Grid
being vertically laid out in a StackLayout
. In addition, the Editor
uses data binding to bind to the Text
property of the Note
model. For more information about data binding, see Data binding in the Xamarin.Forms Quickstart Deep Dive.Note
instance, which represents a single note, in the BindingContext
of the page. When the SaveButton
is pressed the OnSaveButtonClicked
event handler is executed, which either saves the content of the Editor
to a new file with a randomly generated filename, or to an existing file if a note is being updated. In both cases, the file is stored in the local application data folder for the application. Then the method navigates back to the previous page. When the DeleteButton
is pressed the OnDeleteButtonClicked
event handler is executed, which deletes the file, provided that it exists, and navigates back to the previous page. For more information about navigation, see Navigation in the Xamarin.Forms Quickstart Deep Dive.ListView
and a ToolbarItem
. The ListView
uses data binding to display any notes that are retrieved by the application, and selecting a note will navigate to the NoteEntryPage
where the note can be modified. Alternatively, a new note can be created by pressing the ToolbarItem
. For more information about data binding, see Data binding in the Xamarin.Forms Quickstart Deep Dive.NotesPage
. When the page appears, the OnAppearing
method is executed, which populates the ListView
with any notes that have been retrieved from the local application data folder. When the ToolbarItem
is pressed the OnNoteAddedClicked
event handler is executed. This method navigates to the NoteEntryPage
, setting the BindingContext
of the NoteEntryPage
to a new Note
instance. When an item in the ListView
is selected the OnListViewItemSelected
event handler is executed. This method navigates to the NoteEntryPage
, setting the BindingContext
of the NoteEntryPage
to the selected Note
instance. For more information about navigation, see Navigation in the Xamarin.Forms Quickstart Deep Dive.System.IO
namespace, and adds a declaration for a static FolderPath
property of type string
. The FolderPath
property is used to store the path on the device where note data will be stored. In addition, the code initializes the FolderPath
property in the App
constructor, and initializes the MainPage
property to be a NavigationPage
that hosts an instance of NotesPage
. For more information about navigation, see Navigation in the Xamarin.Forms Quickstart Deep Dive.Note
model that will store data about each note in the application.Editor
for text input, and two Button
instances that direct the application to save or delete a file. The two Button
instances are horizontally laid out in a Grid
, with the Editor
and Grid
being vertically laid out in a StackLayout
. In addition, the Editor
uses data binding to bind to the Text
property of the Note
model. For more information about data binding, see Data binding in the Xamarin.Forms Quickstart Deep Dive.Note
instance, which represents a single note, in the BindingContext
of the page. When the SaveButton
is pressed the OnSaveButtonClicked
event handler is executed, which either saves the content of the Editor
to a new file with a randomly generated filename, or to an existing file if a note is being updated. In both cases, the file is stored in the local application data folder for the application. Then the method navigates back to the previous page. When the DeleteButton
is pressed the OnDeleteButtonClicked
event handler is executed, which deletes the file, provided that it exists, and navigates back to the previous page. For more information about navigation, see Navigation in the Xamarin.Forms Quickstart Deep Dive.ListView
and a ToolbarItem
. The ListView
uses data binding to display any notes that are retrieved by the application, and selecting a note will navigate to the NoteEntryPage
where the note can be modified. Alternatively, a new note can be created by pressing the ToolbarItem
. For more information about data binding, see Data binding in the Xamarin.Forms Quickstart Deep Dive.NotesPage
. When the page appears, the OnAppearing
method is executed, which populates the ListView
with any notes that have been retrieved from the local application data folder. When the ToolbarItem
is pressed the OnNoteAddedClicked
event handler is executed. This method navigates to the NoteEntryPage
, setting the BindingContext
of the NoteEntryPage
to a new Note
instance. When an item in the ListView
is selected the OnListViewItemSelected
event handler is executed. This method navigates to the NoteEntryPage
, setting the BindingContext
of the NoteEntryPage
to the selected Note
instance. For more information about navigation, see Navigation in the Xamarin.Forms Quickstart Deep Dive.System.IO
namespace, and adds a declaration for a static FolderPath
property of type string
. The FolderPath
property is used to store the path on the device where note data will be stored. In addition, the code initializes the FolderPath
property in the App
constructor, and initializes the MainPage
property to be a NavigationPage
that hosts an instance of NotesPage
. For more information about navigation, see Navigation in the Xamarin.Forms Quickstart Deep Dive.