• Nathan Nesbit's Blog

    Detecting UI Thread Misuse

    • 1 Comments
    One of the challenges in building a UI application is correctly using the UI thread. This is a shared resource, and so any misuse has the potential to have global application effect. The most common form of misuse is using the UI thread for a long...
  • Nathan Nesbit's Blog

    Launching Dialog Windows in Managed MMC Snapins

    • 0 Comments
    Launching a child window inside MMC 3.0 from managed code isn’t easy. Different APIs are required for different circumstances. I don’t know exactly why this is, but I assume it has something to do with all the tricks MMC does to give each managed...
  • Nathan Nesbit's Blog

    WPF ICommandSource Implementations Leak Memory!

    • 3 Comments
    Actually the title of this article should be entitled “How to use WeakEventManager with ICommand implementations”, but the memory leak title is more exciting (and true) Overview Some WPF controls, such as Buttons, are command sources . A command...
  • Nathan Nesbit's Blog

    WeakEventManager and IWeakEventListener

    • 6 Comments
    When my team first starting hitting “memory leaks” due to event handlers we investigated a variety of solutions. There are many examples on the web for implementing some kind of weak listener – but interestingly almost all of them have some flaw. In the...
  • Nathan Nesbit's Blog

    Creating Attached Properties And Services

    • 1 Comments
    One cool thing about DependencyProperties is the ability to have AttachedDependencyProperties (or Attached Property for short). Regular properties are defined on a type and exist for instances of that type and sub-classes. An Attached Property is defined...
  • Nathan Nesbit's Blog

    Performing Bulk Modifications To a Databound Collection

    • 1 Comments
    On a WinForms project in the past we were working on scalability and performance. One of the things we discovered was that individually invoking items to the UI thread was a bottleneck. The theory is that the each time one does a BeginInvoke it adds...
  • Nathan Nesbit's Blog

    AddRange and ObservableCollection

    • 3 Comments
    The Issue Recently a friend asked a question about ObservableCollection. The question was how to do an “AddRange” method on it. The obvious answer is, of course, just write a method which iterates over the input collection and calls Add for each...
  • Nathan Nesbit's Blog

    Developing Reusable Controls with the Model-View-ViewModel Pattern

    • 1 Comments
    There have been several great blogs and articles about the Model-View-ViewModel pattern lately. I thought I would share my own example and thoughts on it – specifically on using this pattern to develop reusable controls. Rather than re-explain what...
  • Nathan Nesbit's Blog

    Mouse vs Keyboard and ContextMenus

    • 1 Comments
    Recently I was asked to modify one of my controls so the user of the control could get the proper placement of thier context menus. My intial response was for them to use the placement properties on the ContextMenu/ContextMenuService to achieve the right...
  • Nathan Nesbit's Blog

    Creating Adorner content in XAML

    • 5 Comments
    I've been working on a problem of having a "popup" control in my project. For various reasons the Popup class isn't working for this scenario, because the scenario is outside the designed scope of Popup. So I've been looking at the AdornerLayer as...
  • Nathan Nesbit's Blog

    ConvertingReadOnlyObservableCollection

    • 1 Comments
    In my project we always deal with live data - that is data from the Data Model may change at any minute due to reasons like user interaction or an asynchronous change in what system the UI is modeling. For the most part we want the UI to update automatically...
Page 1 of 1 (11 items)