Hi,
With creationfilter i'm adding custom buttons to the tile header with ButtonUIElement. I would like the styling of these buttons to be exactly the same as the existing buttons of the tile. Like the close button for example. Alternatively: if i use TileHeaderButtonUIElement instead of ButtonUIElement the styling by default is ok. However with TileHeaderButtonUIElement i'm unable to set a custom text or image.
What's the best way to add a button in the tile header with exactly the same styling?
Regards,
Jacob
Hi Jacob,
Thank you for posting in our forums.
What you could do in your case is to create a class that inherits ButtonUIElement and set defaults on it which would make it mimic the TileHeaderButtonUIElement. This way you will have ButtonUIElement functionality with TileHeaderButtonUIElement look.
I have attached a sample which demonstrates this suggestion.
Please let me know if you have any additional questions.
Hi Dimitar,
It's getting pretty close. Is there any way to set the hottracking like with the tileheaderbutton?
It worked like a charm.Thank you very much!
Regards,Jacob
Thank you for the reply.
Styling the button to look exactly the TileHeaderButtonUIElement will be difficult. The reason for this is because the TileHeaderButtonUIElement draws an image for itself. When it is not hovered it is just a transparent image with the symbol (close, enlarge, etc.). When the button is hot tracked the image that is drawn is specifically created by our visual designers for this.
You have two options here. Create a hot track image for your button that will look consistent with the hot track images of the TileHeaderButtonUIElements. The other option is to create appearance objects for the HotTrack states of the buttons and for your UIElement to override the DrawBack color method and use this appearance to draw the back color when the UIElement is hot tracked. This way you will achieve consistent look for the buttons.
I have attached a sample demonstrating the second approach.