Пример #1
0
        public void InitializeComponent()
        {
            // Add columns and rows to the grid

            ColumnDefinitions
            .Add(new ColumnDefinition())
            .Add(new ColumnDefinition())
            .Add(new ColumnDefinition())
            .Add(new ColumnDefinition());

            RowDefinitions
            .Add(new RowDefinition())
            .Add(new RowDefinition())
            .Add(new RowDefinition())
            .Add(new RowDefinition())
            .Add(new RowDefinition())
            .Add(new RowDefinition())
            .Add(new RowDefinition())
            .Add(new RowDefinition());

            // Create the calculator display's text
            e_text = new TextBlock()
            {
                FontWeight          = Calculator_Demo.FontWeight,
                FontFamily          = Calculator_Demo.FontFamily,
                FontSize            = FontSize.FromLength(9, Lesarde.Frogui.Unit.Vw),
                HorizontalAlignment = Lesarde.Frogui.HorizontalAlignment.Right,
                VerticalAlignment   = Lesarde.Frogui.VerticalAlignment.Center
            };

            // Create the calculator's display
            e_display = new Border()
            {
                Background      = displayBrush,
                BorderBrush     = borderBrush,
                BorderThickness = new Lesarde.Frogui.Thickness(new Lesarde.Frogui.Length(3, Lesarde.Frogui.Unit.Px)),
                BorderPattern   = new Lesarde.Frogui.BorderPattern(Lesarde.Frogui.StrokePattern.Solid),
                Child           = e_text,
                Padding         = new Lesarde.Frogui.Thickness(new Lesarde.Frogui.Length(8, Lesarde.Frogui.Unit.Px))
            };

            // Add the display to the grid
            Children.Add(e_display, new Grid.Anchor("0", "4", "0", "2"));
        }