Counter App using XAML and MVUX
Download the complete XAML + MVUX sample
[!include[Intro](xref:Uno.Workshops.Counter.Intro-Inline)]In this tutorial you will learn how to:
- Create a new Project with Uno Platform using Visual Studio Template Wizard or the dotnet new command
- Add elements to the XAML file to define the layout of the application
- Add code to the C# file to implement the application logic using the Model-View-Update-e
Xtended (MVUX) pattern - Use data binding to connect the UI to the application logic
To complete this tutorial you don't need any prior knowledge of the Uno Platform, XAML, or C#.
[!include[VS](xref:Uno.Workshops.Counter.Create-Inline)]Note
If you don't have the Uno Platform Extension for Visual Studio installed, follow these instructions.
Launch Visual Studio and click on Create new project on the Start Window. Alternatively, if you're already in Visual Studio, click New, Project from the File menu.
Type
Uno Platform
in the search boxClick Uno Platform App, then Next
Name the project
Counter
and click Create
At this point you'll enter the Uno Platform Template Wizard, giving you options to customize the generated application. For this tutorial, we're only going to configure the markup language and the presentation framework.
Select Blank in Presets selection
Select the Presentation tab and choose MVUX
Select the Markup tab and choose XAML
Before completing the wizard, take a look through each of the sections and see what other options are available. You can always come back and create a new project with different options later. For more information on all the template options, see Using the Uno Platform Template.
- Click Create to complete the wizard
The template will create a solution with a single cross-platform project, named Counter
, ready to run.
Data Binding
Now that we have the MainModel
class, we can update the MainPage
to use data binding to connect the UI to the application logic.
If you want to see the completed application, you can download the source code from GitHub.