Using design-time data for my Windows Phone Apps which works fine for string, int etc. (e.g. here: Person name, Person age) but when I like to do that for "nested object" (e.g. here: Company/Employer) I have no idea how to do this in the design-time-data-XAML file.
Company:
public class Company
{
public string Name { get; set; }
public int Size { get; set; }
}
Person:
public class Person
{
public int Age { get; set; }
public string Name { get; set; }
public Company Employer { get; set; }
}
PersonViewModel.cs:
"Normal" ViewModel which implements INotifyPropertyChanged and has properties for all data I want to display.
PersonViewModelSampleData.xaml:
<local:PersonViewModel
xmlns="http:schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http:schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Hfr.BlaBla.ViewModels"
Name="Harald-René Flasch"
Age="36">
</local:PersonViewModel>
Person Page XAML:
<TextBlock
Text="{Binding Path=Employer.Name}"
Style="{StaticResource PhoneTextLargeStyle}"
TextWrapping="Wrap" ... />
So, Path=Employer.Name works fine at run-time but I have no idea how to provide that data for design-time support. Any suggestions?