Exemplo n.º 1
0
        private void AddPackage()
        {
            // Find a unique name
            string name = NameHelpers.FindUniqueName(
                Packages.Select(p => p.Name),
                Properties.Resources.NewPackageName,
                StringComparison.OrdinalIgnoreCase);

            Package package = new Package()
            {
                Name = name
            };

            _manualPackagingInfo.Packages.Add(package);

            // Trigger the rename, but let the UI item to be loaded and data-bound
            Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Loaded,
                                                       (Action) delegate
            {
                _packagesPerId[package.Id].Rename();
            });
        }