according to this page https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/binding-property
(根据此页面https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/binding-property)
I'm writing the following code
(我正在编写以下代码)
/*cl /nologo /Yupch.h /bigobj /await /std:c++latest /EHsc /I. demo.cpp pch.obj /link /winmd /out:appxApp.exe /subsystem:console /appcontainer*/
struct MainPage : PageT<MainPage>
{
MainPage()
{
Application::LoadComponent(*this, Uri(L"ms-appx:///MainPage.xaml"));
}
void ClickHandler(Windows::Foundation::IInspectable const& /* sender */, Windows::UI::Xaml::RoutedEventArgs const& /* args */)
{
cout << __func__ << endl;
}
};
and the MainPage.xaml page is as follow
(和MainPage.xaml页面如下)
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Button Click="ClickHandler">click</Button>
</Page>
but it seems that the MainPage::ClickHandler never got called , so , what is the right way ?
(但是似乎从未调用过MainPage :: ClickHandler,那么正确的方法是什么?)
many thanks! (非常感谢!)
ask by oldoldman translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…