Welcome Guest Search | Active Topics | Sign In | Register

Themable properties Options
Zan
Posted: Tuesday, July 17, 2007 4:24:31 AM
Rank: Newbie
Groups: Member

Joined: 7/15/2007
Posts: 4

It would be cool if the properties on the Menu Items / ElementStyle classes had the themable atrribute applied so we could use .net 2 skins.

cheers
eo_support
Posted: Tuesday, July 17, 2007 7:06:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi Zan,

Thanks for your suggestion. Our menu is way more powerful than .NET built-in controls, so .NET 2.0 theme mechanism actually can not cover many of our features. As such we have implemented our own property ControlSkinID on the menu. You can use that property to apply "skins", but the skins are not .NET 2 skins, they need to be a menu skin. The concept is the same, but the details are a bit different. You can find more details at here:

http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fLookSkinAndTheme%2fskins.html

Thanks
Zan
Posted: Tuesday, July 17, 2007 8:24:37 AM
Rank: Newbie
Groups: Member

Joined: 7/15/2007
Posts: 4
ahh, I agree the EO menu kicks ass. but the themes has nothng to do with the abilities of a control.

themes allow style properties on any object to be set via a skin file.
skin files in themes work the same way that your themes do. you define the properties exactly the same way.. and at runtime when the "Theme" is being applied it takes the applicable skin file.. matchs the SkinId's and set the property values. and thats all.

so the ability of the cotnrol is irrelevant.. the skin files int he themes are all about setting property values and they can be anything that your control tells them to be (public property with themable attribute)

so now all ya need to do is set the look and menu items with the ItemId and the SKinId .. and nothign else. ya can then define and change the appearance via skin files.. like all the other .net controls.

the good point for this is that if you use themes (which I do) then all of the customisation can be done in one place.. rather than having skins for some and ascx files for others... additionally. ascx files are nasty in a plugin framework as the ascx needs to be compiled. and then you need to use reflection helper classes to load them up. which is far more complicated than a single skin file.

thats my 2 cents. I have worked around the issue by using the page.parsecontrol and setting the menu from xml files with the aspx markup direct from the theme folders.. so tis working very similar to proper skins.. but still it requires a lot more code than otherwise would be required.
eo_support
Posted: Tuesday, July 17, 2007 8:42:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi Zan,

The ability of the control matters a lot. ASP.NET 2.0's theme mechanism works on the control level. It basically takes properties that you set on the "skin control" and applies it to the target control. It works on control level because only a control provides the basic infrastructure to support theme.

For most ASP.NET 2.0 controls, all customization options are directly on the control itself, so this works well. However, when the control itself has "sub objects" (in our case, a Menu "has" MenuGroup", which in term has "MenuItem", etc), this mechanism does not work because it does not define a standard logic to apply properties to these "sub objects". So basically you can use ASP.NET 2.0 theme to modify Menu's property, but not MenuGroup or MenuItem's property. This is useless for our menu and it is a limitation of ASP.NET 2.0 theme mechanism, not our menu.

Further more, ASP.NET 2.0 theme mechanism always overwrites the original settings. There may not be the desired result in many cases. In many cases, user wants to start from a theme and then overrides some of the settings. This is not possible with ASP.NET 2.0 theme.

Those are the reasons that we found ASP.NET 2.0 theme is not enough for our controls. Thus we have developed our own ControlSkinID property.

The ItemID and SkinID that you mentioned (or proposed) are already in place. We have a LookID property on MenuItem object, we also have a DefaultItemLookID on MenuGroup object. So you can make use of those property to simplify the process.

Thanks
Zan
Posted: Tuesday, July 17, 2007 9:02:46 AM
Rank: Newbie
Groups: Member

Joined: 7/15/2007
Posts: 4
The themes will apply to the Look and menuitems within the looks if they are laid out in the correct fashion within the skin. I can create a demo if you like of this I can create a class that inherits from the menuitem and ovreride some of the properties and set them via theme skins.

also skins will only apply to the properties that are defined in the skin. so if you wish to work from a base that is perfectly fine. the skin can only set values for proprties defined ... it dosent wipe the entire control blank first.

also I'm not referring to defining the layout via theme. thats impossible (unless you use the page.parsecontrol mentioned above) because the skins only set properties on existing objects.. they don't create new objects.

So again the ability of the control dosent matter. as we are only setting properties. if you can set those properties in aspx / ascx markup then you can do it via a skin.

the last thing I'd want to do is limit the EO controls functionality.. using .net 2 skin files definitely won't limit the controls functionality... it will only make it easier to change the style properties using a common mechanism.. which is exactly what we're loking for :)
eo_support
Posted: Tuesday, July 17, 2007 9:16:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi Zan,

The current version already does everything you described ---- when we implement ControlSkinID, we are not saying that you must use it, we implement it because we saw some limitations of the standard scheme mechanism and we added something to overcome it. The SkinID property is still there and you are still free to use it. SkinID is a property inherited from System.Web.UI.WebControls.WebControl and we do not do anything special about it. Everything related to this property is handled by standard ASP.NET theme mechanism ---- if that can handle everything you need, then it's all great.

Go back to your original question, we do provide LookID on MenuItem. You may find it useful even when you use ASP.NET 2.0 theme. If you can get ASP.NET 2.0 theme to correctly set the menu's LookItems to include certain look items and then correctly set the LookID on menu item, you are actually change the menu item's appearance indirectly via ASP.NET 2.0 skin file. Hopefully that can solve your problem.

Thanks
eo_support
Posted: Tuesday, July 17, 2007 9:33:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Related documentations:

LooksItems defines a set of "Looks" that menu items can refer via LookID property:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.Menu.LookItems.html

LookID:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.NavigationItem.LookID.html

Hope this helps.

Thanks
Zan
Posted: Tuesday, July 17, 2007 11:15:31 AM
Rank: Newbie
Groups: Member

Joined: 7/15/2007
Posts: 4
Aye I understand how the EO skins / look items works.

this thread has kinda gotten off topic. but i'll take the original request as a "no" and leave it at that :)
I already have my work around in place so tis no problem.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.