0
在MAXL,我可以实现这样添加pointermoved事件TextBlock的:如何使用XAML中的pointerMoved事件函数连接窗口小部件?
<TextBlock Text="Drag and Drop"
AllowDrop="True"
PointerMoved="TextBlock_PointerMoved"
/>
然后,我只需要实现的功能来完成的pointermoved工作:
TextBlock_PointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
但现在,我需要使用C++在代码区执行此操作,我将新建一个文本块,并在代码中创建所有内容。例如:
TextBlock^ my_textblock = ref new TextBlock();
my_textblock->SetValue(TextBlock::TextProperty, "My Text Block");
my_textblock->SetValue(TextBlock::WidthProperty, 100);
我应该怎么做连接与插件的pointermoved事件函数?希望如下:
my_textblock->SetValue(TextBlock::PointerMovedEvent, myPointerMovedFunction);
但它不起作用。 非常感谢。