Microsoft Developer Network > Página principal de foros > Visual Studio WPF Designer > How can I access control from View inside ViewModel?
Formular una preguntaFormular una pregunta
 

PreguntaHow can I access control from View inside ViewModel?

  • miércoles, 24 de junio de 2009 13:14kunal2383 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi,

    I am using WPF 3.5. I am newbie to MVVM.

    I created a sample application in WPF MVVM model.
    I want to access my usercontrol/properties which are available inside my View from the ViewModel.
    I didn't find any way. I tried it lot.

    Can anyone please help me to resolve it? I need the way asap.


    (Please mark as Answer, if this resolved your query. Thanks...) Regards, -- Kunal Chowdhury (My Blog)

Todas las respuestas

  • viernes, 26 de junio de 2009 4:45MubaragALi Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi microsoft-kc,

    I would like to know some of the things for my understandings,

    1. you want to access usercontrol in the sense, are you going to bind values to the controls ?

    If you want to bind any controls in the usercontrol, then you can set those values to any properties in ViewModel and bind through XAML.
    Or else if you want to simply set any values for your usercontrol properties, then you can do all the stuffs in xaml code itself.

     

    Thanks, Mubarag Ali
  • martes, 30 de junio de 2009 0:43Mark Wilson-ThomasMSFT, ModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hi All

    This forum is for discussions about the WPF and Silverlight designers in Visual Studio.

    Since this is more of a platform discussion, it might get better answers at http://social.msdn.microsoft.com/Forums/en-US/wpf

    Thanks
    Mark


    Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'