c# interface/class conflict changing from WinForms to WPF

I 'm changing a c# app user interface, from WinForm to WPF.
The Winform app works perfectly and I don'want to change anything in the windows structure, c# code etc. except what is needed by the shift to WPF.
Everything seems to work except this bug:
Here is the Winform code :
 public WFvNodeImuM1()
        {
            InitializeComponent();
        }

        public WFvNodeImuM1(IvNode sensor)
        {
            InitializeComponent();
            Sensor = sensor;

            this.Text = sensor.Name;

            Sensor.ReloadQueue();
            vnode = (vNodeImuM1)Sensor;
            imudata = vnode.ImuM1DataQueue;
            if (imudata != null)
            {
                showTextResult();
                showDataResult();
            }

            timer1.Tick += timer1_Tick;
            timer1.Enabled = true;
           
        }

Open in new window

Here is the WPF code:
public WPFvNodeImuM1(IvNode sensor)
        {
            InitializeComponent();
            Sensor = sensor;

            this.Text = sensor.Name;

            Sensor.ReloadQueue();
            vnode = (vNodeImuM1)Sensor;
            imudata = vnode.ImuM1DataQueue;
            if (imudata != null)
            {
                showTextResult();
                showDataResult();
            }

            timer1.Tick += timer1_Tick;
            timer1.Enabled = true;
           
        }

Open in new window


As far as i'm concerned those two codes look similar
But, in the WPF version i've got an error on the line :
  Sensor = sensor;
 error: "...type used as a variable..."
in the VS intellisense:
- in Winform code "Sensor" appears as "IvNode WFvNode.Sensor"
- in WPF code "Sensor" appears as "class CoachLab.Data.Model.Sensor"
I've checked namespaces, using etc.. with no results
Experts, please help me !!!
public partial class WFvNode : Form
    {
        protected IvNode vnode;
        public WFCapture MainForm { get; set; }

        public WFvNode()
        {
            InitializeComponent();
        }

        public WFvNode(IvNode sensor)
        {
            InitializeComponent();
            Sensor = sensor;
        }

        public IvNode Sensor
        {
            get { return vnode; }
            set
            {
                vnode = value;
                if (vnode != null)
                {
                    Key = vnode.key;
                }

            }
        }

Open in new window

PaulagierResearch DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Najam UddinCommented:
Please paste code from WPF where you have defined property Sensor
PaulagierResearch DirectorAuthor Commented:
public partial class WPFvNode : UserControl
    {
        protected IvNode vnode;
        public WPFCapture MainForm { get; set; }

        public WPFvNode()
        {
            InitializeComponent();
        }

        public WPFvNode(IvNode sensor)
        {
            InitializeComponent();
            Sensor = sensor;
        }

        public IvNode Sensor
        {
            get { return vnode; }
            set
            {
                vnode = value;
                if (vnode != null)
                {
                    Key = vnode.key;
                }

            }
        }

Open in new window

Sensor properties definition
Najam UddinCommented:
How are you defining property in WPFvNode , but assigning in WPFvNodeImuM1?
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

PaulagierResearch DirectorAuthor Commented:
Hi Najam
WPFvNode and WPFvNodeImuM1 are two different projects in the same solution
We use WF or WPF, never the two at the same time
WPFvNode and WPFvNodeImuM1 code are similar so there is nothing special to assign Sensor
PaulagierResearch DirectorAuthor Commented:
Hi Najam,
Changing the order of the "using" list on top of the code behind solves the problem !!
No idea of the reason, I was thinking that the order of the namespaces listed on top of the code does not matter at all. It seems that the reality is different.
Do you know wky ?
it_saigeDeveloperCommented:
Namespace ordering does not matter because ultimately the IL that is created replaces all references with their appropriate namespace mapping; e.g. -Capture.JPGThis is why it is important to resolve any name resolution errors.

The fact that you changed the usings simply elicited a *clean* build of your assembly.

In the future, you can attempt to avoid the scenario of "I make a change to my program but I still get the output as if I did not make the change", by simply cleaning your solution before you build it.Capture.JPG-saige-

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.