Amalgam Phase II – What’s that?

This “currently” is my test bed for applying WPF to the notification tray area, and also applying a WPF based PropertyGrid. Both of these things are not natively supported within .Net 4.

For Visual Studio 2010 there is a VSIX that can be downloaded that performs a lot of the basics for creating a WPF tray application, then by a process of event capturing, the menu that would normally be popped up from the wrapped forms element a WPF menu (Or any UIElement ) can be put in it’s place.

The next thing is to find a PropertyGrid. This proved a little more troublesome, but I found a nice article over @ CodeProject, that I have added to, to enable a grid from inside the .Net Framework. a very neat idea on using reflection, and then getting the Framework to perform all the hard stuff (That’s the theory – still working on the hard stuff).
As part of that, I had to work out how to click a button, again reflection came to the rescue, and finding the OnClick method:

  1. // Remove all search terms first
  2. if (SearchClearButton != null)
  3. {
  4.    MethodInfo OnClick = SearchClearButton.GetType().GetMethod("OnClick", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
  5.    OnClick.Invoke(SearchClearButton, new object[0]);
  6. }