diff --git a/docs/tutorials/notes-app/includes/navigation.md b/docs/tutorials/notes-app/includes/navigation.md index 09a150942..2204e1d02 100644 --- a/docs/tutorials/notes-app/includes/navigation.md +++ b/docs/tutorials/notes-app/includes/navigation.md @@ -1,7 +1,7 @@ --- author: adegeo ms.author: adegeo -ms.date: 03/21/2024 +ms.date: 02/26/2025 ms.topic: include no-loc: ["MainPage.xaml", "MainPage.xaml.cs", "NotePage.xaml", "NotePage.xaml.cs", "AboutPage.xaml", "AboutPage.xaml.cs", "AppShell.xaml", "AppShell.xaml.cs", "Note.cs", "AllNotes"] --- @@ -150,7 +150,7 @@ The about page will be the quickest page to update and you'll be able to run the 01. In the **Solution Explorer** pane, open the _Views\\AboutPage.xaml_ file. 01. Replace the content with the following snippet: - :::code language="xaml" source="../snippets/navigation/Views/AboutPage.xaml" highlight="4,6-8,14,15,18"::: + :::code language="xaml" source="../snippets/navigation/Views/AboutPage.xaml" highlight="4,6,7-9,15,16,19"::: Let's look at the changed lines, which are highlighted in the previous snippet: @@ -158,6 +158,10 @@ Let's look at the changed lines, which are highlighted in the previous snippet: This line maps the `Notes.Models` .NET namespace to the `models` XML namespace. +- `x:DataType="models:About"` + + This line instructs the XAML compiler to compile all binding expressions for increased runtime performance, and resolves the binding expressions against the `Notes.Models.About` type. + - The `BindingContext` property of the is set to an instance of the `Note.Models.About` class, using the XML namespace and object of `models:About`. This was set using **property element syntax** instead of an XML attribute. > [!IMPORTANT] @@ -199,9 +203,23 @@ Run the app and you should see that it runs exactly the same as before. Try chan The previous section bound the **:::no-loc text="about":::** page view to the **:::no-loc text="about":::** model, and now you'll do the same, binding the **:::no-loc text="note":::** view to the **:::no-loc text="note":::** model. However, in this case, the model won't be created in XAML but will be provided in the code-behind in the next few steps. 01. In the **Solution Explorer** pane, open the _Views\\NotePage.xaml_ file. -01. Change the `` control adding the `Text` property. Bind the property to the `Text` property: `` control by adding the `Text` property, and by binding the property to the `Text` property. The modifications for the code-behind are more complicated than the XAML. The current code is loading the file content in the constructor, and then setting it directly to the `TextEditor.Text` property. Here is what the current code looks like: diff --git a/docs/tutorials/notes-app/includes/project.md b/docs/tutorials/notes-app/includes/project.md index 97e375766..9d1e200ab 100644 --- a/docs/tutorials/notes-app/includes/project.md +++ b/docs/tutorials/notes-app/includes/project.md @@ -17,7 +17,7 @@ Before you can begin this tutorial, you must follow the [Build your first app ar :::image type="content" source="../media/project/vs-configure-project.png" alt-text="Set the name of the .NET MAUI project to Notes in Visual Studio."::: -Choose the latest .NET framework when creating your project. +Choose the latest .NET version when creating your project. ## Select the target device diff --git a/docs/tutorials/notes-app/snippets/allnotes/App.xaml.cs b/docs/tutorials/notes-app/snippets/allnotes/App.xaml.cs index 89b87d193..6a451a225 100644 --- a/docs/tutorials/notes-app/snippets/allnotes/App.xaml.cs +++ b/docs/tutorials/notes-app/snippets/allnotes/App.xaml.cs @@ -7,7 +7,7 @@ public App() InitializeComponent(); } - protected override Window CreateWindow(IActivationState? activationState) + protected override Window CreateWindow(IActivationState activationState) { return new Window(new AppShell()); } diff --git a/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj b/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj index 434b11b4e..64de7188c 100644 --- a/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj +++ b/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj @@ -1,8 +1,8 @@  - net8.0-android;net8.0-ios;net8.0-maccatalyst - $(TargetFrameworks);net8.0-windows10.0.19041.0 + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 @@ -18,7 +18,6 @@ true true enable - enable Notes @@ -30,8 +29,11 @@ 1.0 1 - 11.0 - 13.1 + + None + + 15.0 + 15.0 21.0 10.0.17763.0 10.0.17763.0 @@ -58,8 +60,7 @@ - - + diff --git a/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj.user b/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj.user new file mode 100644 index 000000000..1ec8a8f68 --- /dev/null +++ b/docs/tutorials/notes-app/snippets/allnotes/Notes.csproj.user @@ -0,0 +1,13 @@ + + + + False + net9.0-windows10.0.19041.0 + Windows Machine + Emulator + pixel_7_-_api_35 + + + ProjectDebugger + + \ No newline at end of file diff --git a/docs/tutorials/notes-app/snippets/allnotes/Properties/launchSettings.json b/docs/tutorials/notes-app/snippets/allnotes/Properties/launchSettings.json index edf8aadcc..4f857936f 100644 --- a/docs/tutorials/notes-app/snippets/allnotes/Properties/launchSettings.json +++ b/docs/tutorials/notes-app/snippets/allnotes/Properties/launchSettings.json @@ -1,7 +1,7 @@ { "profiles": { "Windows Machine": { - "commandName": "MsixPackage", + "commandName": "Project", "nativeDebugging": false } } diff --git a/docs/tutorials/notes-app/snippets/allnotes/Views/AboutPage.xaml b/docs/tutorials/notes-app/snippets/allnotes/Views/AboutPage.xaml index 1e8d46f1a..a07812e2f 100644 --- a/docs/tutorials/notes-app/snippets/allnotes/Views/AboutPage.xaml +++ b/docs/tutorials/notes-app/snippets/allnotes/Views/AboutPage.xaml @@ -2,7 +2,8 @@ + x:Class="Notes.Views.AboutPage" + x:DataType="models:About"> diff --git a/docs/tutorials/notes-app/snippets/allnotes/Views/AllNotesPage.xaml b/docs/tutorials/notes-app/snippets/allnotes/Views/AllNotesPage.xaml index faab926c9..f5ad2f036 100644 --- a/docs/tutorials/notes-app/snippets/allnotes/Views/AllNotesPage.xaml +++ b/docs/tutorials/notes-app/snippets/allnotes/Views/AllNotesPage.xaml @@ -1,8 +1,10 @@ + Title="Your Notes" + x:DataType="models:AllNotes"> @@ -22,7 +24,7 @@ - +