Ejemplo n.º 1
0
        protected override void OnUnloaded()
        {
            if (IsDesignTime)
            {
                return;
            }

            if (Instance == this)
            {
                Instance = null;
            }

            this.DataContext = null;
            viewModel.Dispose();
            viewModel = null;
        }
Ejemplo n.º 2
0
        protected override void OnLoaded()
        {
            if (IsDesignTime)
            {
                return;
            }

            if (Instance != null)
            {
                throw new Exception(this.GetType() + " instance is already exists");
            }

            Instance = this;

            if (viewModel == null)
            {
                viewModel = new ViewModelHUD();
            }

            this.DataContext = viewModel;
        }