News
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