public TextBoxWithLister() { DockPanel dock = new DockPanel(); Content = dock; txtbox = new TextBox(); txtbox.TextChanged += TextBoxOnTextChanged; dock.Children.Add(txtbox); DockPanel.SetDock(txtbox, Dock.Top); lister = new Lister(); lister.SelectionChanged += ListerOnSelectionChanged; dock.Children.Add(lister); }
// Constructor. public TextBoxWithLister() { // Create DockPanel as content of control. DockPanel dock = new DockPanel(); Content = dock; // TextBox is docked at top. txtbox = new TextBox(); txtbox.TextChanged += TextBoxOnTextChanged; dock.Children.Add(txtbox); DockPanel.SetDock(txtbox, Dock.Top); // Lister fills remainder of DockPanel. lister = new Lister(); lister.SelectionChanged += ListerOnSelectionChanged; dock.Children.Add(lister); }