public override void AddView() { StackPanel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Height = Double.NaN, Width = Double.NaN, }; DataChildren.Clear(); DataChildren.Add(StackPanel); }
public override void AddView() { var grid = new DataGrid() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Height = Double.NaN, Width = Double.NaN, AutoGenerateColumns = true, IsReadOnly = true }; var itemsBinding = new Binding() { Path = new System.Windows.PropertyPath("DefaultView"), Source = TableSource.ContentTable, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }; BindingOperations.SetBinding(grid, DataGrid.ItemsSourceProperty, itemsBinding); DataChildren.Clear(); DataChildren.Add(grid); }