Question using Trigger instead of Code-Behind event

Dec 21, 2011 at 8:54 PM

Hello Tony,

Thank you for providing this framework.  I've built a sample in WPF to familiarize myself with your framework and MVVM in general. I have a common scenario when in a popup detail (child) view to have a Save button which commits the changes to the database and then closes the view.  I can call a Save method in the child viewmodel using a Trigger, but I don't see how to close the child view without using the close() method in the code-behind module. Is this a case where I have to use child's code-behind to call viewmodel.Save() and then Close()?


Burton Roberts

Dec 22, 2011 at 3:08 AM

Hello again,

I just watched Part 2 of your screen cast, and see that you have no issue with using code-behind.  So, I guess I won't have an issue with it either.  You may ignore the original question.


Burton Roberts

Dec 28, 2011 at 3:22 PM

Yes, I'm usually not in favor of zero code-behind, unless your organization has a team of graphic designers using Blend.  But in most cases, it's the developer working in XAML and the code.  So some code-behind is necessary and can save time and effort.