You can not:
Window.Resources
However, you can do:
this.Resources.MergedDictionaries.Add(myResourceDictionary);
Resources is a property of FrameworkElement and is shared by Application and Window (and most other user interface classes in WPF). However, this is an instance property, not a static property, so you need to work with the resources of a specific instance. When you entered Window.Resources, you tried to add a window to the type, not a specific window.
This works in your application line, because Application.Current returns the current instance of the application, so you are working with the correct, specific instance (and not the type).
source share