Category Archives: WPF

Commanding within DataTemplates in MVVM!

A quick post about setting commands within DataTemplates when using the MVVM pattern! When you are inside a DataTemplate the DataContext is changed to the  the current item, so to access the command you will need to use the “relative source” Something like <Button Content=”Delete” Width=”Auto” Command=”{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}}” CommandParameter=”{Binding}”> Hope this […]

Improving WPF/Silverlight- WCF Communication!

While working on a recent assignment related to establishing and optimizing duplex communication with Silverlight and WCF,we learnt quite a lot of new concepts like HttpPollingDuplex binding  with multiple messages mode Http Long Polling designs etc. While most of these concepts were new we did get a bulb flash on how to improve basic WPF/Silverlight […]