public void OnBlockStyleChanged(BlockVisualStyle style) { foreach (BlockEntry obj in this.BlockGrid.Children) { style.UseStyle(obj); } }
public void OnItemCountChanged(int value) { int v = this.BlockGrid.Children.Count; if (value > v) { BlockVisualStyle style = BlockStyle ?? BlockVisualStyle.DefaultStyle; for (int i = 0; i < value - v; ++i) { var ctrl = new BlockEntry(); style.UseStyle(ctrl); this.BlockGrid.Children.Add(ctrl); } } else if (value < v) { var length = v - value; this.BlockGrid.Children.RemoveRange(this.BlockGrid.Children.Count - length, length); } }