Exemplo n.º 1
0
        private Border GetSubjectNameLabel(string subjectName, IColorGenerator c, bool truncate = true)
        {
            var textblock = new TextBlock {
                Text              = subjectName,
                Margin            = new Thickness(2),
                TextAlignment     = TextAlignment.Center,
                FontWeight        = FontWeights.DemiBold,
                VerticalAlignment = VerticalAlignment.Center
            };

            if (truncate)
            {
                textblock.Text = subjectName.TruncateRight(30);
            }
            var border = new Border {
                BorderThickness = new Thickness(1),
                BorderBrush     = Brushes.Black,
                Child           = textblock,
                Background      = c.GetCurrentBrush(),
                ToolTip         = subjectName
            };
            var originalColor = c.GetCurrentColor();
            var originalBrush = c.GetCurrentBrush();

            border.MouseEnter += (sender, args) => {
                border.Background = new SolidColorBrush(originalColor.Darker());
            };
            border.MouseLeave += (sender, args) => {
                border.Background = originalBrush;
            };

            return(border);
        }
Exemplo n.º 2
0
        private Border GenerateBox(Slot s, IColorGenerator c)
        {
            var textblock = new TextBlock
            {
                Margin            = new Thickness(2),
                TextAlignment     = TextAlignment.Center,
                FontWeight        = FontWeights.DemiBold,
                VerticalAlignment = VerticalAlignment.Center
            };

            textblock.Text = GetInfo(s);
            var border = new Border
            {
                BorderThickness = new Thickness(0.75),
                BorderBrush     = Brushes.Black,
                Child           = textblock,
                Background      = c.GetCurrentBrush(),
                CornerRadius    = new CornerRadius(2),
                Height          = 50,
                ForceCursor     = true,
                ToolTip         = GetTooltip(s) // s.SubjectName ,
            };
            var originalColor = c.GetCurrentColor();
            var originalBrush = c.GetCurrentBrush();

            border.MouseEnter += (sender, args) => { border.Background = new SolidColorBrush(originalColor.Darker()); };
            border.MouseLeave += (sender, args) => { border.Background = originalBrush; };
            return(border);
        }
Exemplo n.º 3
0
 private Label GetLabel(IColorGenerator c, string content = "")
 {
     return(new Label {
         Content = content,
         FontWeight = FontWeights.Bold,
         VerticalContentAlignment = VerticalAlignment.Center,
         HorizontalContentAlignment = HorizontalAlignment.Center,
         FontFamily = new FontFamily("Consolas"),
         FontSize = 13.5,
         BorderBrush = Brushes.Black,
         BorderThickness = new Thickness(1),
         Background = c.GetCurrentBrush()
     });
 }