I have a Windows Phone 8.1 MVVM Light project and I am struggling to keep it Blendable.
As I see it I have a few options. I can load different view mode
Load your data on the page load event, using a Command, so you can take advantage of the await/async stuff. I don't know how this works with blend as I don't use it much.
View:
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding PageLoadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
ViewModel:
public RelayCommand PageLoadedCommand { get; private set; }
public MyConstructor(IService serviceInjected)
{
PageLoadedCommand = new RelayCommand(async()=>await OnPageLoaded());
....
}
private async Task OnPageLoaded()
{
if(ViewModelBase.IsInDesignModeStatic)
{
var data = await GetSampleDataAsync();
//Do something..
}
}