I'm trying to create design-time XAML for Silverlight(VS2012, not Blend). I have no problem creating single-object representation but nested childs don't work. Here is XAML I have:
<MaintainTruckViewModel xmlns="clr-namespace:IDATT.Module.Assets.Views" xmlns:data="clr-namespace:IDATT.Model;assembly=IDATT.Model.SL"> <MaintainTruckViewModel.CurrentItem> <data:ASTTruck TruckId="1000" ExternalTruckId="T1000" IsActive="True" VinNumber="1ZAXBV" Make="Volvo" Model="ABC" MakeYear="2010" PlateNumber="ABC 123" PlateIssueAdministrativeArea="MO" Height="110" AxlesCount="3"> <data:ASTTruck.ASTInsurances> <data:ASTInsurance InsuranceKey="1" CompanyName="MainCo" AgentCompanyName="Joes insurance" CoverageAmount = "1000000" DeductibleAmount = "1000" InsuranceType = "General liability" IsActive = "True" PolicyNumber = "123ABC" ExpireOn = "01-01-2012" Note = "This insurance covers all stuff"/> </data:ASTTruck.ASTInsurances> </data:ASTTruck> </MaintainTruckViewModel.CurrentItem> </MaintainTruckViewModel>
|
This is VM object, IdeaBlade entity represented as CurrentItem property
Single ASTTruck have multiple ASTInsurance, those are entities.
I guess I build childs improperly, designer doesn't complain about XAML though..
Here is where I bind to list:
<ItemsControl ItemsSource="{Binding CurrentItem.ASTInsurances}"> |
It works at runtime but doesn't work at design time.
Is there any best practices to fake entities for design-time support?
Edited by katit - 03-Jan-2013 at 1:08pm