I want to encapsulate frame navigation in custom command und use this command declaratively as a static ressource. I found
Frame.Navigate(typeof(MainPage));
which expects a type parameter (type of the target page) to navigate to. My first attempt was to use a generic ICommand implementation that passes the type of the target page as generic type parameter. As of x:TypeArguments is not supported for Windows Store Apps, I tried to define a property
public Type TargetType { get; set; }
for the command. But no luck again: if I try to set the property via a xaml attribute
`<NavigationCommand TargetType="MainPage">
I get a compile-time error saying
MainPage is not supported in a Windows universal project
This should work:
<NavigationCommand TargetType="ns:MainPage">
Where ns is an XML namespace prefix declared with xmlns:ns="using:TheNamespaceInCode"
(note: the x:Type markup extension used in WPF isn't supported in WinRT)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With