Exemple #1
0
        public DisplayItem Clone()
        {
            var item = new DisplayItem
            {
                Width       = Width,
                Height      = Height,
                LeftOffset  = LeftOffset,
                TopOffset   = TopOffset,
                NodeLayouts = new ObservableCollection <NodeLayout>(NodeLayouts.Select(x => x.Clone()).ToList()),
                IsUnlocked  = IsUnlocked,
                Name        = Name
            };

            return(item);
        }
 public DisplayItem Clone()
 {
     var item = new DisplayItem
                {
                    Width = Width,
                    Height = Height,
                    LeftOffset = LeftOffset,
                    TopOffset = TopOffset,
                    NodeLayouts = new ObservableCollection<NodeLayout>(NodeLayouts.Select(x => x.Clone()).ToList()),
                    IsUnlocked = IsUnlocked,
                    Name = Name
                };
     return item;
 }
 /// <summary>
 ///   The add element.
 /// </summary>
 private void AddElement()
 {
     var displayElement = new DisplayItem();
     var viewModel = new DisplayItemEditorViewModel { DisplayItem = displayElement };
     var editor = new DisplayItemEditorView { DataContext = viewModel };
     editor.ShowDialog();
     DisplayItems.Add(displayElement);
     CurrentDisplayElement = displayElement;
 }