What is x:Code?

 Posted by Ddd on 3/22/2011 | Category: WPF Interview questions | Views: 3427 | Points: 40

x:Code is a directive element defined in XAML.
An x:Code directive element can contain inline programming code.
The code that is defined inline can interact with the XAML on the same page.


<Window  x:Class="WpfApplication14jan.Window1"


Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">
<Grid Name="dd">
<Button Name="button1" Click="Clicked">In Line code!</Button>

void Clicked(object sender, RoutedEventArgs e)
button1.Content = "WPF Inline Code";


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response