Click here to Skip to main content
15,886,873 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to refer ViewModel from user-control code behind? Pin
sbkk16-Jan-12 11:54
sbkk16-Jan-12 11:54 
AnswerRe: How to refer ViewModel from user-control code behind? Pin
Mycroft Holmes16-Jan-12 13:07
professionalMycroft Holmes16-Jan-12 13:07 
AnswerRe: How to refer ViewModel from user-control code behind? Pin
Pete O'Hanlon16-Jan-12 22:29
mvePete O'Hanlon16-Jan-12 22:29 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
sbkk17-Jan-12 4:59
sbkk17-Jan-12 4:59 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
Pete O'Hanlon17-Jan-12 5:21
mvePete O'Hanlon17-Jan-12 5:21 
JokeRe: How to refer ViewModel from user-control code behind? Pin
Tom Delany24-Jan-12 11:25
Tom Delany24-Jan-12 11:25 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
Pete O'Hanlon24-Jan-12 12:22
mvePete O'Hanlon24-Jan-12 12:22 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
sbkk19-Jan-12 5:20
sbkk19-Jan-12 5:20 
Thank you very much Collin. This solution worked very well for me.
Can you please help me with one more problem? A listbox in the user control is not displaying any data. Here are the details :
The user control (ucPlane) datacontext is set to PlaneListViewModel. The PlaneListViewModel is having
a public property that provides an ObservableCollection of PlaneViewModel objects. This property is called PlaneList.
The listbox itemsource is set as follows :

HTML
<ListBox x:Name="lstPlane" 
                         ItemsSource="{Binding Path=PlaneList}"
                         >
</ListBox>


A Datatemplate defined in the
HTML
<UserControl.Resources>
section is defined as follows :
HTML
<DataTemplate DataType="{x:Type viewModel:PlaneViewModel}">
......
</DataTemplate>


Can you please provide an example or link to an appropriate example that does what I want to do? I searched on the net for a solution but they seem to be too complex for me. I just want to bind a listbox to an ObservableCollection by using 2 view models - PlaneListViewModel and PlaneViewModel.
GeneralRe: How to refer ViewModel from user-control code behind? Pin
sbkk25-Jan-12 3:44
sbkk25-Jan-12 3:44 
QuestionI wanna retrieve value from the hidden column in datagrid in silverlight 4 Pin
mdrizwan_115-Jan-12 18:35
mdrizwan_115-Jan-12 18:35 
AnswerRe: I wanna retrieve value from the hidden column in datagrid in silverlight 4 Pin
Mycroft Holmes15-Jan-12 20:59
professionalMycroft Holmes15-Jan-12 20:59 
GeneralRe: I wanna retrieve value from the hidden column in datagrid in silverlight 4 Pin
mdrizwan_115-Jan-12 22:03
mdrizwan_115-Jan-12 22:03 
GeneralRe: I wanna retrieve value from the hidden column in datagrid in silverlight 4 Pin
mdrizwan_116-Jan-12 23:28
mdrizwan_116-Jan-12 23:28 
QuestionAdding images to silverlight datagrid Pin
sudheesh kumar s14-Jan-12 0:51
sudheesh kumar s14-Jan-12 0:51 
AnswerRe: Adding images to silverlight datagrid Pin
AbhijeetB14-Jan-12 22:05
AbhijeetB14-Jan-12 22:05 
QuestionSlilverlight with WCF Pin
sudheesh kumar s14-Jan-12 0:36
sudheesh kumar s14-Jan-12 0:36 
AnswerRe: Slilverlight with WCF Pin
Pete O'Hanlon14-Jan-12 0:51
mvePete O'Hanlon14-Jan-12 0:51 
GeneralRe: Slilverlight with WCF Pin
sudheesh kumar s14-Jan-12 1:06
sudheesh kumar s14-Jan-12 1:06 
GeneralRe: Slilverlight with WCF Pin
Pete O'Hanlon14-Jan-12 2:18
mvePete O'Hanlon14-Jan-12 2:18 
QuestionSilverlight 5 DataGrid MouseLeftButtonDown Fails Pin
Mycroft Holmes13-Jan-12 21:06
professionalMycroft Holmes13-Jan-12 21:06 
QuestionUserControl as a TabItem Pin
Tom Delany12-Jan-12 5:15
Tom Delany12-Jan-12 5:15 
GeneralRe: UserControl as a TabItem Pin
Tom Delany12-Jan-12 9:14
Tom Delany12-Jan-12 9:14 
QuestionIs IEnumerable<> a sufficent type for WPF binding? Pin
Harry von Borstel12-Jan-12 3:16
Harry von Borstel12-Jan-12 3:16 
AnswerRe: Is IEnumerable a sufficent type for WPF binding? Pin
Pete O'Hanlon12-Jan-12 3:24
mvePete O'Hanlon12-Jan-12 3:24 
GeneralRe: Is IEnumerable a sufficent type for WPF binding? Pin
Harry von Borstel12-Jan-12 3:59
Harry von Borstel12-Jan-12 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.