Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# XAML WPF
How to convert this xaml in c# code ?
 
<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 23-Jan-13 0:33am
Comments
d@nish at 23-Jan-13 7:01am
   
Did you try something?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please check the answers suggested in Converting ControlTemplate XAML to C#[^].
 
Thanks...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<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>
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 540
1 OriginalGriff 300
2 CPallini 290
3 ChauhanAjay 124
4 George Jonsson 120
0 OriginalGriff 6,474
1 Sergey Alexandrovich Kryukov 6,190
2 CPallini 5,180
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 3 Oct 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100