Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8657455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:31:26+00:00 2026-06-12T15:31:26+00:00

Using design-time data for my Windows Phone Apps which works fine for string ,

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:31:27+00:00Added an answer on June 12, 2026 at 3:31 pm

    I don’t understand your sample data : it would be an instance of Person OR an instance of PersonViewModel (but in that case the viewModel should have a property of type Company or Person or both).

    If your sample data is an instance of Person :

    <local:Person
        xmlns="http:schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http:schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Hfr.BlaBla.MyModelsNamespace"
    
        Name="Harald-René Flasch"
        Age="36">
         <local:Person.Employer>
                 <local:Company Name="MyCompany"/>
         </local:Person.Employer>
    </local:Person>
    

    Be carefull of namespaces : here the “local” xmlns refers to the model namespace (not the viewModel).

    EDIT :
    If your sample data is the viewModel, assuming that your ViewModel as a property Employer with a setter (not only a getter), of type Company :

    <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"
        xmlns:myModel="clr-namespace:Hfr.BlaBla.MyModelsNamespace"
        Name="Harald-René Flasch"
        Age="36">
        <local:PersonViewModel.Employer>
                <myModel:Company Name="MyCompany"/>
        </local:PersonViewModel.Employer>
    </local:PersonViewModel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been merrily using the DesignData in Windows Phone apps, and I was hoping
For some time now, I've been using the design pattern of objectOne, shown below.
Im using the plugin detailed here: http://www.thatagency.com/design-studio-blog/2009/01/refreshing-an-element-at-a-set-time-interval-using-jquery-and-a-sprinkle-of-ajax/ Here is my jQuery: $(document).ready(function(){ var j
Using Fluent Interface design here if i call something like dog.Train(Running).Train(Eating).Do(Running).Do(Eating); what is the
I am using a repository design with web applications (repository (data layer) exposing model
I'm using MVVM Light to build a WP7 (Windows Phone 7) application. I wish
I am using Visual C# 2008 Express edition. If at design time I have
Does anybody know if its possible to use Microsoft.Xna.Framework.Media.MediaLibrary for design time data? I'm
We need to generate LINQ queries which are 100% unknown during coding (design time).
I am trying to decide which would be the best data warehouse type design.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.