tags:

views:

105

answers:

1

Hello, I have a little problem.

I have a window that the main content is a UserControl. The user control is a ItemsControl formatting a list. In the window, I have a slider that zoom the ItemsControl.

The problem is that in the windows I have created the UserControl, and I have not direct access to the ItemsControl and if I zoom the UserControl, I zoom everything (inclusive the scrollviewer).

The question is: ¿How can I access to the ItemsControl inside the UserControl on the window? Im thinking about Binding the UC and go the ItemsControl with de Path, but I think that is a wrong idea.

Thank you.

+2  A: 

You could create a dependency property on your UserControl for the zoom level and bind the ItemsControl zoom to that. You can then manipulate (or bind to) the zoom property from your window.

On a side note, perhaps the slider belongs inside the UserControl...

AndrewS
Uhm, if the thing is about Dependency Properties, I will check that thing again because I think that the DP are the hard part of WPF.The slider will be on a status bar and that status bar is in the window.Thank you AndrewS.
Jesus Rodriguez
+1.. data bind the Usercontrol to the slider's value.
Gishu
Well, I will mark this answer as valid. I was sick and tried today with the DP. Thank you AndewS
Jesus Rodriguez