The following line of code
TreeView treeview = (TreeView)currentGroup.Content;
lists an error
‘TreeView’ is an ambiguous reference between ‘
System.Windows.Forms.TreeView‘ and ‘System.Windows.Controls.TreeView‘
I know the reason as I need to explicitly state which reference to use as both have TreeView eg :
System.Windows.Controls.TreeView treeview = (System.Windows.Controls.TreeView)currentGroup.Content;
What is best practice for this? Is there another(neater) way of defining which reference TreeView must use if used extensively through several methods?
If you use particularly
System.Windows.Forms.TreeViewfor example, you just addinto your using statements list and within this class by default the compiler will be assuming
System.Windows.Forms.TreeViewwhen you useTreeView.