Click here to Skip to main content
15,436,489 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
How to convert this xaml in c# code ?

XML
<Style x:Key="TileStyle" TargetType="control:Tile">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="control:Tile">
                <Image Source="{Binding Path=ImgSource, RelativeSource={RelativeSource TemplatedParent}}"></Image>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
Posted
Updated 9-Sep-20 21:25pm
Comments
dan!sh 23-Jan-13 7:01am    
Did you try something?

Please check the answers suggested in Converting ControlTemplate XAML to C#[^].

Thanks...
 
Share this answer
 
XML
<Style TargetType="{x:Type Primitives:RowSelectorHeaderCellControl}" x:Key="Test">
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate >
                        <Button Background="YellowGreen" Content="ColChooser" Name="button1"  Click="button1_Click" />
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
 
Share this answer
 
Comments
ToolmakerSteve2 22-Dec-17 19:58pm    
I think the question is asking what C# code would be equivalent to the XAML in the question. I don't think this answer is an answer to the question. What is this XAML intending to show?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900