コード例 #1
0
        public DisplayItem Clone()
        {
            var item = new DisplayItem
            {
                Width            = Width,
                Height           = Height,
                LeftOffset       = LeftOffset,
                TopOffset        = TopOffset,
                ChannelLocations =
                    new ObservableCollection <ChannelLocation>(
                        ChannelLocations.Select(channelLocation => channelLocation.Clone()).ToList()),
                IsUnlocked = IsUnlocked
            };

            return(item);
        }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 public DisplayItem Clone()
 {
     var item = new DisplayItem
                {
                    Width = Width,
                    Height = Height,
                    LeftOffset = LeftOffset,
                    TopOffset = TopOffset,
                    ChannelLocations =
                        new ObservableCollection<ChannelLocation>(
                        ChannelLocations.Select(channelLocation => channelLocation.Clone()).ToList()),
                    IsUnlocked = IsUnlocked
                };
     return item;
 }