Hello @Sergio Daniel Toro Romero ,
VS for mac MAUI tooling is still under preview, some file templates are not ready yet. If you want to create a page, try to create a class inherited from ContentPage, refer to the following code :
public class MyPage : ContentPage
{
public MyPage ()
{
Content = new StackLayout{
Children ={
......
}
};
}
}
If you want to create a page with Xaml, try to create an empty file named MyPage.xaml
, and add the control element, refer to the following code:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XXX.MyPage">
<ContentPage.Content>
<StackLayout>...
</StackLayout>
</ContentPage.Content>
</ContentPage>
Then add an empty class as partial class of this page, and implement InitializeComponent()
method, note that the class file is named MyPage.xaml.cs
:
namespace xxx
{
public partial class MyPage : ContentPage
{
public MyPage()
{
InitializeComponent();
}
}
}
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.