I'm creating this topic, not to flame about silverlight/wpf, but to get some ideas, why the property naming in Silverlight and probably WPF is different than in .net and WinForms.
I really like what Silverlight enables .net devs to quickly write web apps (relative to HTML+JS+CSS junk), but the naming just freaks me out.
IsEnabled when in Winforms you have Enabled.
HasCloseButton when in WinForms ControlBox / MaximumBox / MinimumBox
IsTabStop, TabIndex instead of TabStop, TabIndex. In Silverlight they are not bundled together. On WinForms they are next to each other on PropertyGrid.
Content / Header / Text/ instead of Text.
And Grid.Column / Grid.RowSpan / Grid. etc/ that really bugs me.
This really reminds me of good old VB6 days, when you had Caption / Text / Title on different controls.
Do you have any clue, why?
Before getting into the topic I'll just point out that Silverlight is not a tool for making web apps, it's a runtime that runs within a browser that already has the necessary dependencies, it is not vendor-neutral nor universally supported.
.IsEnabled only makes sense for read-only properties. I haven't done much Silverlight/WPF to know if .IsEnabled is read-only or writable.
I gather the .Text property in WinForms is a legacy from the Win32 window's requirement for a "Caption" string, WPF removes that requirement, which gave the control designers more freedom in appropriately naming properties.
IsEnabled reads better (ie: FooBar Is Enabled)
WPF/SL controls can have more than text for content and sometimes more than one "content" property
Attached properties. They're a way to set properties on a parent element that relate to that child element.
Winforms was finally released 6, or so years ago. The world has changed greatly, and better ways of programming, doing and naming things have resulted in WPF.
In winforms you only have properties, but you have dependency properties in WPF that allow for far greater flexibility. Yes, you can always compare things, and sometimes the older way seems better, but as a package, WPF and WPF/E are acres and acres better.
Prefixing properties with "Is" makes it obvious that they are booleans.
If you didn't know better, TabStop could be a number and get confused with
Using IsTabStop instead avoids this problem.
Grouping related properties by category rather than listing them alphabetically brings
IsTabstop and TabIndex closer together but the grouping could do with being more granular. The categories are often a little broad.
In Windows Forms, TabStop and TabIndex are usually in the small category
In WPF, IsTabStop and TabIndex are often in the large category
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.