How to open a xaml.net template along with a c# file.

 How to open a xaml.net template along with a c# file.

Step One:

To start launch visual studio, then press the button create a new project, Then it will take you to the projects template page. Type in the search bar "maui".

Select the .NET MAUI APP template and the next time you create a project you can click the the pin button to open it easier next time!

Step Two:

Next Make a file to put this project into and find it when you click the "..." button under location. Press select folder, then next and create.

Step Three

Now that you have opened the project there is a template in use that already has a few features to showcase, to run this click the green button that says "windows machine".

This will run the project code as shown!

Example of the project code running:

To begin from coding from scratch you will have to delete some of the template of the code in place currently.

Note: some code is important either follow my guide to deleting the template or keep the project running to see what you are deleting, but be weary when doing the latter option as some laptops cannot handle this.


Step four:

Deleting the mainPage.xaml code
Now that we have ensured the project was created and can run successfully we can edit it. Start by clicking on the "-" box beside the code line numbers to minimize all of the code between two tags. Then highlight this as shown above then delete.

Step five:

Deleting the mainPage.xaml.cs code
To delete this code minimize the method titled OnCounterClicked() by using the same "-" button beside it then delete as shown.

Also delete the code on line 5 initializing the count integer.

Results:

Upon running this code after the changes it should be empty and you should be able to start creating your own app. 

Comments

Popular posts from this blog

Coding in xaml tutorial