Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,
I have 2 projects in C#: a WPF app and a old empty c# project. In the last one I have a method that validates Forms
C#
public void SetParentUserConrtol(Form parent, uint id)
    {
        // Set the data
        _parentUserControl = parentUserControl;
        _parentID = id;

        // Check valid
        if (!IsValid())
            DisableParent();
    }

I want to use this project with my WPF , which basically means : I want that my old empty c# project be able to receive a System.Windows.UserControl as a parameter( or a WPF window) instead a Form.


I am not able to add System.Windows.Controls asa reference. How can I solve this? This c# empty project is the bridge between my wpf and dongle code, for that I am insisting on this.
Posted
Updated 15-Dec-14 23:33pm
v3

1 solution

My solution has been to create WPF project, copy the old .cs files in that new project , and add on it a reference to System.Windows.Forms , in order to still using the old funcionality which validates Windows forms. Then create same methods but passing this time System.Windows.Controls.UserControl UC as a parameter.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900