Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
is there any method to incorporate XAML code segment into C# codebehind so that it will be executed at run time and will have the same effect based on certain events

ie something like this

C#
private void button1_Click(object sender, RoutedEventArgs e)
       {
 some type of handling here

<TextBlock Text="{Binding ElementName=SampleText,
Path=Text}"
FontFamily="{Binding ElementName=FontList,
Path=SelectedItem}"
FontSize="32"
TextWrapping="Wrap" />

       }



thanks in advance
Posted

1 solution

 
Share this answer
 
Comments
[no name] 23-Jan-12 12:16pm    
I meant to say to create a replica of XAML inside the codebehind rather
than instantiate the elements again in the code
SteveAdey 23-Jan-12 14:33pm    
Yes, that will help you do that.

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