I have the following ProductList template snipet template
<Style x:Key="ProductListStyle" TargetType="{x:Type s:SurfaceListBox }"> <Setter Property="Background" Value="{DynamicResource {x:Static s:SurfaceColors.ListBoxItemBackgroundBrushKey}}" /> <Setter Property="SelectionMode" Value="Single" /> <Setter Property="Height" Value="234" /> <Setter Property="ItemTemplateSelector"> <Setter.Value> <sc:ProductListTemplateSelector> <sc:ProductListTemplateSelector.NormalItemTemplate> <DataTemplate> <StackPanel RenderTransformOrigin="0.5, 0.5" Margin="7,0,0,0" MinWidth="171" MaxWidth="171" MinHeight="235" MaxHeight="235"> <Image Margin="14,21,21,11" Source="{Binding XPath=@Image }" Height="149" Width="101" /> <TextBlock Text="{Binding XPath=@Name }" MaxWidth="116" FontSize="12" Margin="21,0,21,21" FontFamily="Segoe360" TextAlignment="Center" TextWrapping="Wrap" Foreground="{DynamicResource {x:Static s:SurfaceColors.ListBoxItemForegroundBrushKey}}" HorizontalAlignment="Center" /> </StackPanel> </DataTemplate> </sc:ProductListTemplateSelector.NormalItemTemplate>
I need to replace the DataTemplate with this style, which will be set using my custom control, for example
<local:MyUserControl>
Keeping only the section, I did not get my control when my Itemource is installed with the myUserControl collection
serge source share