using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BankTV.Controls
{
    /// <summary>
    /// Interaction logic for FlashControl.xaml
    /// </summary>
    public partial class FlashControl : UserControl
    {
        private FlashObjectControl player = null;

        public FlashControl()
        {
            InitializeComponent();
        }

        public Uri Source { get; set; }

        private void FlashPlayer_Loaded(object sender, RoutedEventArgs e)
        {
        }

        public void PlayMovie()
        {
            if (this.player == null)
            {
                this.player = new FlashObjectControl();
            }   //if
            wfHost.Child = this.player;
            this.player.LoadMovie(Source.AbsoluteUri);
            this.wfHost.Visibility = Visibility.Visible;
            this.player.Play();
        }

        public void StopMovie()
        {
            if (this.player != null)
            {
                this.player.Stop();
            }   //if
            this.wfHost.Visibility = Visibility.Hidden;
        }

    }
}
