Click here to Skip to main content
15,901,373 members
Home / Discussions / WPF
   

WPF

 
QuestionEvents between user controls Pin
David_ml_G14-Sep-10 9:35
David_ml_G14-Sep-10 9:35 
AnswerRe: Events between user controls Pin
AspDotNetDev14-Sep-10 10:18
protectorAspDotNetDev14-Sep-10 10:18 
QuestionRe VS2003 error Pin
Ajay Kale New13-Sep-10 17:32
Ajay Kale New13-Sep-10 17:32 
AnswerRe: Re VS2003 error Pin
Pete O'Hanlon13-Sep-10 22:26
mvePete O'Hanlon13-Sep-10 22:26 
AnswerRe: Re VS2003 error Pin
Abhinav S19-Sep-10 19:57
Abhinav S19-Sep-10 19:57 
QuestionGetting the size of a control Pin
WebMaster13-Sep-10 9:47
WebMaster13-Sep-10 9:47 
QuestionRe: Getting the size of a control Pin
PumbaPumba27-Sep-10 6:44
PumbaPumba27-Sep-10 6:44 
QuestionMVVM and the ViewModelLocator Pin
Mycroft Holmes11-Sep-10 23:36
professionalMycroft Holmes11-Sep-10 23:36 
I'm struggling to identify the correct way to move from one control to another using MVVM. I have implemented the navigation framework and MVVMLight. UserVM is the viewmodel and it is a static property the ViewModelLocator
public static UserDetailsVM UserDetailsVMStatic
{
    get
    {
        if (_UserDetailsVM == null)
        {
            CreateUserDetailsVM();
        }
        return _UserDetailsVM;
    }
}



So I have a control with a list of users in a datagrid, the user clicks on the hyperlinkbutton and navigates to the details form. The ID is correctly passed via the navigation but I'm not using it yet as I expect to use the existing VM.

The details control binds to the static VM and should show the selected user details from the datagid control (this works within the same page).

This control binding does not return the selected user details but the FIRST users details.
DataContext="{Binding UserDetailsVMStatic, Source={StaticResource Locator}}" 


The textbox binding should show the user details of the selected user from the list page
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding EditableUserDetails.Email, Mode=TwoWay}"/>


Except I already have a VM created to service the datagrid control and it has the selected item in a property.

How can I use the existing VM in the details form.
Do I have to chase through the staticresource dictionary to get the VM from the locator or is there a way to do this in XAML.
Never underestimate the power of human stupidity
RAH

AnswerRe: MVVM and the ViewModelLocator - Solved Pin
Mycroft Holmes14-Sep-10 16:06
professionalMycroft Holmes14-Sep-10 16:06 
QuestionWPF custom control DepencyProperty Pin
wpfcomputer11-Sep-10 9:12
wpfcomputer11-Sep-10 9:12 
AnswerRe: WPF custom control DepencyProperty Pin
Abhishek Sur11-Sep-10 10:54
professionalAbhishek Sur11-Sep-10 10:54 
GeneralRe: WPF custom control DepencyProperty Pin
wpfcomputer11-Sep-10 11:26
wpfcomputer11-Sep-10 11:26 
GeneralRe: WPF custom control DepencyProperty Pin
Abhishek Sur12-Sep-10 1:50
professionalAbhishek Sur12-Sep-10 1:50 
GeneralRe: WPF custom control DepencyProperty Pin
wpfcomputer13-Sep-10 12:35
wpfcomputer13-Sep-10 12:35 
GeneralRe: WPF custom control DepencyProperty Pin
Abhishek Sur13-Sep-10 12:54
professionalAbhishek Sur13-Sep-10 12:54 
QuestionHow to implement RTL/LTR button in RichEditBox? Pin
Yariv10-Sep-10 20:16
Yariv10-Sep-10 20:16 
QuestionSynchronization Pin
arkiboys10-Sep-10 18:36
arkiboys10-Sep-10 18:36 
AnswerRe: Synchronization Pin
Abhinav S10-Sep-10 18:44
Abhinav S10-Sep-10 18:44 
QuestionHow to detect the pressed key? Pin
dbrenth10-Sep-10 9:26
dbrenth10-Sep-10 9:26 
AnswerRe: How to detect the pressed key? Pin
Abhinav S10-Sep-10 18:40
Abhinav S10-Sep-10 18:40 
GeneralRe: How to detect the pressed key? Pin
dbrenth13-Sep-10 3:32
dbrenth13-Sep-10 3:32 
AnswerRe: How to detect the pressed key? Pin
Abhinav S13-Sep-10 5:04
Abhinav S13-Sep-10 5:04 
GeneralRe: How to detect the pressed key? Pin
dbrenth13-Sep-10 5:19
dbrenth13-Sep-10 5:19 
Questionsetting visibility of label in wpf Pin
sumit703410-Sep-10 0:42
sumit703410-Sep-10 0:42 
AnswerRe: setting visibility of label in wpf Pin
#realJSOP10-Sep-10 1:33
professional#realJSOP10-Sep-10 1:33 

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.