ciao!
il mio XAML di base è questo (MainPage.xaml):
codice:
<?xml version="1.0" encoding="utf-8"?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:views="clr-namespace:Book.Views" x:Class="Book.Views.MainPage">
<MasterDetailPage.Master>
<views:MenuPage />
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<NavigationPage>
<NavigationPage.Icon>
<OnPlatform x:TypeArguments="FileImageSource">
<On Platform="iOS" Value="tab_feed.png" />
</OnPlatform>
</NavigationPage.Icon>
<x:Arguments>
<views:ItemsPage /> --> ERRORE
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Detail>
</MasterDetailPage>
ho indicato dove ottengo l'errore.
quwsto errore lo ottengo da quando ho aggiunto un parametro al costruttore di ItemsPage:
codice:
namespace Book.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ItemsPage : ContentPage
{
ItemsViewModel viewModel;
public ItemsPage(string strFile)
{
InitializeComponent();
BindingContext = viewModel = new ItemsViewModel(strFile);
}
}
}
l'errore di compilazione che ottengo è questo:
codice:
MainPage.xaml: Error: The given key 'Xamarin.Forms.Xaml.ElementNode' was not present in the dictionary.
qualche idea??