Sfoglia il codice sorgente

Add Canvas under Layout tab

Amer Koleci 10 anni fa
parent
commit
edcd2cbe46
1 ha cambiato i file con 41 aggiunte e 1 eliminazioni
  1. 41 1
      samples/TestApplication/Program.cs

+ 41 - 1
samples/TestApplication/Program.cs

@@ -675,7 +675,47 @@ namespace TestApplication
 									},
 								}
 							},
-						}
+                            new TextBlock
+                            {
+                                Margin = new Thickness(0, 40, 0, 0),
+                                Text = "Canvas",
+                                FontWeight = FontWeight.Medium,
+                                FontSize = 20,
+                                Foreground = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A panel which lays out its children by explicit coordinates.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.Parse("#727272"),
+                                Margin = new Thickness(0, 0, 0, 10)
+                            },
+                            new Canvas
+                            {
+                                Background = Brushes.Yellow,
+                                Width = 300,
+                                Height = 400,
+                                Children = new Controls
+                                {
+                                    new Rectangle
+                                    {
+                                        Fill = Brushes.Blue,
+                                        Width = 63,
+                                        Height = 41,
+                                        [Canvas.LeftProperty] = 40,
+                                        [Canvas.TopProperty] = 31,
+                                    },
+                                    new Ellipse
+                                    {
+                                        Fill = Brushes.Green,
+                                        Width = 58,
+                                        Height = 58,
+                                        [Canvas.LeftProperty] = 130,
+                                        [Canvas.TopProperty] = 79,
+                                    },
+                                }
+                            },
+                        }
 					}
 				}
             };