Bindings with ElementName
only work inside the same UserControl. If the two Windows are completely separated, you have no option besides moving the Options property from MainWindow class to a proper Model or ViewModel class, which you should do anyway because that's how WPF/MVVM is supposed to be.
If you really want to bind from one view to the other, the different Window instances should at least share some common ancestor, so that you could use, instead of ElementName
, the FindAncestor
Binding parameter, but I doubt this would be an easy, or natural, or even possible solution. (I think it's not even possible because Window is a "top control" which doesn't have a parent in the Logical or Visual Trees.
The best solution by far is to take model data away from the View as soon as possible, you'll get a much easier environment to work with an improve upon.
UPDATE: Some MVVM context:
Usually in WPF apps you have some classes pertaining to the "View" layer (Windows, Controls, CheckBoxes) and others pertaining to the "[View]Model" layer, where you would put your Option class. You'd need to bootstrap your application in a way that, very soon in the startup execution, you have an instance of a View and an instance of a ViewModel, and the latter should be set as the DataContext of the former, so you can use DataBinding.
There is some religious wars around the "View-First" vs "Model-First" approach, but I don't use either: I always have a BootStrapper
class that creates the MainView (usually a Window) and the MainViewModel, and let each class tree handle itself.
An exemple:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var window = new MainWindow();
var vm = new MainViewModel();
window.DataContext = vm;
window.Show();
}
}
But please have in mind that there is no "one right way" to do it. You'll have to decide what works best for you, unfortunately.