views:

1027

answers:

2

I'm working on a WPF app with a ViewModel in C++/CLI, so it can use legacy C code. I'm having trouble exposing the namespace System.Windows.Input to the C++/CLI code and wondering if this is because WPF doesn't really support C++/CLI? Do I really have to insert a C# layer in order to implement something like Josh Smith's CommandSinkBinding?

When I try to add a reference in the C++/CLI project I can only see System.Windows.Presentation and System.Windows.Forms.

Where a C# program can say

using System.Windows.Input;

I get an error in C++/CLI with

using namespace System::Windows::Input;

Error 1 error C2039: 'Input' : is not a member of 'System::Windows'

A: 

Are you missing the project reference? I usually notice this in Intellisense first...

Bryan
+4  A: 

You need to add the assembly that Input is in to your references. It's in PresentationCore

Lou Franco
Thanks, that helped. I didn't realise it was in PresentationCore rather than in System.Windows.Presentation!
Andy Dent
I was just looking it up. Will update answer with info
Lou Franco