using System;
using System.Collections.Generic;
using ElmSharp;
namespace Xamarin.Forms.Platform.Tizen.Native
{
///
/// A basic page which can hold a single view.
///
public class Page : Background, IContainable
{
///
/// The name of the part to be used when setting content.
///
public const string ContentPartName = "overlay";
///
/// Exposes the Children property, mapping it to the _canvas' Children property.
///
public IList Children => _canvas.Children;
///
/// The canvas, used as a container for other objects.
///
///
/// The canvas holds all the Views that the ContentPage is composed of.
///
internal Canvas _canvas;
///
/// Initializes a new instance of the ContentPage class.
///
public Page(EvasObject parent) : base(parent)
{
_canvas = new Canvas(this);
SetPartContent(ContentPartName, _canvas);
}
///
/// Allows custom handling of events emitted when the layout has been updated.
///
public event EventHandler LayoutUpdated
{
add
{
_canvas.LayoutUpdated += value;
}
remove
{
_canvas.LayoutUpdated -= value;
}
}
///
/// Handles the disposing of a ContentPage
///
///
/// Takes the proper care of discarding the canvas, then calls the base method.
///
protected override void OnUnrealize()
{
_canvas.Unrealize();
base.OnUnrealize();
}
}
}