.. except for InitializeComponent.
That was a quick wtf moment when I moved a method from a WPF app to a class library project.
Adding a reference to PresentationFramework helps. You’ll also need references to PresentationCore, System.Xaml and WindowsBase.