Let a MainPage.cs create in Xamarin in Visual Studio
Clash Royale CLAN TAG#URR8PPP
Let a MainPage.cs create in Xamarin in Visual Studio
I am currently doing a visual studio xamarin course and I noticed that when, in the videos, a new Blank Forms App is created, the IDE creates an App.cs and MainPage.cs.
When I create one, the IDE creates a App.XAML with App.Xaml.cs and MainPage.XAML with MainPage.Xaml.cs.
XAML is where the design is done are XAML.CS where the logic is done or I am wright.
My question is, why or where come this change from? Why doesnt create XAML files in the course videos? An update or just a configuration difference?
1 Answer
1
This is just a difference in the templates provided in Visual Studio, when the video was shot, versus today.
It is up to you whether you create your view in the XAML file or not. However, it would be the usual place to design the UI. However, it is very opinion based, whether you should put any logic into the xaml.cs
file. Some people would say you should follow the MVVM pattern and avoid putting anything but view and binding related stuff in it. Other people are more pragmatic and would allow logic to be put there.
xaml.cs
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.