using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Tango.Core;
namespace Tango.SharedUI.Editors
{
///
/// Represents a editor base class.
///
public class ParameterItemEditor : UserControl, IParameterItemEditor
{
///
/// Gets or sets the parameter item.
///
public ParameterItem ParameterItem
{
get { return (ParameterItem)GetValue(ParameterItemProperty); }
set { SetValue(ParameterItemProperty, value); }
}
public static readonly DependencyProperty ParameterItemProperty =
DependencyProperty.Register("ParameterItem", typeof(ParameterItem), typeof(ParameterItemEditor), new PropertyMetadata(null));
///
/// Gets or sets the parameterized object.
///
public IParameterized ParameterizedObject
{
get { return (IParameterized)GetValue(ParameterizedObjectProperty); }
set { SetValue(ParameterizedObjectProperty, value); }
}
public static readonly DependencyProperty ParameterizedObjectProperty =
DependencyProperty.Register("ParameterizedObject", typeof(IParameterized), typeof(ParameterItemEditor), new PropertyMetadata(null));
///
/// Initializes a new instance of the class.
///
public ParameterItemEditor()
{
DataContext = ParameterItem;
this.Loaded += ParameterItemEditor_Loaded;
}
///
/// Handles the Loaded event of the ParameterItemEditor control.
///
/// The source of the event.
/// The instance containing the event data.
private void ParameterItemEditor_Loaded(object sender, RoutedEventArgs e)
{
DataContext = ParameterItem;
}
}
}