views:

27

answers:

0

I'm continuing to learn Silverlight and dependency properties by recreating controls. In this case, it's a scrollbar.

My scrollbar works, which is amazing, but with one problem. I have the slider width based on the LargeChange value and control width. The properties themselves correctly reflect the default values, but the slider width is set by a private method called by the OnLargeChange callback.

Obviously, the callback isn't called because the property isn't changed. So how am I to get the slider width set correctly based on the width of the control after it's been created? Can't do it in the constructor because the control's Width is NAN and the ActualWidth is 0. Can't create a multi-binding in Silverlight, either. Do I bind the slider width to a converter that takes the control width as a parameter or something?

Thanks in advance!