WPF PRISM DelegateCommand Wrappers in .NET 4.5

Tuesday, November 27, 2012

If you happened to implement an ‘ICommand’ for your presentation logic in WPF, and decided to contain PRISM’s DelegateCommand within your class and use its own mechanism of the ‘CanExecuteChanged’ event – Beware! Consider the following example - class CommandWrapper : ICommand { private readonly DelegateCommand _command; public CommandWrapper(Action execute, Func<bool> canExecute) { _command = new DelegateCommand(execute, canExecute); } public bool CanExecute(object parameter) { return _command.CanExecute(parameter); ...
tags: ,
2 comments

WPF – ComboView – ComboBox with a TreeView

Sunday, October 10, 2010

Update 26/09/2011 - There is an issue with the control where the entire tree is loaded, which may affect performance and memory allocation when working with many items. Unfortunately, I don’t think I would be able to fix that any time soon. A few years back, I built a WPF control that I decided to share here now. The control is called ComboView – A ComboBox showing a TreeView inside to display hierarchical data (you can use it for flat data if you need its features though). The control provides some really nice built-in...
tags: ,
19 comments

WPF – Editing Mode with Save and Cancel Capability – Serialization

Monday, August 9, 2010

In continuation of the previous posts - WPF – Editing Mode with Save and Cancel Capability WPF – Editing Mode with Save and Cancel Capability – Dynamic ViewModelProxy In this post I will demonstrate an elegant and simple solution that you can use regarding the second option presented in the first post series (cloning via serialization). The Use-Case Often, in more advanced scenarios, you need to duplicate your object for a different view. (read the first post for more detail) A commonly used technique is using serialization to clone the object....
tags: ,
one comment

WPF – Editing Mode with Save and Cancel Capability – Dynamic ViewModelProxy

Friday, July 23, 2010

Update 29/07: The project was updated, there was a minor bug in the object changed notifier. In continuation of a previous post - WPF – Editing Mode with Save and Cancel Capability In this post I will demonstrate an elegant and simple solution that you can utilize regarding the first option presented in the previous post. The Use-Case If you want to open an editable view over an existing read-only view with cancel capability, you usually wish you could use the same ViewModel instance as the DataContext. However, this...
tags: ,
no comments

WPF – Editing Mode with Save and Cancel Capability

Saturday, July 17, 2010

A common scenario that is required by applications is the ability to show an entity in a view mode, and when the user wishes to edit that entity, another view is loaded in edit mode. In most cases, you would allow the user to save or cancel his changes. To illustrate the concept, consider the following interface - When a user clicks ‘Edit’: ...
tags: ,
no comments

WPF – A Cool Feedback Control – 3D Book View Switching

Saturday, July 10, 2010

Update 29/07: The project was updated, there was a minor bug in the object changed notifier. A few years back I was looking for a good place to start with for building a nice feedback control. The purpose was to allow end-users to provide feedback on the application on any given subject. After browsing the internet, I found the following - Creating a 3D book-shaped application with speech and in using WPF 3.5 by Roberto Sonnino. It’s a very cool and a beautiful project, nice work Roberto! To make...
tags: ,
no comments

WPF PRISM (CAL) / MVVM – DelegateCommand Extensions – Part 2

Saturday, July 3, 2010

Update 29/07: The project was updated, there was a minor bug in the object changed notifier. Be sure to read the first post - Part One After showing the most basic in part 1, let’s see a real-life example of my finalized solution. I created a sample application which looks as follows - Let me go through this very quickly - The main view is bound to a MainViewModel. The employees list view at the left is bound an EmployeeListViewModel which is...
tags: ,
2 comments

WPF PRISM (CAL) / MVVM – DelegateCommand Extensions – Part 1

Thursday, July 1, 2010

Well, it has certainly been a while since I got to a good posting rhythm, I hope it changes soon because I have a series of posts in mind. This isn’t a post about general help and description for PRISM, MVVM, or DelegateCommand. There are many resources about these already. This post is to demonstrate how I managed to extend the DelegateCommand with some really cool features. The DelegateCommand that ships with CAL expects an “execute method” and a “can execute method” arguments in its constructor. This is nice, but I wanted something...
tags: ,
no comments

WPF Popups and ToolTip Behavior – Solution

Sunday, January 18, 2009

Update 26/09/2011 - There's an updated version available in the archive 'Zuker.WpfSamples.zip' with minor bug fixes. Finally, the last post of the series :) Initial posts - WPF Popups and ToolTip behavior - A Journey WPF Popups and ToolTip Behavior – Implementation Attached is my final solution with a working example. Usage <Control>     <controls:RichToolTip.PopupContent>         <RichToolTip>             <TextBlock Text="This will be displayed in the popup" />         </RichToolTip>     </controls:RichToolTip.PopupContent> ...
tags: ,
6 comments