Thursday, 24 January 2013

Procedural Code Inside XAML...


Lets see an example in which procedural code (C#)  is embedded with XAML markup.
Replace the below mentioned code in your xaml markup code..

<grid>
     <Button Click="button_Click" Height="39">
        <x:Code>
            <![CDATA[
                    void button_Click(Object Sender,RoutedEventArgs e)
                   {
                          MessageBox.Show("hello i m clicked!!!");
                   }
            ]]>
       </x:Code>
   </Button>
<grid>          
       

3 comments: