I have a MVVM application. Well, it's not exactly 100% pure MVVM for various reasons, but I'm trying to follow its most important principles.
I want to call Foobar
method (which executes purely view-related logic) of MyUserControl
class contained in MyUserControl.xaml.cs
on Button
click. Both Button
and MyUserControl
instance exist in the same PageView
(whose data context is some irrelevant view-model).
<Button Click="Foobar"/>
doesn't work, because the stub appears in PageView.xaml.cs
instead of MyUserControl.xaml.cs
.
Is it possible to link Button
's Click event with Foobar
invocation in XAML?