IconElement
doesn't have any public
(or protected
) constructors. A derived class needs to call a base constructor, therefore you can't create a derived class. FrameworkElement
on the other hans has a default parameterless protected
constructor that you can call from a derived class, therefore you can create a derived class.
For the SymbolIcon
class to be able to derive from IconElement
class, it still needs an accessible constructor in IconElement
class. Obviously there is an internal
constructor available in IconElement
class that it can access, because it is in the same assembly.
You can recreate the same scenario yourself. Create a class with only a single parameterless constructur that is internal
.
public class BaseClass()
{
internal BaseClass() { }
}
You can now create a derived class in the same assembly (it will be able to call this internal constructor), but you will not be able to do it from another assembly referencing this one (there will be no accessible constructors on the base class).
I'm not sure why exactly you want to derive from IconElement
class, but you won't be able to do it. Even the IIconElement
interface it implements is internal, so you won't be able to implement it yourself either.
Also, all of these classes are implemented natively, therefore you can't really decompile them. There's only managed metadata available in *.winmd
files that you can see if you try decompiling a class in e.g. ReSharper.