I need to use InkCanvas (which is part of UWP Windows.UI.Xaml.Controls) in a WPF application. I know the WPF has InkCanvas too but they are totally different. The UWP InkCanvas has also InkAnalyzer which I need for handwriting recognition.
I created a fresh WPF app and added references bellow:
In MainWindow.xaml.cs When I try to create a new InkCanvas I get an error:
System.Exception: 'The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))'
public MainWindow()
{
InitializeComponent();
Windows.UI.Xaml.Controls.InkCanvas myPage = new Windows.UI.Xaml.Controls.InkCanvas();
}
My question is, is there a way to use UWP controls (especially InkCanvas in my case)in a WPF app?
Not possible today, but it's something that is on the roadmap for a future update.
User contributions licensed under CC BY-SA 3.0