Exemplo n.º 1
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.Loaded -= OnLoaded;

            var mainWindow          = Window.GetWindow(this);
            var mainWindowViewModel = mainWindow?.DataContext as MainWindowViewModel;

            if (mainWindowViewModel is null)
            {
                return;
            }

            _cardViewModel.Initialize(mainWindowViewModel);

            mainWindow.Closing += OnClosing;
        }