Category: Blend

Default Focus Behavior

I would love to share with you guys about Default Focus Behavior which I just created an hour ago because I thought this behavior would be very handy.

With this behavior, we would be able to set focus to any controls when we trigger any control events.

For example, whenever we click the button, we want to textbox got focused, or when we select the Option 1 for the very first time, the textbox will get focused as below image.

defaultfocusbehavior_demo

To set the focus for a control only once, all we have to do is set

IsOnceOff = “True”

Click the icon below for the source code, so you can have a play with it

Hopes this helpful 🙂

Advertisements

TextWraping in Silverlight

Just a little thing I came across when I am trying to set TextWraping property for a TextBox, but the text doesn’t seem to be wrapped. Then I realized if the TextBox is setting with TextWraping greater than 1, the text won’t be wrapped. Just a little thing to keep in mind 🙂