![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 |
![]() |
| 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 |