|
|
|
@ -140,12 +140,14 @@ namespace ICSharpCode.Reports.Core.WPF |
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Container
|
|
|
|
#region Container
|
|
|
|
UIElement CreateGraphicsContainer(ExportGraphicContainer graphicContainer) |
|
|
|
UIElement CreateGraphicsContainer(ExportGraphicContainer container) |
|
|
|
{ |
|
|
|
{ |
|
|
|
IGraphicStyleDecorator decorator = graphicContainer.StyleDecorator as IGraphicStyleDecorator; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IGraphicStyleDecorator decorator = container.StyleDecorator as IGraphicStyleDecorator; |
|
|
|
|
|
|
|
|
|
|
|
UIElement shape = null; |
|
|
|
UIElement shape = null; |
|
|
|
var ss = decorator.Shape as EllipseShape; |
|
|
|
var ss = decorator.Shape as EllipseShape; |
|
|
|
|
|
|
|
|
|
|
|
if (ss != null) { |
|
|
|
if (ss != null) { |
|
|
|
|
|
|
|
|
|
|
|
var circle = new System.Windows.Shapes.Ellipse(); |
|
|
|
var circle = new System.Windows.Shapes.Ellipse(); |
|
|
|
@ -158,13 +160,26 @@ namespace ICSharpCode.Reports.Core.WPF |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
var border = CreateBorder(decorator as BaseStyleDecorator); |
|
|
|
var border = CreateBorder(decorator as BaseStyleDecorator); |
|
|
|
SetDimension(border,decorator); |
|
|
|
// SetDimension(border,decorator);
|
|
|
|
|
|
|
|
border.Width = decorator.DisplayRectangle.Width + 2; |
|
|
|
|
|
|
|
border.Height = decorator.DisplayRectangle.Height + 2; |
|
|
|
RectangleShape rs = decorator.Shape as RectangleShape; |
|
|
|
RectangleShape rs = decorator.Shape as RectangleShape; |
|
|
|
border.CornerRadius = new CornerRadius(rs.CornerRadius); |
|
|
|
border.CornerRadius = new CornerRadius(rs.CornerRadius); |
|
|
|
border.BorderThickness = new Thickness(decorator.Thickness); |
|
|
|
border.BorderThickness = new Thickness(decorator.Thickness); |
|
|
|
border.BorderBrush = ConvertBrush(decorator.ForeColor); |
|
|
|
border.BorderBrush = ConvertBrush(decorator.ForeColor); |
|
|
|
shape = border; |
|
|
|
shape = border; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var canvas = CreateCanvas(container); |
|
|
|
|
|
|
|
canvas.Width = decorator.DisplayRectangle.Width -1; |
|
|
|
|
|
|
|
canvas.Height = decorator.DisplayRectangle.Height -1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddItemsToCanvas(ref canvas, container); |
|
|
|
|
|
|
|
border.Child = canvas; |
|
|
|
|
|
|
|
// border.Measure(container.StyleDecorator.Size);
|
|
|
|
|
|
|
|
// border.Arrange(new Rect(new System.Windows.Point(), container.StyleDecorator.Size));
|
|
|
|
|
|
|
|
border.UpdateLayout(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return shape; |
|
|
|
return shape; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -172,16 +187,9 @@ namespace ICSharpCode.Reports.Core.WPF |
|
|
|
|
|
|
|
|
|
|
|
private UIElement CreateContainer(ExportContainer container) |
|
|
|
private UIElement CreateContainer(ExportContainer container) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var canvas = new Canvas(); |
|
|
|
Canvas canvas = CreateCanvas(container); |
|
|
|
SetDimension(canvas,container.StyleDecorator); |
|
|
|
|
|
|
|
canvas.Background = ConvertBrush(container.StyleDecorator.BackColor); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var exportElement in container.Items) { |
|
|
|
AddItemsToCanvas(ref canvas, container); |
|
|
|
var uiElement = ItemFactory (exportElement); |
|
|
|
|
|
|
|
Canvas.SetLeft(uiElement,exportElement.StyleDecorator.Location.X - container.StyleDecorator.Location.X); |
|
|
|
|
|
|
|
Canvas.SetTop(uiElement,exportElement.StyleDecorator.Location.Y - container.StyleDecorator.Location.Y); |
|
|
|
|
|
|
|
canvas.Children.Add(uiElement); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
canvas.Measure(PageSize); |
|
|
|
canvas.Measure(PageSize); |
|
|
|
canvas.Arrange(new Rect(new System.Windows.Point(), PageSize)); |
|
|
|
canvas.Arrange(new Rect(new System.Windows.Point(), PageSize)); |
|
|
|
@ -189,6 +197,25 @@ namespace ICSharpCode.Reports.Core.WPF |
|
|
|
return canvas; |
|
|
|
return canvas; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddItemsToCanvas(ref Canvas canvas, ExportContainer container) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
foreach (var exportElement in container.Items) { |
|
|
|
|
|
|
|
var uiElement = ItemFactory(exportElement); |
|
|
|
|
|
|
|
Canvas.SetLeft(uiElement, exportElement.StyleDecorator.Location.X - container.StyleDecorator.Location.X); |
|
|
|
|
|
|
|
Canvas.SetTop(uiElement, exportElement.StyleDecorator.Location.Y - container.StyleDecorator.Location.Y); |
|
|
|
|
|
|
|
canvas.Children.Add(uiElement); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Canvas CreateCanvas(ExportContainer container) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var canvas = new Canvas(); |
|
|
|
|
|
|
|
SetDimension(canvas, container.StyleDecorator); |
|
|
|
|
|
|
|
canvas.Background = ConvertBrush(container.StyleDecorator.BackColor); |
|
|
|
|
|
|
|
return canvas; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -308,8 +335,6 @@ namespace ICSharpCode.Reports.Core.WPF |
|
|
|
{ |
|
|
|
{ |
|
|
|
element.Width = decorator.DisplayRectangle.Width; |
|
|
|
element.Width = decorator.DisplayRectangle.Width; |
|
|
|
element.Height = decorator.DisplayRectangle.Height; |
|
|
|
element.Height = decorator.DisplayRectangle.Height; |
|
|
|
// element.MaxHeight = decorator.DisplayRectangle.Height;
|
|
|
|
|
|
|
|
// element.MaxWidth = decorator.DisplayRectangle.Width;
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|