• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineQuestion about PropertyChanged eventQuestion about PropertyChanged event
Previous
 
Next
New Post
3/23/2012 8:28 PM
 
Jarzka
No Ranking

Joined: 2/5/2012
Posts: 19
Question about PropertyChanged event 

Many DigitalRune Gui elements seem to have PropertyChanged event. This event is fired up almost always when I even touch the element with my mouse. My understanding was that his event fires up only when I change the selected index of the item.

Is it possible to get some kind of SelectedIndexChanged event from DropDownButton objects?

 
New Post
3/24/2012 9:53 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Question about PropertyChanged event  Modified By HelmutG  on 3/24/2012 10:54:20 AM

The PropertyChanged event is a general event that is raised whenever a game object property is changed. This event is defined in the standard .NET interface INotifyPropertyChanged.

Several properties of UI controls (including the SelectedIndex property) are so-called "game object properties" or "UI control properties". These properties are special and they all have Changed events. Here is an article that describes how you can use the Changed event of a UI control property: http://www.digitalrune.com/Support/Bl... (see section Events).

 
New Post
3/24/2012 11:30 AM
 
Jarzka
No Ranking

Joined: 2/5/2012
Posts: 19
Re: Question about PropertyChanged event 
Okay, thanks for help :)
 
New Post
3/25/2012 3:19 PM
 
Jarzka
No Ranking

Joined: 2/5/2012
Posts: 19
Re: Question about PropertyChanged event 

I tried to subscribe DropDownButton SelectedIndex property:

GameProperty<int> dropDownButtonSlot1SelectedIndexProperty = dropDownButtonSlot1.Properties.Get<int>(dropDownButtonSlot1.SelectedIndex);

However I got a runtime error: Unable to cast object of type 'DigitalRune.Game.GamePropertyMetadata`1[Microsoft.Xna.Framework.Color]' to type 'DigitalRune.Game.GamePropertyMetadata`1[System.Int32]'.

 
New Post
3/25/2012 5:32 PM
 
MartinG
7th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 448
Re: Question about PropertyChanged event 

Each game object property has a unique ID. You need to use the ID to get the GameProperty<T> object. The following code should work:

GameProperty<int> dropDownButtonSlot1SelectedIndexProperty = dropDownButtonSlot1.Properties.Get<int>(DropDownButton.SelectedIndexPropertyId);
 
New Post
3/25/2012 5:57 PM
 
Jarzka
No Ranking

Joined: 2/5/2012
Posts: 19
Re: Question about PropertyChanged event 
Okay, it works. Thanks.
 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineQuestion about PropertyChanged eventQuestion about PropertyChanged event


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement