microsoft / WPF-Samples

Repository for WPF related samples
MIT License
5.09k stars 3.2k forks source link

TouchKeyboard seems to depend on UWP #432

Open ite-klass opened 2 years ago

ite-klass commented 2 years ago

This repository is for WPF samples, but the TouchKeyboard example project seems to depend on UWP namespaces.

TouchKeyboardEventManager.cs imports Windows.Foundation and Windows.UI.ViewManagement.

The project does not compile for me even with the Windows SDK and VS 2022 UWP workflow installed due to the unknown namespaces. 7 references of the project do not resolve.

What am I missing?

dipeshmsft commented 2 years ago

Hey @ite-klass look at issue #417 . You need to modify the path to point at Windows.winmd from your system for the application to work.

ite-klass commented 2 years ago

The README says

If you have not installed it to its default location in "C:\Program Files (x86)\Windows Kits\10", you will have to update the reference to Windows.winmd in the project file to point to your installed SDK directory.

I expected the VS installer to install it under default locations. Is that not the case?

I do not have a file at C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd, but do for example at C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0\Windows.winmd.

I have 9 Windows.winmd files of various size under C:\Program Files (x86)\Windows Kits\ overall.

Adding the reference to the two csproj files changes nothing about the type not being found errors.

    <Reference Include="Windows">
      <HintPath>C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0\Windows.winmd</HintPath>
    </Reference>
1>------ Build started: Project: TouchKeyboardNotifier, Configuration: Debug Any CPU ------
1>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKeyboardNotifier\TouchKeyboardEventManager.cs(20,36,20,94): error CS0246: The type or namespace name 'TypedEventHandler<,>' could not be found (are you missing a using directive or an assembly reference?)
1>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKeyboardNotifier\TouchKeyboardEventManager.cs(20,54,20,63): error CS0246: The type or namespace name 'InputPane' could not be found (are you missing a using directive or an assembly reference?)
1>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKeyboardNotifier\TouchKeyboardEventManager.cs(20,65,20,93): error CS0246: The type or namespace name 'InputPaneVisibilityEventArgs' could not be found (are you missing a using directive or an assembly reference?)
2>------ Build started: Project: TouchKBRegister, Configuration: Debug Any CPU ------
2>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKBRegister\SxSDecorators.xaml(19,14): error MC3074: The tag 'TouchKeyboardAwareDecorator' does not exist in XML namespace 'clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier'. Line 19 Position 14.
2>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKBRegister\LotsOfStacking.xaml(21,18): error MC3074: The tag 'TouchKeyboardAwareDecorator' does not exist in XML namespace 'clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier'. Line 21 Position 18.
2>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKBRegister\MenuChild.xaml(10,6): error MC3074: The tag 'TouchKeyboardAwareDecorator' does not exist in XML namespace 'clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier'. Line 10 Position 6.
2>[redacted]\WPF-Samples\Input and Commands\TouchKeyboard\TouchKBRegister\MenuSibling.xaml(18,10): error MC3074: The tag 'TouchKeyboardAwareDecorator' does not exist in XML namespace 'clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier'. Line 18 Position 10.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
ite-klass commented 2 years ago

VS shows issues on the project references Accessibility, System.Windows.Forms, UIAutomationClient, UIAutomationProvider, UIAutomationTypes. but the build reports no errors regarding those.

image