We had a problem that with the RadGridView that occurred in with the 2009 Q3 build 1030 release. We downloaded the latest internal build (RadControls_for_Silverlight_2009_3_1426_Trial.zip) which did fix the problem but it introduced another problem with the RadTabControl.
We have a RadTabControl that looks like this:
<Controls:RadTabControl Grid.Row="0" Grid.Column="2" ItemsSource="{Binding Workspaces}" SelectedItem="{Binding SelectedWorkspace, Mode=TwoWay}"
SelectedContentTemplateSelector="{StaticResource templateSelector}"
ContentTemplateSelector="{StaticResource templateSelector}">
<Controls:RadTabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Text="{Binding DisplayName}" FontSize="12" FontWeight="Bold" Margin="5"/>
<Button Click="CloseWorkspace" Content="X" Cursor="Hand" IsTabStop="False" FontSize="8" Padding="0" Width="16" Height="16" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
</StackPanel>
</DataTemplate>
</Controls:RadTabControl.ItemTemplate>
</Controls:RadTabControl>
The tab control uses a ContentTemplateSelector which is defined as :
The template selector is declared in App.xaml as:
<!-- Templates -->
<DataTemplate x:Key="manualDipReadTemplate">
<View:ManualDipReadView/>
</DataTemplate>
<DataTemplate x:Key="scheduledFillTemplate">
<View:ScheduledFillView/>
</DataTemplate>
<View:DynamicDataTemplateSelector x:Key="templateSelector"
ManualDipReadEntryTemplate="{StaticResource manualDipReadTemplate}"
ScheduledFillTemplate="{StaticResource scheduledFillTemplate}"/>
Although the DataContext for the tab control it appear to not use the ContentTemplateSelector until I click on the second tab item. Before that, the first tab just shows the string representation of the items in the Workspaces collection, and the selected tab is not highlighted, as it it could not figure out which tab was selected.
All this code works OK under build 1030, so this must have either been a bug introduced since that version or maybe the way the tab control works has changed?
We have a RadTabControl that looks like this:
<Controls:RadTabControl Grid.Row="0" Grid.Column="2" ItemsSource="{Binding Workspaces}" SelectedItem="{Binding SelectedWorkspace, Mode=TwoWay}"
SelectedContentTemplateSelector="{StaticResource templateSelector}"
ContentTemplateSelector="{StaticResource templateSelector}">
<Controls:RadTabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Text="{Binding DisplayName}" FontSize="12" FontWeight="Bold" Margin="5"/>
<Button Click="CloseWorkspace" Content="X" Cursor="Hand" IsTabStop="False" FontSize="8" Padding="0" Width="16" Height="16" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
</StackPanel>
</DataTemplate>
</Controls:RadTabControl.ItemTemplate>
</Controls:RadTabControl>
The tab control uses a ContentTemplateSelector which is defined as :
public class DynamicDataTemplateSelector : DataTemplateSelector
{
public DataTemplate ManualDipReadEntryTemplate { get; set; }
public DataTemplate ScheduledFillTemplate { get; set; }
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
if (item is ManualDipReadViewModel)
{
return ManualDipReadEntryTemplate;
}
if (item is ScheduledFillViewModel)
{
return ScheduledFillTemplate;
}
return null;
}
}
The template selector is declared in App.xaml as:
<!-- Templates -->
<DataTemplate x:Key="manualDipReadTemplate">
<View:ManualDipReadView/>
</DataTemplate>
<DataTemplate x:Key="scheduledFillTemplate">
<View:ScheduledFillView/>
</DataTemplate>
<View:DynamicDataTemplateSelector x:Key="templateSelector"
ManualDipReadEntryTemplate="{StaticResource manualDipReadTemplate}"
ScheduledFillTemplate="{StaticResource scheduledFillTemplate}"/>
Although the DataContext for the tab control it appear to not use the ContentTemplateSelector until I click on the second tab item. Before that, the first tab just shows the string representation of the items in the Workspaces collection, and the selected tab is not highlighted, as it it could not figure out which tab was selected.
All this code works OK under build 1030, so this must have either been a bug introduced since that version or maybe the way the tab control works has changed?