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.