Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Dependency property not initialized in OnPropertyChanged?

 
 
Old 01-10-2006   #1 (permalink)
Jared Bienz


 
 

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

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Exception: The ConnectionString property has not been initialized .NET General


Vista Forums 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 Ltd

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