public PropertyRow(PropertyGridView view, PropertyItem property, PropertyLabel label, EditorBase editor) { Requires.NotNull<PropertyGridView>(view, "view"); Requires.NotNull<PropertyItem>(property, "property"); Requires.NotNull<PropertyLabel>(label, "label"); Requires.NotNull<EditorBase>(editor, "editor"); this.View = view; this.Property = property; this.Label = label; this.Editor = editor; label.Name = "lbl" + property.Name; label.Foreground = property.CanWrite ? Brushes.Black : Brushes.Gray; label.MouseLeftButtonDown += LabelMouseLeftButtonDown; label.MouseLeftButtonUp += LabelMouseLeftButtonUp; editor.GotFocus += EditorGotFocus; editor.LostFocus += EditorLostFocus; }
protected virtual FrameworkElement GetItemEditor(EditorBase editor, string category) { return new Border() { Name = Guid.NewGuid().ToString("N"), Margin = new Thickness(1, 0, 0, 0), BorderThickness = new Thickness(0, 0, 0, 1), BorderBrush = CommonBackground, Child = editor, Tag = category }; }