From last post we will create the Property Inspector window
and include it in the WPF grid. To
do this, in Solution Explorer
right-click the MainWindow.xaml files,
choose View Code. Modify the code by
following these steps:
- Place
the PropertyInspector window to the
rightmost column of the WPF grid. To do this, add a private method AddPropertyInspector to the MainWindow class.C#private void AddPropertyInspector(){Grid.SetColumn(wd.PropertyInspectorView, 2);grid1.Children.Add(wd.PropertyInspectorView);}Visual BasicPrivate Sub AddPropertyInspector()Grid.SetColumn(wd.PropertyInspectorView, 2)grid1.Children.Add(wd.PropertyInspectorView)End Sub
- End Sub
- Add
a call to the AddPropertyInspector
method created in the previous step. To do this, add the following code (shown
in bold) to MainWindow class constructor.C#public MainWindow(){InitializeComponent();this.RegisterMetadata();this.AddDesigner();this.AddToolBox();this.AddPropertyInspector();}Visual BasicPublic Sub New()InitializeComponent()Me.RegisterMetadata()Me.AddDesigner()Me.AddToolBox()Me.AddPropertyInspector()End Sub
- Press CTRL+S to save the changes
No comments:
Post a Comment