using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Ion.Sdk.DemoApp.Framework;

namespace Ion.Sdk.DemoApp.Views
{
    /// <summary>
    /// Interaction logic for InstrumentInformation.xaml
    /// </summary>
    public partial class InstrumentInformation : UserControl, IDialog
    {
        #region -=Instance members=-
        public event EventHandler Closed;

        public List<KeyValuePair<string, string>> InstrumentProperties
        {
            get { return (List<KeyValuePair<string, string>>)GetValue(InstrumentPropertiesProperty); }
            set { SetValue(InstrumentPropertiesProperty, value); }
        }

        public Command CloseCommand { get; }

        public InstrumentInformation()
        {
            CloseCommand = Command.Create(parameter => Closed?.Invoke(this, EventArgs.Empty));

            InitializeComponent();
            Root.DataContext = this;
        }
        #endregion

        #region -=Static members=-
        public static readonly DependencyProperty InstrumentPropertiesProperty = DependencyProperty.Register(
            "InstrumentProperties", typeof(List<KeyValuePair<string, string>>), typeof(InstrumentBrowser), new PropertyMetadata(default(List<KeyValuePair<string, string>>)));
        #endregion
    }
}
