Это мой первый проект Xamarin, и я уже столкнулся со странной проблемой.
Начиная с MainPage.xaml, я трижды вызываю ItemDetailsPage с ItemFetailViewModel в качестве параметра.
После компиляции VS выбрасывает "The type or namespace name 'ItemDetailsPage' could not be found"
. Красных подчеркиваний нет.
Я проверил правильность namaespace в .xaml и .xaml.cs
MainPage.xaml.cs
namespace testapp3.Views
public partial.....
{
Method()
{
await Navigation.PushAsync(new ItemDetailsPage(new ItemDefailViewModel(item)
}
}
ItemDetailsPage.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="testapp3.Views.ItemDetailsPage">
</ContentPage>
ItemDetailsPage.xaml.cs
namespace testapp3.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ItemDetailsPage : ContentPage
{
ItemDetailViewModel viewModel;
public ItemDetailsPage ()
{
InitializeComponent ();
}
public ItemDetailsPage(ItemDetailViewModel item)
{
InitializeComponent();
BindingContext = this.viewModel = item;
}
}
}