Removing Tizen.Xamarin.Forms.Extensions
[profile/tv/apps/dotnet/mediahub.git] / TVMediaHub / TVMediaHub.Tizen / Extensions / MediaView.cs
1 using System;
2 using Xamarin.Forms;
3
4 namespace Tizen.Xamarin.Forms.Extension
5 {
6     /// <summary>
7     /// The MediaView class provides a view of media that is being played by the player or the camera.
8     /// </summary>
9     /// <example>
10     /// <code>
11     /// MediaView mediaView = new MediaView();
12     /// Tizen.Multimedia.Camera camera = new Tizen.Multimedia.Camera(Tizen.Multimedia.CameraDevice.Rear);
13     /// camera.SetDisplay(Tizen.Multimedia.CameraDisplayType.Evas, (Tizen.Multimedia.MediaView) mediaView.NativeView);
14     /// </code>
15     /// </example>
16     public class MediaView : View, IMediaViewController
17     {
18         internal static readonly BindablePropertyKey NativeViewPropertyKey = BindableProperty.CreateReadOnly("NativeView", typeof(object), typeof(MediaView), default(object));
19
20         /// <summary>
21         /// BindableProperty. Identifies the NativeView bindable property.
22         /// </summary>
23         public static readonly BindableProperty NativeViewProperty = NativeViewPropertyKey.BindableProperty;
24
25         /// <summary>
26         /// NativeView allows application developers to display the video output on screen.
27         /// </summary>
28         public object NativeView
29         {
30             get { return GetValue(NativeViewProperty); }
31             internal set { SetValue(NativeViewPropertyKey, value); }
32         }
33
34         /// <summary>
35         /// Occurs when the NativeView is created.
36         /// </summary>
37         public event EventHandler NativeViewCreated;
38
39         void IMediaViewController.SendNativeViewCreated()
40         {
41             NativeViewCreated?.Invoke(this, EventArgs.Empty);
42         }
43     }
44 }