You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class PageEx<T> : Page{
{
[Reactive]
public T ViewModel { get; set; }
public PageEx()
{
this.ViewModel = Activator.CreateInstance<T>();
}
}
}
namespace myApp.Views
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class BlankPage1 : PageEx<BlankPage1ViewModel>
{
public BlankPage1()
{
this.InitializeComponent();
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried to add a generic type like this:
But when I compile the app, it keeps alerting me in the BlankPage.g.i.cs :
The generic type I declared in xaml does not work..
Beta Was this translation helpful? Give feedback.
All reactions