To separate business action logic from presentation in a Silverlight app, you should be using commands. The logic for "Save Document" or "Post Invoices" really has no place in the page code behind, and certainly doesn't need to show up twice when invoked from both a button and a menu. Commands encapsulate logic for some business action, e.g. "Save Document". that can be bound declaratively in XAML. Commands also fit neatly into the MVVM pattern where the command itself lives in the ViewModel.
To create and use a command:
- Create a class that implement the ICommand interface. 'Easy-peasy' -- ...