#if !NETSTANDARD2_0
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Media;
namespace PdfSharp.Windows
{
// Create a host visual derived from the FrameworkElement class.// This class provides layout, event handling, and container support for// the child visual objects.
///
/// Used to present Visuals in the PagePreview.
///
public class VisualPresenter : FrameworkElement
{
///
/// Initializes a new instance of the class.
///
public VisualPresenter()
{
_children = new VisualCollection(this);
}
///
/// Gets the number of visual child elements within this element.
///
protected override int VisualChildrenCount
{
get { return _children.Count; }
}
///
/// Overrides , and returns a child at the specified index from a collection of child elements.
///
protected override Visual GetVisualChild(int index)
{
if (index < 0 || index >= _children.Count)
throw new ArgumentOutOfRangeException("index");
return _children[index];
}
///
/// Gets the children collection.
///
public VisualCollection Children
{
get { return _children; }
}
readonly VisualCollection _children;
}
}
#endif