public void InsertPart(XmlParts type)
        {
            // Check if the part does not exist yet
            var part = this.document.RetrieveCustomPart(type);

            if (part != null)
            {
                return;
            }

            part = this.document.CreateCustomPart(type);
            var partModel = new OfficePartViewModel(part, this);

            this.Children.Add(partModel);
            partModel.IsSelected = true;
        }
Example #2
0
 public IconViewModel(string id, string filePath, OfficePartViewModel parent)
     : this(id, LoadImageFromPath(filePath), parent)
 {
 }
Example #3
0
 public IconViewModel(string id, BitmapImage image, OfficePartViewModel parent)
     : base(parent, false, false)
 {
     this.Image = image;
     this.id    = id;
 }