试图开始为Galaxy Watch开发小部件。在Visual Studio 2017中完成。使用.NET扩展(基于Xamarin)....使用Tizen仿真器(Wearable 5.0)进行调试。我正在尝试处理挡板旋转事件。这是最简单的代码:
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MainPage : CirclePage,IRotaryEventReceiver
{
public MainPage()
{
InitializeComponent();
}
public void Rotate(RotaryEventArgs args)
{
throw new NotImplementedException();
}
}
但我在旋转函数内部的breakPoint永远不会被触发...如果我在construktor中设置断点 - 它是肯定触发的 - 所以看起来环境很好(编译+部署+运行+附加......)任何想法有什么不对?
您似乎没有为IRotaryEventReceiver设置RotaryFocusObject属性。除非设置了RotaryFocusObject,否则不会调用IRotaryEventReceiver的RotaryEvent。
有关详细信息,请阅读API指南并考虑将以下行添加到Xaml文件中。 https://samsung.github.io/Tizen.CircularUI/guide/IRotaryEventReceiver.html
<w:CirclePage
...
x:Name="MyCirclePage"
RotaryFocusObject="{x:Reference MyCirclePage}">
如果您在VisualStudio上使用Wearable 5.0模拟器进行调试,则行断点也应该有效。以下是Tizen 5.0调试器当前支持的功能列表。 https://github.com/Samsung/netcoredbg/wiki/Features