MSDN > 論壇首頁 > Visual Studio WPF Designer > How can I access control from View inside ViewModel?
發問發問
 

問題How can I access control from View inside ViewModel?

  • 2009年6月24日 下午 01:14kunal2383 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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)

所有回覆

  • 2009年6月26日 上午 04:45MubaragALi 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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
  • 2009年6月30日 上午 12:43Mark Wilson-ThomasMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    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'