Я пытаюсь сделать TabbedPage в Xamarin
UserTabbedPage.xaml
<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp.General.Users.UserProfile;assembly=MyApp"
x:Class="MyApp.General.Users.UserProfile.UserTabbedPage">
<local:UserPage />
</TabbedPage>
UserTabbedPage.xaml.cs
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace MyApp.General.Users.UserProfile
{
public partial class UserTabbedPage : TabbedPage
{
public UserTabbedPage()
{
InitializeComponent();
}
}
}
UserPage.xaml
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.General.Users.UserProfile.UserPage">
<ContentPage.Content>
</ContentPage.Content>
</ContentPage>
UserPage.xaml.cs
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace MyApp.General.Users.UserProfile
{
public partial class UserPage : ContentPage
{
public UserPage(User user)
{
InitializeComponent();
}
}
}
Но я получаю Ошибка: указанный ключ 'Xamarin.Forms.Xaml.ElementNode' не присутствовал в словаре
Ошибка исчезает, когда я удаляю User user
из public UserPage(User user)
.Но мне нужно использовать этот класс в конструкторе позже.