如何继承通用基类窗口 [英] How to inherit a generic base class window

查看:101
本文介绍了如何继承通用基类窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么,WPF在XAML中添加了对泛型的新支持?但它似乎仍然缺少一些基本的支持,或者我如何解决这个问题:

我希望有一个通用的基类,我的所有窗口都继承了它。该类看起来像这样:



  public   abstract   class  CoreBaseWindow< TCollection,TEntity> :窗口

解决方案

不幸的是,我们没有时间添加泛型(和其他XAML2009功能)给编译器和设计师。 它们目前只能作为松散的xaml工作。

在Rob的博客上有更多信息 http://blogs.windowsclient.net/rob_relyea/archive/2009/05/20/yes-xaml2009-isn-t-everywhere-yet.aspx

So, WPF has added new support for generics in XAML? But it still seems to miss some fundamental support, or how do I solve this:

I want to have a generic base class that all my windows inherit from. The class looks like this:

public abstract class CoreBaseWindow<TCollection, TEntity> : Window

解决方案

Unfortunately, we didn't have time to add generics (and other XAML2009 features) to the compilers and designers.  They currently only work as loose xaml.

There's more information at Rob's blog http://blogs.windowsclient.net/rob_relyea/archive/2009/05/20/yes-xaml2009-isn-t-everywhere-yet.aspx


这篇关于如何继承通用基类窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆