public PropertyItem(object instance, PropertyDescriptor property, PropertyGrid propertyGrid) { PropertyDescriptor = property; PropertyGrid = propertyGrid; Instance = instance; CommandBindings.Add(new CommandBinding(PropertyItemCommands.ResetValue, ExecuteResetValueCommand, CanExecuteResetValueCommand)); AddHandler(Mouse.MouseDownEvent, new MouseButtonEventHandler(PropertyItem_MouseDown), true); AddHandler(Mouse.PreviewMouseDownEvent, new MouseButtonEventHandler(PropertyItem_PreviewMouseDown), true); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 27 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 2: #line 28 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 3: #line 29 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 4: #line 30 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 5: #line 36 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 6: #line 37 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 7: #line 38 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 8: #line 39 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 9: #line 42 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 10: this.nodePanel = ((System.Windows.Controls.ContentControl)(target)); return; case 11: this.workPanel = ((System.Windows.Controls.TabControl)(target)); return; case 12: this.desienerPanel = ((System.Windows.Controls.ContentControl)(target)); return; case 13: this.desigeerActionList = ((System.Windows.Controls.ListBox)(target)); return; case 14: #line 66 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.TabItem)(target)).GotFocus += new System.Windows.RoutedEventHandler(this.TabItemGotFocusRefreshXamlBox); #line default #line hidden return; case 15: this.xamlTextBox = ((System.Windows.Controls.TextBox)(target)); return; case 16: this.propertyGrid = ((System.Windows.Controls.PropertyGrid)(target)); return; case 17: this.templateList = ((System.Windows.Controls.ContentControl)(target)); return; case 18: this.userList = ((System.Windows.Controls.ContentControl)(target)); return; case 19: this.statusInfo = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }
protected void CreatePropertyGrid() { propertyGridScrollViewer = new ScrollViewer() { HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Margin = new Thickness(8), HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Top, MinWidth = 200.0, Background = new SolidColorBrush(Color.FromArgb(255, 255, 255, 233)), Visibility = Visibility.Collapsed }; PropertyGrid = new PropertyGrid(); MEFHost.Instance.SatisfyImportsOnce(PropertyGrid); PropertyGrid.Margin = new Thickness(4); propertyGridScrollViewer.Content = PropertyGrid; PropertyGrid.VisibilityChanged += PropertyGrid_VisibilityChanged; Canvas.SetZIndex(propertyGridScrollViewer, (int)ZOrder.StatusBar); PropertyGrid.ValueDiscoveryStrategy = new ExcludeByDefaultValueDiscoveryStrategy(); }
private static void ToolbarVisiblePropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e) { PropertyGrid pg = source as PropertyGrid; pg.PropertyToolBar.Visibility = e.NewValue.Equals(true) ? Visibility.Visible : Visibility.Collapsed; }