|
|
|
date: Tue, 7 Jun 2005 15:00:12 +0200,
group: microsoft.public.windows.developer.winfx.avalon
back
Re: Custom transforms
Our basic scene/graphics primitive types are not generally subclassable as
this is not an intended point of extensibility in our system. By ensuring
that these types are sealed (or abstract with internal abstract methods, as
in Transform, Brush, etc), we are able to Freeze/Clone these objects as well
as "flatten" and re-instantiate as necessary for perf, and this would become
much more cumbersome if the full type weren't "known" a priori. Since these
types are DependencyObjects, you're certainly welcome to attach and
additional *data* which you may wish to attach, just not subclass and add
code. (Note that there are a few known issues with our current handling of
attached properties (e.g. I believe they don't copy during a clone), but
we're actively addressing them).
We'd be interested in knowing what problem you're trying to solve by
subclassing. Does using attached properties work? If not, is it something
you can implement as a databinding on the Matrix property of a
MatrixTransform which refers to a business object you control?
The actual method you see below is somewhat misleading, as it just happens
to be the first internal abstract method you encounter preventing a
derivation - this is simply an implementation detail.
-Adam Smith [MS]
"Vash" <vashist.s [at] gmail.com> wrote in message
news:ek0nYD2aFHA.1456@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> Is the Transorm class intended to be inheritable? I.e. are developers
> allowed to write their own transform class?
>
> I'm asking this because I just tried to create a class that inherits from
> Transform. In the Transform class there is a function
> AddRefOnChannelCore(ByVal channel As Channel) As ResourceHandle that is
> marked *MustOverride*. No, problem, except that the Channel class in
> System.Windows.Media.Composition seems not to be publicly accessible. In
> fact the whole namespace is hidden.
>
> Can someone motivate why it's like this? Clearly I'm missing some
> knowledge about the internal workings of Avalon.
> Thanks,
> Vash
>
date: Sat, 18 Jun 2005 23:03:31 -0700
author: Adam Smith [MS]
|
|