c# - Single object in view model base not updated in UI -


I have a visual model that uses the ViewViewloadBaze from the MVVLite framework. As follows:

  Public category WorkDayViewModel: ViewModelBase {Private IWorkDayServiceAgent _workDayServiceAgent; Private working day _ workday; Public work day weekday {return {workdays; } Set {// _ workDay = value; // RaisePropertyChanged (); Set (() => works, referee _workday, value); }} Public WorkView Model (IWorkDayServiceAgent Business Day Service Agent) {_workDayServiceAgent = workDayServiceAgent; } Public Emission Zero LoadworkCard (Date of Date) {Workday = Wait _ Workday Service. Gateworld (Date); } Public Zero Load Worker (working day workday) {_workDay = working days; }}  

I am obliged to do a WindowsPhonePage using the workday dataContext feature

   

I'm setting the data reference on the first item when the dialog is not shown in the OnNavigatedTo method.

  workDayViewModel.WorkDay = (works) navigation object cache.gate ();  

However, I have a button on that page to switch to another workaround for which I am using the following line in the code-back (from within the button event handler) I am

New ViewModelCooster (). WorkDayViewModel.LoadWorkDay (previousDate);

This should actually trigger an update on the workmodel in ViewModel, and therefore I used the RaisePropertyChanged and custom set () methods on an UI as you can see in the above HTML code But still there is nothing on the page, of course. Working day does not change debugge I expect to see taht weekday is definitely updated using the

So the question is:. Allthough I'm forced to use the UI data reference, changing the working day in the visual model, why the UI is not updated.

Here is my VLOOLDLOKETER. I am using a stable manufacturer, then each visual model is registered only once.

  Public class ViewModelLocator {Public WorkDayViewModel WorkDayViewModel {{get returned SimpleIoc.Default.GetInstance & Lt; WorkDayViewModel & gt; (); }} View StaticModelLocator () {ServiceLocator.SetLocatorProvider ((=) = SimpleIok Default); // Services SimpleIoc.Default.Register & lt; IWorkDayServiceAgent, MockWorkDayServiceAgent & gt; (); // View Model SimpleIoc.Default.Register & lt; WorkDayViewModel & gt; (); Please use your Xaml locator to get data reference:  
  DataContext = "{ViewModelName binding, source = {StaticResource locator}} "& Gt;  

In addition, you should have a parasail cellar in your view-model.

And another: To obtain a reference to the visual model in the subsequent visual code:

  var vm = datacontent as ViewModelName;  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -