michaelscodingspot / WPF_MVVMC

A WPF framework for navigation between pages with MVC-like pattern
MIT License
64 stars 18 forks source link

Optional ViewModel #10

Closed RobHudson72 closed 5 years ago

RobHudson72 commented 5 years ago

Question...

The documentation states that the ViewModel is optional, and that if one exists, then the DataContext is set to the ViewModel.

Does this mean that if you omit the ViewModel, then you can bind the view directly to the controller? If so, is there a simple code sample that demonstrates that?

michaelscodingspot commented 5 years ago

Hi,

The View never binds to the controller. If you omit the View, the DataContext is null.

RobHudson72 commented 5 years ago

Understood, thanks!

Get Outlook for iOShttps://aka.ms/o0ukef


From: Michael Shpilt notifications@github.com Sent: Sunday, May 12, 2019 2:44 AM To: michaelscodingspot/WPF_MVVMC Cc: Rob Hudson; Author Subject: Re: [michaelscodingspot/WPF_MVVMC] Optional ViewModel (#10)

Hi,

The View never binds to the controller. If you omit the View, the DataContext is null.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/michaelscodingspot/WPF_MVVMC/issues/10#issuecomment-491573213, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABTVJJEFCRDXC2GPMKIPESLPU7DENANCNFSM4HMJHYAQ.