New Posts New Posts RSS Feed: Design-time data supported by entities?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Design-time data supported by entities?

 Post Reply Post Reply
Author
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Topic: Design-time data supported by entities?
    Posted: 03-Jan-2013 at 1:07pm
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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down