1usingSystem;2usingSystem.Collections.ObjectModel;3usingSystem.Windows;4usingSystem.Windows.Media;5usingSystem.Windows.Media.Imaging;67namespaceQuestions3596998{9publicclassItem10{11publicdouble X {get;set;}12publicdouble Y {get;set;}13publicdouble Width {get;set;}14publicdouble Height {get;set;}15}1617publicclassPathItem:Item18{19publicBrush Stroke {get;set;}20publicstring Data {get;set;}21}2223publicclassEllipseItem:Item24{25publicBrush Fill {get;set;}26}2728publicclassImageItem:Item29{30publicImageSource Source {get;set;}31}3233publicclassRectangleItem:Item34{35publicBrush Fill {get;set;}36}3738publicclassRichTextBoxItem:Item39{40publicstring Text {get;set;}41}4243publicpartialclassMainWindow:Window44{45publicObservableCollection<Item> Items {get;}4647publicMainWindow()48{49InitializeComponent();50 DataContext =this;5152 Items =newObservableCollection<Item>53{54newPathItem{ X =50, Y =50, Width =50, Height =50, Stroke = Brushes.Red, Data ="M0,25L25,50L50,25L25,0Z",},55newEllipseItem{ X =200, Y =50, Width =50, Height =100, Fill = Brushes.Green,},56newImageItem{ X =50, Y =200, Width =32, Height =32, Source =newBitmapImage(newUri("https://teratail-v2.storage.googleapis.com/uploads/avatars/u13/132786/KnkDDC5A_thumbnail_32x32.jpg")),},57newRectangleItem{ X =200, Y =200, Width =100, Height =50, Fill = Brushes.Blue,},58newRichTextBoxItem{ X =400, Y =50, Width =300, Height =300, Text ="RichTextBoxItem"},59};60}61}62}