Silverlight / WPF - how to fetch the new value of the slider value changed

Asked By Ramachandran on 29-Jun-12 09:30 AM
Earn up to 10 extra points for answering this tough question.
Super Man replied to Ramachandran on 29-Jun-12 01:34 PM

<Slider ValueChanged="Slider_ValueChanged"></Slider>


      private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)

      {

        Double newValue = e.NewValue;

        //... use newValue

      }


DL M replied to Ramachandran on 30-Jun-12 02:56 AM
Using JQuery try setting the value using the "value" method, then calling the slider "refresh" method like this:

$('.your-slider').val('20');
$('.your-slider').slider('refresh');
[)ia6l0 iii replied to Ramachandran on 01-Jul-12 09:45 AM
The ValueChanged event provides the RoutedPropertyChangedEventArgs which has the old value and the new value properties. 

private void newSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
        double oldValue = e.OldValue;
double newValue = e.NewValue;
}


Hope this helps.
help
how to bind the silverlight slider value to the datagrid in mvvm. refer me one example. . . . . . . . In MVVM, we need to bind the slider value to a ViewModel property Slider Name = "sampleSlider" Minimum = "1" Maximum = "100" Value = "{ Binding SomeProperty , Mode = TwoWay}" ValueChanged = " sampleSlider _ValueChanged" / > And value; } } And then you use the viewmodel with the datagrid. Otherwise, you can use the slider DragCompleted event handler to make updates to the datagrid. Follow this link- http: / / stackoverflow.com / questions / 5324758 / wpf-problem-with-binding-the-event-for-slider-control-using-mvvm Hope this will help you, keywords: Silverlight, Silverlight WPF, WPF, DragCompleted, Otherwise
Plse help me and provide me some example codings and screen shot examples on binding slider in silverlight MVVM Pattern The Model-View-ViewModel (MVVM) pattern provides a flexible way to build Silverlight applications that promotes code re-use, simplifies maintenance and supports testing. Follow this link- http www.silverlight.net / learn / advanced-techniques / the-mvvm-pattern / using-the-mvvm-pattern-in-silverlight-applications Here you will get sample application for this. This will also helpful for you
Dear Friends, How to Do ZoomIn and Zoomout in Silverlight.Using Slider, or Anyother Way Possible Suggest. Thanks and Regards, Munna < Grid x : Name = "Layout" Background = "Black msdn.com / aonishi / archive / 2007 / 11 / 28 / how-to-add-the-zooming-feature-for-your-silverlight-page-turn-application-with-silverlight-1-0.aspx Hope this help. keywords: RoutedEventArgs, Silverlight, Page, Silverlight WPF, WPF, Slider, ZoomIn, Click description: Zoom In and ZoomOut Dear Friends, How to Do ZoomIn and Zoomout
i have binded the slider as a item to the Silver light listbox, the slider value is binded properly during the load time from the database. but when i changed the slider value from its valuechanged events its values are not affected for the first time. i.e the value of the slider is binded to the datagrid. when i changed the slider value its changed value to be binded in the silverlight datagrid. but it is affecting for second time. during first time its not affected. . . here
what is ancestor binding and ancestor level and relative source binding in silverlight 5. . i have binded the listbox with in the scrollviewer and i am having the slider as the item in the listbox when even i scroll the scroll viewer vertically up and down my slider values are changed. . . plse tell what is the problem with this. this is my xaml code. where i want to change this to not to affect the slider value when scrolling up and down. here is my xaml code. <navigation:Page xmlns:sdk Name" SelectedValuePath = "ID" ItemsSource = "{Binding Path = EntityObjects, Mode = TwoWay}" SelectedItem = "{Binding Path = ToMonthPercentSelectValue, Mode = TwoWay}" / > - -> <Slider Name = "WireFrameSlider" Orientation = "Vertical" Minimum = "{Binding ElementName = MinPercen, Path = Text, Mode = TwoWay}" Maximum = "{Binding ElementName Triggers> <i:EventTrigger EventName = "ValueChanged"> <i:InvokeCommandAction Command = "{Binding CalculateConsolidatedFactors}" / > < / i:EventTrigger> < / i:Interaction.Triggers> < / Slider> <TextBlock FontWeight = "Bold" Text = "Effect" Grid.Row = "0" Grid.Column = "6" Height = "27" Width = "90
How to bind the slider control with in the List box in silverlight MVVM plse provide me some example codings for it. . . . . . . Hi ramachandran, Try the Example Given difficulties. . . Thanks & Regards, Rajasekhar.R Hi. . . See the below code to bind the functionality of slider in a Listbox: You have to bind the Slider Element in a selectedindex. . < slider height = "162" horizontalalignment = "Left" margin = "56, 21, 0, 0" name = "slider1" value = "1" verticalalignment = "Top selecteditem needs to be a binding that is linked to the external control like a slider. <ListBox Name = "lstGrades" SelectedIndex = "{Binding ElementName = slidername, Path = someproperty, Mode = TwoWay}" / > Hope this helps. keywords: Silverlight, ListBox, WPF, Slider, list box description: How to bind the slider control with in the
<StackPanel HorizontalAlignment = "Center"> <Slider x:Name = "slider1" Minimum = "30" Maximum = "300" Value = "150" Width = "300" / > <Rectangle Fill = "Black" Height expression. See the below updated one. Notice the changes in bold text. <StackPanel HorizontalAlignment = "Center"> <Slider x:Name = "slider1" Minimum = "30" Maximum = "300" Value = "150" Width = "300" / > <Rectangle Fill = "Black" Height StackPanel> Let me know the results. tnx for ur help, its working now. . . . . . . . . . . . . . . . regards, keywords: Silverlight, Silverlight WPF, WPF, Binding, Path description: the following binding is not working plz help Tex. . . 28
Follow These links- http: / / forums.silverlight.net / t / 223925.aspx / 1 http: / / www.dotnetspider.com / forum / 292639-How-get-selected-item Grid.Column = "4" Width = "90" Height = "27" DataContext = "{ StaticResource VM }" Text = "{ Binding MinperValue , Mode = TwoWay}" / > < Slider Name = "WireFrameSlider" Orientation = "Vertical" Minimum = "{ Binding MinperValue , Mode = TwoWay}" Maximum = "{ Binding MaxperValue , Mode = TwoWay}" DataContext Height = "120" Grid.Row = "0" Grid.Column = "5" Grid.RowSpan = "3" Width = "30" Cursor = "Arrow"> < / Slider > < TextBlock FontWeight = "Bold" Text = "Effect" Grid.Row = "0" Grid.Column = "6" Height = "27" Width = "90 Grid.Column = "4" Width = "90" Height = "27" DataContext = "{ StaticResource VM }" Text = "{ Binding MinperValue , Mode = TwoWay}" / > < Slider Name = "WireFrameSlider" Orientation = "Vertical" Minimum = "{ Binding MinperValue , Mode = TwoWay}" Maximum = "{ Binding MaxperValue , Mode = TwoWay}" DataContext Height = "120" Grid.Row = "0" Grid.Column = "5" Grid.RowSpan = "3" Width = "30" Cursor = "Arrow"> < / Slider > < TextBlock FontWeight = "Bold" Text = "Effect" Grid.Row = "0" Grid.Column = "6" Height = "27" Width = "90 item should have another background colour and all controls should be in disable mode. . . . . . . . keywords: Silverlight, Silverlight WPF, WPF description: Accessing the selected index in the listbox in Silverlight MVVM by
Enter EggHeadCafe's free drawing for a license of Telerik RadControls for Silverlight 4 Q1 2010. Check out Peter Bromberg's product review and enter to win. * Update 2010 Free License Winner Jonathan Tryzbiak. There are a lot of control vendors in the Silverlight Space, with more coming on at an amazing clip. Telerik has been around since 2002 (Ancient History in .NET Terms!) and has been involved with the Silverlight platform since its very inception. I believe the key factors that distinguish Telerik from other are the very high quality of their control suite offerings (I have used both the Silverlight and the ASP.NET AJAX control suites), and secondly, their almost fanatical attention to product it, the attitude was pretty much "I don't care". RadControls are built on Microsoft Silverlight and include 40+ UI controls for building rich line-of-business Silverlight applications. These share the same codebase with Telerik WPF controls. The Silverlight controls offer a clean and intuitive API, Expression Blend support, Visual Studio 2010 and SharePoint