Skip to main content
Home Forums Silverlight Design Designing with Silverlight Dependency properties.
2 replies. Latest Post by vladc77 on November 5, 2009.
(0)
vladc77
Member
1 points
27 Posts
11-05-2009 2:19 PM |
Hello,
I am wondering if someone can share with the best technique on how to control the value change using the slider with dependency property in C#. I need to update the value change based on slider position. It is something new for me and I'd like to find out about the best way to approach this. Below is the XAML code of the slider I created. Thank you in advance.
<Slider x:Name="MaxAccelerationSlider" Margin="0" Maximum="3" Minimum="1.5" Value="2" AutoToolTipPlacement="TopLeft" TickPlacement="None" AutoToolTipPrecision="2" IsSnapToTickEnabled="True" ValueChanged="OnMaxAccelerationChanged" IsMoveToPointEnabled="True" TabIndex="4" TickFrequency="0.05" />
Sergey.L...
Contributor
7256 points
1,354 Posts
11-05-2009 6:58 PM |
Hi,
Look at Element To Element binding sample. Another one sample.
11-05-2009 7:27 PM |
Thank you for the reply, however, it is not what I am trying to solve.
I have a class "ScrollViewer" in which i control behavior of the scrolling. I want to be able to change the behavior by using the slider which is in a separate window. It is like a control box window. I created the partial class "Controls" where I define all controls in XAML. I need to pass the changed value from here to "MyScrollViewer" class.
In Controls.xaml.cs I am trying to use dependency property this way. It is just a concept:
{
}
I have problems to bind the value from the Slider and then to make it available for "ScrollViewer" class where "Globals.MaxAcceleration" should be the new set Value. I hope it make sence. It just new area form me which I am trying to learn how to manage it. Please let me know if you have any ideas on it. Thanks.