Sometimes it will be great to have a dictionary bindable to a WPF list.
If you use a normal dictionary you will have no UI update if an item is added, changed or removed. You have to send a property changed for the whole list manually.
Therefore I have added a ObservableDictionary to my DW.SharpTools. It implements the INotifyCollectionChanged and the INotifyPropertyChanged as well.
Facts:
Library: DW.SharpTools
Version: 12.2.8.0
Date: 2012-2-8 21:54
Sometimes it happens that a ICommand shold be called with a specific parameter only.
To have this it is needed to get the object parameter and cast it to the right type.
ClosingCommand = new DelegateCommand(WindowClosing);
public ICommand ClosingCommand { get; set; }
private void WindowClosing(object arg)
{
var e = (WindowClosingArgs)arg;
}
To prevent this senseless casting I have created an additional DelegateCommand which takes the corresponding object type.
ClosingCommand = new DelegateCommand<WindowClosingArgs>(WindowClosing);
public ICommand ClosingCommand { get; set; }
private void WindowClosing(WindowClosingArgs e)
{
}
Supported with the current DW.SharpTools are both. The non generic DelegateCommand passes just objects.
Facts:
Library: DW.SharpTools
Version: 12.1.11.0
Date: 2012-1-11 20:57
The WPF Window has the problem that not all events from the Win API are represented by a C# event. For example the right click in the title bar or just moving the window itself.
To get such events I have created the WindowBehavior in the DW.SharpTools.
Now, to have the same connected to ICommands, I have added two attach dependency properties to the WindowBehavior in the DW.Interactivity.
With them it is possible to say which Win API events will be forwarded to a command by the IDs. For instance:
<Window Interactivity:WindowBehavior.WinApiMessages="0x216;0x214"
Interactivity:WindowBehavior.WinApiCommand="{Binding WinApiCommand}">
</Window>
public partial class DemoWindow : Window
{
public DemoWindow()
{
WinApiCommand = new DelegateCommand(WinApi);
}
public ICommand WinApiCommand { get; set; }
private void WinApi(object arg)
{
var e = (NotifyEventArgs)arg;
if (e.MessageId == WindowMessages.WM_MOVING)
//...
}
}
The messages can be written in hex values like Microsoft write them in the MSDN like "0x216;0x214" but also the integers are possible, like "3;4".
To get all Win API messages, just "All" have to be written.
Facts:
Library: DW.Interactivity
Version: 12.1.7.0
Date: 2012-1-9 18:24
Now it is December, 31th 2011 at about 7 o'clock PM and I'm finish with moving all the stuff from the DW.WPFDev to the DW.SharpTools and impement the last unit test (100% code coverage).
(Yesterday I have reimplemented the WindowObserver, I think its is much more better now
)
Tomorrow, in the new year, I think I can deploy the new DW.SharpTools and the other (because of the dependency) which finishes the shrinking process and I can start new challenges in the next year.
Ending with passing unit tests is a great sign 
The DW.Configurations and DW.Loggings are gone.
The DW.UnitTests is integrated into the DW.Services.
The DW.Localiation and DW.XmlTools are integrated into the DW.SharpTools.
Now just the DW.WPFDev stays left, as soon I have integrated it into the DW.SharpTools the internal dependency of the WPFToolkit changes from the DW.WPFDev to the DW.SharpTools as well.
All projects with the state before the delete and the merges can be downloaded from the Miscellaneous section.