简体   繁体   English

无法继承MediaElement类

[英]Unable to Inherit from MediaElement Class

I am trying to create a custom MediaElement , and the 1st thing I need is to inherit it from the MediaElement . 我正在尝试创建一个自定义MediaElement,我需要做的第一件事是从MediaElement继承它。

But this is simply not happneing when I try to inherit like following: 但是当我尝试如下继承时,这根本就不会发生:

CustomMediaControl : MediaElement
{

}

MediaElement is declared a sealed class -- cannot be inherited. MediaElement被声明为sealed类-不能继承。

Documentation is here: http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement(VS.95).aspx 文档在这里: http : //msdn.microsoft.com/zh-cn/library/system.windows.controls.mediaelement(VS.95).aspx

Depending on what you're trying to achieve this might not be suitable, but if you're using Silverlight have a look at the Silverlight Media Framework http://smf.codeplex.com/ . 根据您尝试实现的目标,这可能不合适,但是如果您使用Silverlight,请查看Silverlight Media Framework http://smf.codeplex.com/

It comes with a whole heap of features and it has it's own mediaelement, which you might be able to use as your base. 它具有大量功能,并且具有自己的中介元素,您可以将其用作基础。

Good luck, Ola 祝你好运,奥拉

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM