using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using System.ComponentModel; namespace Aiwaz.Editor.Controls { /// /// Interaction logic for PropertyItem.xaml /// public partial class PropertyItem : UserControl { public static readonly DependencyProperty PropertyNameProperty = DependencyProperty.Register("PropertyName", typeof(string), typeof(PropertyItem)); public static readonly DependencyProperty PropertyValueProperty = DependencyProperty.Register("PropertyValue", typeof(object), typeof(PropertyItem)); public static readonly DependencyProperty PropertyDescriptionProperty = DependencyProperty.Register("PropertyDescription", typeof(string), typeof(PropertyItem)); public static readonly DependencyProperty PropertyCategoryProperty = DependencyProperty.Register("PropertyCategory", typeof(string), typeof(PropertyItem)); public EventHandler DescriptionEventHandler; public event EventHandler OnActive; public PropertyItem() { InitializeComponent(); PropertyItemGrid.DataContext = this; } public string PropertyName { get { return (string)GetValue(PropertyItem.PropertyNameProperty); } set { SetValue(PropertyItem.PropertyNameProperty, value); } } public object PropertyValue { get{ return (string)GetValue(PropertyItem.PropertyValueProperty);} set{ SetValue(PropertyItem.PropertyValueProperty, value); } } public string PropertyDescription { get { return (string)GetValue(PropertyItem.PropertyDescriptionProperty); } set { SetValue(PropertyItem.PropertyDescriptionProperty, value);} } public string PropertyCategory { get { return (string)GetValue(PropertyItem.PropertyCategoryProperty); } set { SetValue(PropertyItem.PropertyCategoryProperty, value); } } #region events private void TextBox_MouseEnter(object sender, MouseEventArgs e) { if (OnActive != null) { OnActive(this, new DescriptionEventArgs(PropertyDescription)); } } #endregion } public class DescriptionEventArgs : EventArgs{ public string Description { get; set;} public DescriptionEventArgs(string descr){ this.Description = descr; } } }