<Button Name="MyButton" Content="Test" FontStyle="Italic" />
In the above definition of a XAML button, the property FontStyleis set to Italic. The designer can somehow fill out the list for me to choose when I hit the sign =. How is this achieved?
Before you answer, consider that the property FontStyle, accordingly, has a type FontStyle(which is a structure). This is not an enumeration that would be trivial for VS to list it at design time, since a valid list of selected options will be displayed? There is also a separate class FontStylesthat contains three static fields: Italic,, Normaland Oblique, which, as it turned out, are the three elements that VS provides in the drop-down list. Is there some kind of mapping going on behind the scenes between the FontStylestruct class and FontStylesbecause I looked in many places in both the object browser and the .NET Reflector and could not identify any of them.
Thank!!
I NEED TO KNOW! *
* Not really, but it would be nice :)
source
share