Hello,
I'm trying to follow the James Montemagno's advices (I can't still post links) to visualize meaningful data in a listview at designtime.
I had correctly defined the ViewModelLocator in my app.css file in the right namespace, like this:
namespace MyApp{<br />
public static class ViewModelLocator{<br />
static OccupazioniPageModel occPM;<br />
public static OccupazioniPageModel occupazioniPageModel => occPM ?? (occPM = new OccupazioniPageModel(FreshIOC.Container.Resolve<IDataService>()));<br />
}
public partial class App : Application
{
[...]
}
}
And the XAML file header is like this:
<ContentPage xmlns="CAN'T_POST_LINKS"
xmlns:x="CAN'T_POST_LINKS"
x:Class="MyApp.Pages.OccupazioniPage"
NavigationPage.HasNavigationBar="False"
BackgroundColor="#03399D"
xmlns:design="clr-namespace:MyApp;assembly:MyApp"
BindingContext="{x:Static design:ViewModelLocator.occupazioniPageModel}}">
The previewer keeps telling me that ViewModelLocator could not be found in clr-namespace:MyApp.
Have something changed since James wrote the post?