示例#1
0
        void PackageLayoutView_Closed(object sender, EventArgs e)
        {
            PackageLayoutView packageLayoutView = (PackageLayoutView)sender;

            packageLayoutView.Closed -= PackageLayoutView_Closed;

            _packageLayoutViews.Remove(packageLayoutView.DataContext as PackageViewModel);
            packageLayoutView.DataContext = null;
        }
示例#2
0
        public void EditPackageLayout(PackageViewModel package)
        {
            PackageLayoutView packageLayoutView;

            if (_packageLayoutViews.TryGetValue(package, out packageLayoutView))
            {
                packageLayoutView.Activate();
            }
            else
            {
                packageLayoutView             = new PackageLayoutView();
                packageLayoutView.Owner       = Application.Current.MainWindow;
                packageLayoutView.DataContext = package;

                _packageLayoutViews[package] = packageLayoutView;

                packageLayoutView.InputBindings.AddRange(Application.Current.MainWindow.InputBindings);
                packageLayoutView.Show();

                packageLayoutView.Closed += PackageLayoutView_Closed;
            }
        }