예제 #1
0
파일: Label.cs 프로젝트: Pyratron/PyraUI
 public override void AddContent(string content)
 {
     if (textBlock == null)
     {
         textBlock = new TextBlock(Manager);
         Presenter.Add(textBlock);
     }
     Text = content;
 }
예제 #2
0
파일: Label.cs 프로젝트: Pyratron/PyraUI
 public Label(Manager manager, string text)
     : this(manager)
 {
     if (textBlock == null)
     {
         textBlock = new TextBlock(manager);
         Presenter.Add(textBlock);
     }
     Text = text;
 }
예제 #3
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));
        }