I would like to know the same as this:
Silverlight 4 Support x: TypeArguments
... but for Windows 8 Store Apps.
Why are x: TypeArguments available if it doesn't work? Or am I missing something? The MainPage.igcs file is automatically generated with a non-primary base class, although x: TypeArguments is defined in XAML - therefore, of course, it does not compile.
I can get it to work with the proposed workaround for having a "typedef" base class that defines a generic type, but that seems pretty hacky to me.
internal abstract class PageBase<T> : Windows.UI.Xaml.Controls.Page where T : ViewModelBase
{
protected abstract T ViewModel { get; }
...
}
internal abstract class MainPageTypeDef : PageBase<MainViewModel>
{
}
internal sealed partial class MainPage : MainPageTypeDef
{
}
<views:PageBase
...
x:Class="Namespace.MainView"
x:TypeArguments="store:MainViewModel">
Does anyone know if there is a way to not have a typedef class?
Thanks a lot John