private void Button_Click(object sender, RoutedEventArgs e) { DataContext = new RubikViewModel(); viewModels.Add(new WeakReference <RubikViewModel>((RubikViewModel)DataContext)); }
public MainWindow() { InitializeComponent(); DataContext = new RubikViewModel(); viewModels.Add(new WeakReference <RubikViewModel>((RubikViewModel)DataContext)); }