
I'm trying to throw together a sample project with just the basic for creating ToolWindows by binding objects to the ToolItemsSource property. I've been looking at the sample code that shows how the sample in the sample browser does it, but I'm missing something and not sure what. What happens right now is just that nothing shows up except for the static windows I describe in the xaml even though I'm binding objects to ToolItemsSource.
This is the xaml for the main window:And then on the back end I do my binding like this:
There's probably something simple that I'm missing. Let me know if I need to explain something else or anything. Thanks for the help :)
This is the xaml for the main window:
<docking:DockSite Name="dockSite" ToolItemsSource="{Binding}" >
<docking:DockSite.ToolItemContainerStyle>
<Style TargetType="docking:ToolWindow">
<Setter Property="Title" Value="{Binding Name}"/>
</Style>
</docking:DockSite.ToolItemContainerStyle>
<docking:Workspace>
<docking:StandardMdiHost>
<docking:DocumentWindow Title="Static docking window"/>
</docking:StandardMdiHost>
</docking:Workspace>
</docking:DockSite>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
ObservableCollection<Tool> tools = new ObservableCollection<Tool>();
tools.Add(new Tool("Tool 1"));
tools.Add(new Tool("Tool 2"));
DataContext = tools;
}
}
public class Tool
{
String name;
public Tool(String name)
{
this.name = name;
}
public String Name
{
get { return name; }
}
}