private UIElement[] DrawPlaceholderImage(
            PhotoBook.Model.Arrangement.Rectangle imgConstraints,
            int leftOffset)
        {
            var placeholder = new Rectangle()
            {
                Width  = imgConstraints.Width,
                Height = imgConstraints.Height,
                Fill   = new SolidColorBrush(Color.FromRgb(75, 75, 75)),
            };

            Canvas.SetLeft(placeholder, leftOffset + imgConstraints.X);
            Canvas.SetTop(placeholder, imgConstraints.Y);

            var label = new Label()
            {
                Width      = imgConstraints.Width,
                Height     = imgConstraints.Height,
                Foreground = Brushes.White,
                Content    = "Brak zdjęcia",
                HorizontalContentAlignment = HorizontalAlignment.Center,
                VerticalContentAlignment   = VerticalAlignment.Center,
                FontSize = 20,
            };

            Canvas.SetLeft(label, leftOffset + imgConstraints.X);
            Canvas.SetTop(label, imgConstraints.Y);

            canvas.Children.Add(placeholder);
            canvas.Children.Add(label);

            return(new UIElement[] { placeholder, label });
        }
        private Label DrawImageComment(
            string comment,
            PhotoBook.Model.Arrangement.Rectangle imgConstraints,
            int leftOffset)
        {
            var imgBottom = imgConstraints.Y + imgConstraints.Height;

            var commentLabel = new Label()
            {
                Content = comment,
                Width   = PhotoBookModel.PageWidthInPixels,
                HorizontalContentAlignment = HorizontalAlignment.Center,
                VerticalContentAlignment   = VerticalAlignment.Center,
                FontSize = Model.Arrangement.Layout.CommentFontSize,

                // TODO: Should we hardcode it in the model or let the user change it?
                Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255)),
            };

            Canvas.SetLeft(commentLabel, leftOffset);
            Canvas.SetTop(commentLabel, imgBottom + Model.Arrangement.Layout.CommentOffsetInPixels);

            canvas.Children.Add(commentLabel);

            return(commentLabel);
        }
        private UIElement[] DrawImage(
            PhotoBook.Model.Graphics.Image image,
            PhotoBook.Model.Arrangement.Rectangle imgConstraints,
            int leftOffset)
        {
            var wpfImage = new Image
            {
                Width  = imgConstraints.Width,
                Height = imgConstraints.Height,
                Source = new CroppedBitmap(
                    new BitmapImage(new Uri(image.DisplayedAbsolutePath)),
                    new Int32Rect(
                        image.CroppingRectangle.X,
                        image.CroppingRectangle.Y,
                        image.CroppingRectangle.Width,
                        image.CroppingRectangle.Height
                        )
                    )
            };

            Canvas.SetLeft(wpfImage, leftOffset + imgConstraints.X);
            Canvas.SetTop(wpfImage, imgConstraints.Y);

            canvas.Children.Add(wpfImage);

            return(new UIElement[] { wpfImage });
        }