What would I need to do to add behavior or (alternate) styling to the labels (at front of the value control, see yellow label in image below) in LightSwitch.
What I want to accomplish:
- Handle event on click.
- Change Font properties
Is this in anyway possible? (extension control/screen/shell/theme) And where to start.
Thursday, June 28, 2012 9:46 AM
- Edited by Ralf de Kleine Thursday, June 28, 2012 12:50 PM
If you just want to change the font style statically, try Pixata Controls extention.
To change them programmatically, such as on a button click, check out these threads:Thursday, June 28, 2012 12:33 PM
Hi Kyle ls,
I've noticed Pixata Controls but they don't offer the functionality I'm looking for.
I think my question wasn't as clear as it could be. I'm looking for a way to add behavior and styling to the label at front of the value (the yellow label in my initial question).
If I'm not mistaking the two links you provided also concern the value control.
rdkThursday, June 28, 2012 12:50 PM
I think you would need to split it into two controls. In the properties of your current text box, change Label Position to None.
Making "Recipe" clickable can be done in several ways depending on exactly what you want to achieve.
- Add a button and change the control type to Link (Though I'm not sure how you would change the style in this case, maybe Pixata though I'm not sure).
- Add a button and leave it as a button. Then create an image that is styled like you want and set that as the button image (though as I look to do that now, I can't figure out how to in RC, it used to be in the Properties window in V1).
- Entities that have static text can have the static text displayed as a link as well. Though getting this to look right is probably very difficult to achieve. I've only seen it done in Data Grids.
I think adding a button and changing it to an image of your styling is the easiest. At least, it was in V1. I'll have to poke around a bit more in RC to see how to achieve this functionality. Unless someone else can chime in and let us both know.Thursday, June 28, 2012 2:04 PM
You'll have to play around with it to get it just right. I suggest using the WYSIWYG by debugging the application and going to Design Screen. The below example is a work in progress because it's on a Modal Window which I don't think you can edit from the Design Screen so I'm doing it blind.
It involves a combination of Column and Row Groups. The Row Group being empty except for the Button in the Command Bar.
I've increased the size of my button but you can just keep the default height which should match the Text Box control.Thursday, June 28, 2012 3:55 PM
I agree it's a bit hacky. But Lightswitch being a fairly new product, sometimes the only solution to a problem is a hacky one. For instance, in V1, you could easily add an image to a button through the properties menu. But if you wanted to just display a static image, you needed to write an entire helper class to load it and display it.
Now in 2012 RC, adding a static image is a piece of cake. Though they seem to have removed the functionality to add an image to a button. As the product matures, you will be able to go back and remove hacks that were necessary at the time.Friday, June 29, 2012 1:18 PM
Thursday, July 05, 2012 4:07 PM
Going to try this out this afternoon. (just back from holiday)
(Later that day)
Changed my label (making it blue underlined) and added an eventhandler to capture the leftmousedown and it works like a charm!
Wednesday, July 11, 2012 3:08 PM
- Edited by Ralf de Kleine Thursday, July 12, 2012 5:35 AM