Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Dependency property not initialized in OnPropertyChanged?

Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
Jared Bienz
Guest


 

Dependency property not initialized in OnPropertyChanged?

I have made my own class that derives from ModelVisual3D called
'PlayfieldView'. To this class I added a dependency property called
'SlotModel' of type GeometryModel3D. In XAML, I supply a property value
like this:

<gp:PlayfieldView.SlotModel>
<GeometryModel3D
Geometry="{DynamicResource TorusGeometry}"
Material="{DynamicResource ERRasterChecker}"
/>
</gp:PlayfieldView.SlotModel>

In my class, I have overridden OnPropertyChanged and I do get notified
whenever the property is set by the XAML deserializer. The problem is
that when the property is set, the Geometry and Material properies of
the GeometryModel3D instance supplied by the deserializer are both null.

I know the dynamic resources 'TorusGeometry' and 'ERRasterChecker' both
exist and I know they load just fine. If I create a Model3DGroup in XAML
and drop in a GeometryModel3D using those resource names the object
appears as expected.

Why are both geometry and material null when my dependency property is
set (OnPropertyChanged)? I would like to create an array of
GeometryModel3D instances based on the one applied to my dynamic
property and add them as the content of my specialized class at runtime.
I have the code written, but since the geometry and material are both
null, nothing appears in the scene.

Thanks,

Jared
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception: The ConnectionString property has not been initialized Justin Doh .NET General 3 04-03-2008 05:02 PM
WPF: Autogenerate a Private Dependency Property ? Jules Winfield .NET General 4 03-06-2008 09:43 AM
Binding to a custom dependency property diffeq Avalon 1 07-02-2007 01:42 PM
Trigger on user dependency property Griff Avalon 1 01-31-2006 06:59 AM
Paragraph.Text? Should there be a dependency property as well? Jason Dolinger Avalon 11 01-31-2006 06:59 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50