Ejemplo n.º 1
0
        public Border AddEventBlock(Canvas canvas, Rect rect, EventBorderViewModel evt, bool isUnbound)
        {
            canvas.Children.Add(GenerateShadowEventBorder(canvas, rect, evt));

            var brd = GenerateGeneralEventBorder(canvas, rect, evt);

            canvas.Children.Add(brd);
            var grid = new Grid();

            brd.Child = grid;

            var blck = GetVacanteTextBlock();

            blck.VerticalAlignment = VerticalAlignment.Top;
            blck.HorizontalAlignment = HorizontalAlignment.Center;
            blck.Text = evt.Title;
            grid.Children.Add(blck);

            if (isUnbound)
            {
                brd.Style = canvas.FindResource("UnboundEventItemBorder") as Style;
            }
            else
            {
                TextBlock deletableTextBlock = new TextBlock();
                deletableTextBlock.Style = canvas.FindResource("DeletableTextBlock") as Style;
                brd.Style = canvas.FindResource("EventItemBorder") as Style;
                grid.Children.Add(deletableTextBlock);
            }

            return brd;
        }
Ejemplo n.º 2
0
        private Border GenerateBorder(Canvas canvas, TimeBorderViewModel model, double x, double y, double width, bool isUnbound)
        {
            var border = VacantBorder(width);
            border.DataContext = model;
            if (isUnbound)
            {
                border.Style = canvas.FindResource("UnboundBorder") as Style;
            }

            Canvas.SetTop(border, y);
            Canvas.SetLeft(border, x);
            canvas.Children.Add(border);

            return border;
        }