I have two buttons - in and out - created in WindowsForms
When these are clicked they called a method within my hosted usercontrol - zoomin and zoomout.
In my usercontrol I have a property - zoomlevel - which is increased by 0.1 and decreased by the same once these buttons are clicked.
I then have the property zoomlevel bound to the scaletransform of my entire usercontrol -
Though nothing happens, and ideas?
Though when I bind the scalex and scaley to a slider value within the same usercontrol, applying the same logic it works perfectly!
Urema.
Martin CookPosted Feb 10, 2010, 9:58 AM
I'm assuming the data context isn't set as expected.
I would suggest using Relative Binding to bind to dependency properties on your usercontrol: -
{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=ZoomLevel}
I hope this helps.
Cheers,
Martin