Posts tagged with , , , , , ,

  • Flyweight M-V-VM: Decorator revision

    Published by on October 19th, 2011 5:54 am under Code

    No Comments
    Revision: Behavior problems In my original post I provided a behavior (ViewModelBehavior) for provding a view model for the given DataContext.  The behavior saved away the original DataContext as the model, set DataContext of the AssociatedObject to the view model,  and passed the model to the view model. This worked in 90% of the basic... read more
  • Flyweight M-V-VM: POCO commands

    Published by on October 12th, 2011 8:33 am under Code

    No Comments
    M-V-VM encourages POCO view models M-V-VM is one of the design patterns that help separate concerns between presentation and data: The model is concerned with data and knows nothing of the view or view model. The  view is concerned with presentation.  It only knows about the view model or model through data binding. The view... read more
  • Flyweight M-V-VM

    Published by on September 28th, 2011 1:31 pm under Code, Design Patterns

    No Comments
    A better M-V-VM library There are several existing libraries that support the Model-View-ViewModel (M-V-VM) pattern. They each have some nice features. However, I didn’t find any that were just M-V-VM. Some required me to fundamentally restructure my XAML. Others required me to use dependency injection or implement a view model locator pattern. A few required... read more
  • WPF Behavior: Global Application Shortcut Keys

    Published by on March 15th, 2011 8:35 am under Code

    WPF Support WPF provides excellent support for shortcut keys: The InputBinding class supports Key, Mouse, and recently Touch gestures. An InputBinding can be associated with any UIElement using the InputBindings property. Custom controls that handle RoutedCommands can associate InputBindings using the CommandManager.RegisterClassInputBinding. The  CommandManager provides tunneling and bubbling of the commands allowing any control with a... read more
  • An improvement to INotifyPropertyChanged

    Published by on May 22nd, 2010 7:30 am under Code

    No Comments
    en español Awhile back, I needed to have one object calculate a total across a collection of items for a value that changed regularly.  Using a just-in-time calculation wasn’t efficient due to a large number of items and some complexity in the total calculation. I first tried implementing and using INotifyPropertyChanging.  This caused some small performance... read more