ButchersBoy / Dragablz

Dragable and tearable tab control for WPF
http://dragablz.net
MIT License
2.17k stars 321 forks source link

BindingExpression path error in Demo #220

Open zenchanhk opened 5 years ago

zenchanhk commented 5 years ago

Hi, I found binding errors when running demo 'Simple form of bound tabs'. When docking a tab, the following binding errors always showed in VS output windows.

System.Windows.Data Error: 40 : BindingExpression path error: 'Items' property not found on 'object' ''Object' (HashCode=48761158)'. BindingExpression:Path=Items; DataItem='Object' (HashCode=48761158); target element is 'TabablzControl' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')
System.Windows.Data Error: 40 : BindingExpression path error: 'ClosingTabItemHandler' property not found on 'object' ''Object' (HashCode=48761158)'. BindingExpression:Path=ClosingTabItemHandler; DataItem='Object' (HashCode=48761158); target element is 'TabablzControl' (Name=''); target property is 'ClosingItemCallback' (type 'ItemActionCallback')
System.Windows.Data Error: 40 : BindingExpression path error: 'InterTabClient' property not found on 'object' ''Object' (HashCode=48761158)'. BindingExpression:Path=InterTabClient; DataItem='Object' (HashCode=48761158); target element is 'InterTabController' (Name=''); target property is 'InterTabClient' (type 'IInterTabClient')
System.Windows.Data Error: 40 : BindingExpression path error: 'InterTabClient' property not found on 'object' ''Object' (HashCode=48761158)'. BindingExpression:Path=InterTabClient; DataItem='Object' (HashCode=48761158); target element is 'InterTabController' (Name=''); target property is 'InterTabClient' (type 'IInterTabClient')

After digging into the code, it should be caused by the following code in BoundExampleWindow.xaml:

<!-- branch template lets dragablz create a new tab control after a window is split via docking -->
        <dockablz:Layout.BranchTemplate>
            <DataTemplate>
                <dragablz:TabablzControl Style="{StaticResource TabablzControlStyle}">
                    <dragablz:TabablzControl.InterTabController>
                        <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" Partition="2AE89D18-F236-4D20-9605-6C03319038E6" />
                    </dragablz:TabablzControl.InterTabController>
                </dragablz:TabablzControl>
            </DataTemplate>
        </dockablz:Layout.BranchTemplate> 

The above bindings could not properly work. But I have no idea how to correct it. Could someone help me out? Thanks.

yoyokits commented 4 years ago

Hi I have exactly the same problem. Please inform us how to fix it or maybe an update. It is not demo but the implementation of my code. It will happen if we drag the tab to the left side of the current tab window.

'VideoBrowser.exe' (CLR v4.0.30319: VideoBrowser.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemCore\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. System.Windows.Data Error: 40 : BindingExpression path error: 'TabItems' property not found on 'object' ''Object' (HashCode=39940984)'. BindingExpression:Path=TabItems; DataItem='Object' (HashCode=39940984); target element is 'TabablzControl' (Name=''); target property is 'ItemsSource' (type 'IEnumerable') System.Windows.Data Error: 40 : BindingExpression path error: 'ClosingTabItemHandler' property not found on 'object' ''Object' (HashCode=39940984)'. BindingExpression:Path=ClosingTabItemHandler; DataItem='Object' (HashCode=39940984); target element is 'TabablzControl' (Name=''); target property is 'ClosingItemCallback' (type 'ItemActionCallback') System.Windows.Data Error: 40 : BindingExpression path error: 'InterTabClient' property not found on 'object' ''Object' (HashCode=39940984)'. BindingExpression:Path=InterTabClient; DataItem='Object' (HashCode=39940984); target element is 'InterTabController' (Name=''); target property is 'InterTabClient' (type 'IInterTabClient') System.Windows.Data Error: 40 : BindingExpression path error: 'InterTabClient' property not found on 'object' ''Object' (HashCode=39940984)'. BindingExpression:Path=InterTabClient; DataItem='Object' (HashCode=39940984); target element is 'InterTabController' (Name=''); target property is 'InterTabClient' (type 'IInterTabClient') The thread 0x2d94 has exited with code 0 (0x0).