Edit code behind

This procedure provides an example of how to edit the code behind in a Silverlight form.

Before you begin

Procedure

  1. In the Project tab, expand MainPage.xaml to reveal MainPage.xaml.cs.
    The code behind editor does not yet support IntelliSense, so adding code must be done carefully. To add a pop-up message box from code behind, modify the MainPage.xaml.cs file as follows:
    Register an event handler in the constructor (adding your code just after InitializeProficyData(), as shown):
    public MainPage()                                   
    {                                                          
          InitializeProficyData();                                                         
          Button1.Click += SayHello;                                    
    }  
                        
    Add the handler code to MainPage.xaml.cs:
    
    private void SayHello(Object sender, EventArgs args) 
    { 
          MessageBox.Show("Hello"); 
    }
  2. Click Save to save the project and its output.
  3. Select the form in the Workflow client and view it in the Global Viewer to see the compiled form running.