Many binding errors wher reloading layout

Docking/MDI for WPF Forum

Posted 9 years ago by wpf.acp
Version: 9.1.0507
Avatar
I get a lot of binding errors when trying to reload a docking layout. The errors, XAML and code are below and I am also sending you a complete project to support email.

The errors make no difference to UI experience but looks ugly in the debug output sometimes making debugging own issues harder due to the noise generated.
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name=''); target element is 'ToolWindow' (Name=''); target property is 'Name' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='ToolWindow' (Name='_tool'); target element is 'ToolWindow' (Name='_tool'); target property is 'Name' (type 'String')
<Window x:Class="DockingBindingErrors.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:docking="clr-namespace:ActiproSoftware.Windows.Controls.Docking;assembly=ActiproSoftware.Docking.Wpf30"
        Title="Window1"
        Name="_this"
        Height="600"
        Width="800">
    
    <docking:DockSite x:Name="_dockSite"
                      CanToolWindowsRaft="False"
                      CanToolWindowsBecomeDocuments="False"
                      CanToolWindowsClose="False"
                      CanToolWindowsAttach="True"
                      CanToolWindowsDockBottom="True"
                      CanToolWindowsDockTop="True"
                      CanToolWindowsDockLeft="True"
                      CanToolWindowsDockRight="True">
        <docking:SplitContainer>
            <docking:Workspace>
                <docking:TabbedMdiHost x:Name="tabbedMdiHost">
                    <docking:TabbedMdiContainer x:Name="_tabbedMdiContainer">
                        <docking:ToolWindow HasTitleBar="False"
                                            Name="_tool">
                            <Button HorizontalAlignment="Left" VerticalAlignment="Top" Click="ReloadLayout_OnClick">Reload Layout</Button>
                        </docking:ToolWindow>
                    </docking:TabbedMdiContainer>
                </docking:TabbedMdiHost>
            </docking:Workspace>

            <docking:ToolWindowContainer>
                <docking:ToolWindow Title="Options 1"
                                    x:Name="_toolOptions1">
                </docking:ToolWindow>

                <docking:ToolWindow Title="Options 2"
                                    x:Name="_toolOptions2">
                </docking:ToolWindow>
            </docking:ToolWindowContainer>
        </docking:SplitContainer>
    </docking:DockSite>
</Window>
using System;
using System.Windows;
using ActiproSoftware.Windows.Controls.Docking.Serialization;

namespace DockingBindingErrors
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1
    {
        public Window1()
        {
            InitializeComponent();
        }

        private void ReloadLayout_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var serializer = new DockSiteLayoutSerializer();
                var layout = serializer.SaveToString(_dockSite);

                serializer.LoadFromString(layout, _dockSite);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
    }
}

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I ran this with build 507 and do see the binding errors in the output window but in our latest codebase for the next build I don't see them. I believe we already looked into these and have resolved them for the next build.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.