Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2023
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. public class CustomCalendar : Canvas
  2.     {
  3.         public CustomCalendar()
  4.         {
  5.             _grid = new Grid();
  6.             _grid.Width = Width;
  7.             _grid.Height = Height;
  8.             for (int i = 0; i < 8; i++)
  9.                 _grid.ColumnDefinitions.Add(new ColumnDefinition());
  10.             for (int i = 0; i < 4; i++)
  11.                 _grid.RowDefinitions.Add(new RowDefinition());
  12.  
  13.             _grid.Children.Add(new Button() { Content = "Тест" });
  14.  
  15.  
  16.             this.Children.Add(_grid);
  17.             this.Background = new SolidColorBrush(Color.FromRgb(231, 22, 123));
  18.         }
  19.  
  20.         private Grid _grid;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement