Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用泛型扩展winrt控件_C#_Xaml_Generics_Windows Runtime - Fatal编程技术网

C# 如何使用泛型扩展winrt控件

C# 如何使用泛型扩展winrt控件,c#,xaml,generics,windows-runtime,C#,Xaml,Generics,Windows Runtime,我正在尝试在winrt应用程序中扩展页控件。总的想法是 MyControl.xaml: <local:MyPage x:Class="MyControl" .. > ... ... ... </model:MyControl> public Class MyPage<T> : Page { } ... ... ... MyControl.xaml.cs

我正在尝试在winrt应用程序中扩展页控件。总的想法是

MyControl.xaml:

   <local:MyPage
      x:Class="MyControl"
      ..
   >
    ...
    ...
    ...
   </model:MyControl>
    public Class MyPage<T> : Page
    {    
    }

...
...
...
MyControl.xaml.cs

    public sealed partial class MyControl: MyPage<aModelClass>
    {
     ...
     ...
    }
公共密封部分类MyControl:MyPage
{
...
...
}
MyPage.cs:

   <local:MyPage
      x:Class="MyControl"
      ..
   >
    ...
    ...
    ...
   </model:MyControl>
    public Class MyPage<T> : Page
    {    
    }
公共类MyPage:Page
{    
}
所以,我的问题是,是否有可能以这种方式使用泛型,如果有,如何使用?? 我在xaml文件中找不到处理泛型的方法,另一方面,我在谷歌上找不到任何关于这个问题的信息

问候 /lg