Accessing ImageButton Contents
Posted
by Bill
on Stack Overflow
See other posts from Stack Overflow
or by Bill
Published on 2010-04-07T14:43:34Z
Indexed on
2010/04/07
14:53 UTC
Read the original article
Hit count: 692
I am representing a Solar-System's planets with ImageButtons that show the planet's image on the surface of the button, and hold the planet's important data.. name, distance from sun, etc within an instance of a Planet
class, stored within the ImageButton.Content
property. When the ImageButton
is selected, I am attempting to access and display the Planet
class's data for the selected Planet
. Although ((ImageButton)e.OriginalSource).Content
permits viewing all of the Planet
class's properties in the debugger, I haven't figured out how to access the Planet class properties directly, as in Pluto.DistanceFromTheSun
? Is it possible to access the Planet class information held in the ImageButton
contents directly?
© Stack Overflow or respective owner