Inheritance: TreeViewItemViewModel
Ejemplo n.º 1
0
        public LayerItemViewModel(IPsdLayer layer, PSDItemViewModel parent)
        {
            this.layer = layer;

            foreach (var item in layer.Childs)
            {
                this.Items.Add(new LayerItemViewModel(item, parent));
            }

            if (layer.LinkedLayer != null)
            {
                this.Items.Add(new LinkedLayerItemViewModel(layer.LinkedLayer, parent));
            }

            this.Items.Add(new PropertiesItemViewModel("Resources", layer.Resources, this));
            this.previewCommand = new DelegateCommand((p) => this.Preview(), (p) => this.CanPreview);
        }
Ejemplo n.º 2
0
        public LayerItemViewModel(IPsdLayer layer, PSDItemViewModel parent)
            : base(parent)
        {
            this.layer = layer;

            foreach (var item in layer.Childs)
            {
                this.Children.Add(new LayerItemViewModel(item, parent));
            }

            if (layer.LinkedLayer != null)
            {
                this.Children.Add(new LinkedLayerItemViewModel(layer.LinkedLayer, parent));
            }

            //this.Children.Add(new PropertiesItemViewModel("Resources", layer.Resources, this));
        }
Ejemplo n.º 3
0
        public LayerItemViewModel(IPsdLayer layer, PSDItemViewModel parent)
            : base(parent)
        {
            this.layer = layer;

            foreach (var item in layer.Childs)
            {
                this.Children.Add(new LayerItemViewModel(item, parent));
            }

            if(layer.LinkedLayer != null)
            {
                this.Children.Add(new LinkedLayerItemViewModel(layer.LinkedLayer, parent));
            }

            //this.Children.Add(new PropertiesItemViewModel("Resources", layer.Resources, this));
        }
        public LinkedLayerItemViewModel(ILinkedLayer linkedLayer, PSDItemViewModel parent)
            : base(parent)
        {
            this.linkedLayer = linkedLayer;

            this.Children.Add(new PSDItemViewModel(linkedLayer.Document));
            //foreach (var item in linkedLayer.Document.Childs)
            //{
            //    this.Children.Add(new LayerItemViewModel(item, parent));
            //}

            //var bmp = this.linkedLayer.Document.GetBitmap();
            //if (bmp != null)
            //{
            //    PngBitmapEncoder d = new PngBitmapEncoder();
            //    d.Frames.Add(BitmapFrame.Create(bmp));
            //    string n = Regex.Replace(this.linkedLayer.FileName, "[\\\\/:*?\"<>|]", "_");
            //    using (FileStream stream = new FileStream(n + ".png", FileMode.Create))
            //    {
            //        d.Save(stream);
            //    }
            //}
        }
Ejemplo n.º 5
0
        public LinkedLayerItemViewModel(ILinkedLayer linkedLayer, PSDItemViewModel parent)
            : base(parent)
        {
            this.linkedLayer = linkedLayer;

            this.Children.Add(new PSDItemViewModel(linkedLayer.Document));
            //foreach (var item in linkedLayer.Document.Childs)
            //{
            //    this.Children.Add(new LayerItemViewModel(item, parent));
            //}

            //var bmp = this.linkedLayer.Document.GetBitmap();
            //if (bmp != null)
            //{
            //    PngBitmapEncoder d = new PngBitmapEncoder();
            //    d.Frames.Add(BitmapFrame.Create(bmp));
            //    string n = Regex.Replace(this.linkedLayer.FileName, "[\\\\/:*?\"<>|]", "_");
            //    using (FileStream stream = new FileStream(n + ".png", FileMode.Create))
            //    {
            //        d.Save(stream);
            //    }
            //}
        }
Ejemplo n.º 6
0
 public LinkedLayerItemViewModel(ILinkedLayer linkedLayer, PSDItemViewModel parent)
 {
     this.linkedLayer = linkedLayer;
     this.Items.Add(new PSDItemViewModel(linkedLayer.Document));
 }