【问题标题】:Content convert to Frame in UWP with c++使用 c++ 在 UWP 中将内容转换为 Frame
【发布时间】:2016-05-31 16:41:03
【问题描述】:

当我尝试转换内容 Windows::UI::Xaml::Window::Current->Content ---> Frame 时遇到问题。 在 c# 中,我使用这种方式,例如“Windows.UI.Xaml.Window.Current.Content as Frame”。 但在使用 C++/CX 的 UWP 中。我找不到路。我想使用 Frame->Navigate(TypeName(xx))。

【问题讨论】:

    标签: cocos2d-x win-universal-app c++-cx


    【解决方案1】:

    使用 dynamic_cast 将泛型类型 (Object^) 无异常地转换为更明确的类型 (Frame^),类似于 C# 的“as”转换。

    您的场景是 C++/Cx casting documentation 中为 dynamic_cast 给出的具体示例。

    【讨论】:

      猜你喜欢
      • 2021-12-14
      • 2013-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多