c# - Catel custom View creation -


i create custom window , show without iuivisualizerservice catel.

the problem is: when create window, bind viewmodel it, seems view not react on properties changes.

i have done following:

var photo = new photo(); newphotowindow newphotowindow = new newphotowindow(); var viewmodel = new newphotowindowviewmodel(photo); newphotowindow.datacontext = viewmodel;  newphotowindow.showdialog(); 

is there way create via kind of viewlocator?

i have tried typefactory, not allow me put photo model viewmodel.

you shouldn't manually doing viewmodel creation in catel. it's done automatically.

this should sufficient:

uivisualizerservice.showdialog<newphotowindow>(); 

this automatically:

  1. resolve vm belongs newphotowindow (newphotowindowviewmodel or newphotoviewmodel).
  2. instantiate vm using iviewmodelfactory
  3. create window , set vm it

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -