public void MoveUp(DynamicBlock instance)
        {
            var index = Blocks.IndexOf(instance);
            if (index <= 0)
                return;

            var prev = Blocks[index - 1];
            Blocks[index - 1] = instance;
            Blocks[index] = prev;
        }
        public void MoveDown(DynamicBlock instance)
        {
            var index = Blocks.IndexOf(instance);
            if (index < 0 || index == Blocks.Count - 1)
                return;

            var next = Blocks[index + 1];
            Blocks[index + 1] = instance;
            Blocks[index] = next;
        }
 private void AddClick(object sender, RoutedEventArgs e)
 {
     var block = new DynamicBlock(Manager);
     Manager.Blocks.Add(block);
     AddBlockView(block);
 }
 private void AddBlockView(DynamicBlock block)
 {
     var view = new DynamicBlockView(this);
     view.Model = block;
     // Todo work on
     //view.ShowParameters(); asd asd asd asd as // working on this, must update view from model
     StackPanel.Children.Add(view);
 }