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 3276098
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:13:11+00:00 2026-05-17T19:13:11+00:00

I’m currently investigating building a User Control in a Silverlight Project in Expression Blend

  • 0

I’m currently investigating building a User Control in a Silverlight Project in Expression Blend 4. The control has an associated set of sample data for the User Control, and the data is appearing correctly in the User Control.

When I place the User Control on the main page, the sample data does not appear in the User Control. Is this correct behaviour, or am I setting/not setting something? What I am finding odd is that when I edit the User Control, the data appears in the Main Page alongside a Rebuild Indicator (Yellow Exclamation mark). When I rebuild, the data disappears again.

This is the Main Page Code:

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SilverlightApplication2" mc:Ignorable="d"
x:Class="SilverlightApplication2.MainPage"
Width="1200" Height="640">
<UserControl.Resources>
    <local:MultiDayViewModel x:Key="MultiDayViewModelDataSource" d:IsDataSource="True"/>
</UserControl.Resources>

<Grid x:Name="LayoutRoot" Background="White" d:DataContext="{d:DesignData /SampleData/TestSampleData.xaml}">
    <Grid.RowDefinitions>
        <RowDefinition Height="0.128*"/>
        <RowDefinition Height="0.872*"/>
    </Grid.RowDefinitions>
    <StackPanel Margin="0,24,8,8" HorizontalAlignment="Right" Width="318" Orientation="Horizontal">
        <Button Content="Daily"/>
        <Button Content="Weekly"/>
    </StackPanel>
    <local:MultiDayView x:Name="MultiDayView" Margin="8" Grid.Row="1" DataContext="{Binding Calenar, Source={StaticResource MultiDayViewModelDataSource}}"/>
</Grid>

Any thoughts or directions would be appreciated.

Thanks.

  • 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-05-17T19:13:11+00:00Added an answer on May 17, 2026 at 7:13 pm

    You are using d:DataContext, which only appears in design mode. When you place the control inside MainPage, it is interpreted by Blend as being in runtime mode, so the data does not appear, so this is expected behavior.

    When you create the sample data for you control in Blend you can specify whether you want this sample data to be used during runtime as well, or you can simply set the DataContext property instead of or in addition to the d:DataContext property.

    The following image shows how you can enable sample data during runtime, when you create the sample data source from Blend:

    Enable sample data when application is running

    When you select the option called “Enable sample data when application is running”, your XAML looks like this:

        <UserControl
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            x:Class="ASD_Answer002.MainPage"
            Width="640" Height="480">
            <UserControl.Resources>
                <DataTemplate x:Key="DataTemplate1">
                    <CheckBox Content="{Binding Property1}" IsChecked="{Binding Property2, Mode=TwoWay}"/>
                </DataTemplate>
            </UserControl.Resources>
    
            <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource SampleDataSource}}">
                <ItemsControl ItemsSource="{Binding Collection}" ItemTemplate="{StaticResource DataTemplate1}" Margin="50"/>
            </Grid>
        </UserControl>
    

    This will show your sample data for both design time and runtime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I want use html5's new tag to play a wav file (currently only supported
I have a JSP page retrieving data and when single or double quotes are
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I have some data like this: 1 2 3 4 5 9 2 6
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

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.