Skip to content

Data Pass Between viewmodel to xaml.cs

Bhupendra Niranjan

Asked Nov 5, 2017, 8:48 PM EST1 answer
Share
LinkedInX
Hi,
 
I am using MessageMedieter Jul Mar library to send message with Data from ViewModel to xaml. When i call SendMessage from view model Medietertarget  called twice.
 
SendMessage(Constants.Messages.HideBioMetricGif);
 
MessageMediater[Constants.Messages.HideBioMetricGif] -- called twice.
 
Kindly help. 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    You can a pass data from ViewModel to xaml by Data context 
    1.) Add  this line  "xmlns:VC="clr-namespace:(view model path)"  in window class inside .xaml class 
    2.)below this one Add 
    <Window.DataContext>
    <VC:PatientViewModel(file inside view model folder)></VC:PatientViewModel>
    </Window.DataContext>
      
    3.)Use comands to communication between View and view model.  
     
    0