private void OnClickSave(object sender, RoutedEventArgs e) { DesignerItem item = new DesignerItem(); item.Style = this.TryFindResource("DesignerItemStyle") as Style; item.Content = new Button() { IsHitTestVisible = false, Content = "China", Background = Brushes.Gray }; item.Width = 100; item.Height = 100; item.SetValue(Canvas.LeftProperty, 10.0); item.SetValue(Canvas.TopProperty, 10.0); this.MyDesignerCanvas.Children.Add(item); }