コード例 #1
0
ファイル: Button.cs プロジェクト: Pyratron/PyraUI
 public Button(Manager manager)
     : base(manager)
 {
     // Todo: Use content template
     border = new Border(manager)
     {
         BorderThickness = new Thickness(0, 0, 0, 2),
         Background = Background,
         BorderBrush = (Color) "#3198ab",
         CornerRadius = 5,
     };
     RemoveDirect(Presenter);
     AddDirect(border);
     border.Add(Presenter);
 }
コード例 #2
0
ファイル: Window.cs プロジェクト: Pyratron/PyraUI
        public Window(Manager manager)
            : base(manager)
        {
            // TODO: Replace with control template.
            containerPanel = new StackPanel(manager);
            var background = (Color)"#323741";
            windowBorder =new Border(manager)
            {
                CornerRadius = 5,
                BorderThickness = 1,
                Background = Background,
                BorderBrush = background,
            };
            base.Add(windowBorder);
            titleBorder = new Border(manager)
            {
                Background = background,
                Padding = new Thickness(8, 12),
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Top,
            };
            titleLabel = new TextBlock(manager, Title)
            {
                FontStyle = FontStyle.Bold,
                TextColor = Color.White,
                HorizontalAlignment = HorizontalAlignment.Left,
                TextAlignment = Alignment.TopLeft
            };
            windowBorder.Add(containerPanel);
            containerPanel.Add(titleBorder);
            titleBorder.Add(titleLabel);
            contentArea = new StackPanel(manager)
            {
                Margin = 8,
            };
            containerPanel.Add(contentArea);
            Margin = 16;

            Effects.Add(new DropShadowEffect(manager, 12, Color.Black * .2f));
        }