Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
swdev:dotnet:wpf:hosting_windows_forms_controls [2010/11/16 12:46]
smayr
swdev:dotnet:wpf:hosting_windows_forms_controls [2011/09/07 11:38] (current)
smayr
Line 5: Line 5:
     * ''WindowsFormsIntegrations''     * ''WindowsFormsIntegrations''
     * ''System.Windows.Forms''     * ''System.Windows.Forms''
 +    * ''System.Windows.Forms.DataVisualization''
   * Add namespace in XAML: <code xml>   * Add namespace in XAML: <code xml>
 <Window ... <Window ...
-xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" ... >+        xmlns:winforms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 
 +        xmlns:charting="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization" 
 +        Title="MainWindow" Height="350" Width="525" >
 ... ...
 </code> </code>
  
-  * Add ''WindowsFormsHost'' tag inside a grid element (in XAML): <code xml>+  * Add ''WindowsFormsHost'' tag inside a grid element (in XAML), then place the required Windows Form control inside it (eg. an MS Chart control): <code xml>
 <Grid> <Grid>
  <WindowsFormsHost>  <WindowsFormsHost>
- <wf:Chart x:Name="Chart1"/>+ <charting:Chart x:Name="chart1"/>
  </WindowsFormsHost>  </WindowsFormsHost>
 </Grid>   </Grid>  
 </code> </code>