Silverlight / WPF - How to bind the slider control with in the list box in MVVM

Asked By Ramachandran on 07-Jun-12 02:23 AM
How to bind the slider control with in the List box in silverlight MVVM plse provide me some example codings for it.......
RAJASEKHAR RAJENDRAN replied to Ramachandran on 07-Jun-12 04:32 AM
Hi ramachandran,

Try the Example Given in the Below link.
http://dotnetslackers.com/articles/wpf/Cascading-ListBox-Using-MVVM-in-WPF.aspx 

Try and Let me know if you faced any difficulties...

Thanks & Regards,
Rajasekhar.R
Neha Garg replied to Ramachandran on 07-Jun-12 05:18 AM

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" width="100" orientation="Vertical" maximum="{Binding Path=PhotoCount}"
  minimum="0" />
<listbox height="162" horizontalalignment="Left" margin="175,21,0,0" name="listBox1"
  verticalalignment="Top" width="120" displaymemberpath="PhotoName" selectedindex="{Binding ElementName=slider1, Path=Value, Mode=TwoWay}" />

 

 

 

 

 

[)ia6l0 iii replied to Ramachandran on 07-Jun-12 10:07 PM
Your 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.