I want to be able to create an instance of the DataContext object for my WPF StartupUri window in XAML, as opposed to creating it code and then setting the
DataContext
You can just specify this directly in XAML for the entire Window:
This creates a view model named "CustomViewModel" in the namespace aliased to local, directly as the DataContext for the Window.