I'm developing a Windows Universal App and in one of my views I'm trying to use DesignTime Data. In my ViewModel i created a condition for loading real or dummy data:
if(IsInDesignModeStatic || IsInDesignMode)
{
var service = new DummyService()
this.Data = await service.GetInformation(null, null);
}
I'm using mvvmLight. The GetInformation Method of the service should load the data from a json file located in the project folder. I tried loading the file via "StorageFile.GetFileFromApplicationUriAsync(dataUri);" and via normal "File.ReadAllText". In both cases the Designer throws a "FileNotFoundException".
I also tried to debug the design time view model with another instance of visual studio, but i can't figure out which path should i use. I know that the designer is running in a separate process - XDesProc - but I'm not sure how my file path should look like so the XDesProc can find it.
So how can i load a file in code for design time data?