Следующее, при компиляции, выдает «1 неразрешенных внешних объектов ...». Мой вопрос - каковы правильные параметры?
using namespace winrt;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Input;
xaml
KeyDown="Keyboard_keyDown"
.h
void Keyboard_keyDown(Windows::Foundation::IInspectable const& sender,
Windows::UI::Xaml::Input::KeyRoutedEventArgs e);
.cpp
void SettingsPage::Keyboard_keyDown(IInspectable const& sender,
Windows::UI::Xaml::Input::KeyRoutedEventArgs e) {...}
MainPage.xaml
<Page
x:Class="BlankAppKeypaderror.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BlankAppKeypaderror"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
KeyDown="Keyboard_keyDown"
>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button x:Name="myButton" Click="ClickHandler">Click Me</Button>
</StackPanel>
MainPage.h
Прагма один раз
включает "MainPage.gh"
пространство имен winrt :: DemoProblemApp :: реализовать {struct MainPage:MainPageT {MainPage ();
int32_t MyProperty();
void MyProperty(int32_t value);
void Keyboard_keyDown(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs e);
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
}; }
пространство имен winrt :: DemoProblemApp :: factory_implementation {struct MainPage: MainPageT {};}
MainPage.cpp
#include "pch.h"
#include "MainPage.h"
using namespace winrt;
using namespace Windows::UI::Xaml;
namespace winrt::DemoProblemApp::implementation {
MainPage::MainPage() {
InitializeComponent();
}
int32_t MainPage::MyProperty() {
throw hresult_not_implemented();
}
void MainPage::MyProperty(int32_t /* value */) {
throw hresult_not_implemented();
}
void MainPage::ClickHandler(IInspectable const&, RoutedEventArgs const&) {
myButton().Content(box_value(L"Clicked"));
}
void MainPage::Keyboard_keyDown(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs e) {
}
}
Я изменил обработчики (, h &, cpp) на следующие, и проблема существует: void Keyboard_KeyDown (Windows :: Foundation :: IInspectableconst & sender, Windows :: UI :: Xaml :: Input :: KeyRoutedEventArgs const & e);
2018-1207 - включены в файл .h
include