This is a migrated thread and some comments may be shown as answers.

Problem with docking control and saved layouts...

2 Answers 86 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 24 Nov 2011, 03:47 PM
Hello,

I made this post a few weeks ago about loading a layout with pinned panels which appeared to have been fixed in the intial Q3-2011 release...  I just downloaded the latest internal build yesterday (1022) and it now seems to be throwing a different exception whenever I hit any of my pages with a docking control...

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Docking.PaneGroupBase.OnPaneCommandCanExecute(Object sender, CanExecuteRoutedEventArgs e)
   at Telerik.Windows.Controls.CommandBinding.OnCanExecute(Object sender, CanExecuteRoutedEventArgs e)
   at Telerik.Windows.Controls.CommandManager.CanExecuteCommandBinding(Object sender, CanExecuteRoutedEventArgs e, CommandBinding commandBinding)
   at Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at Telerik.Windows.Controls.CommandManager.OnCanExecute(Object sender, CanExecuteRoutedEventArgs e)
   at Telerik.Windows.Controls.CanExecuteRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
   at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
   at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
   at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
   at Telerik.Windows.Controls.RoutedCommand.CanExecuteImpl(Object parameter, UIElement target, Boolean& continueRouting)
   at Telerik.Windows.Controls.RoutedCommand.CanExecuteInternal(Object parameter, UIElement target, Boolean& continueRouting)
   at Telerik.Windows.Controls.RoutedCommand.CanExecute(Object parameter, UIElement target)
   at Telerik.Windows.Controls.RadMenuItem.CanExecuteApply()
   at Telerik.Windows.Controls.RadMenuItem.OnCommandTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.SendDataToTarget()
   at System.Windows.Data.BindingExpression.SourceAcquired()
   at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
   at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
   at System.Windows.DataContextChangedEventHandler.Invoke(Object sender, DataContextChangedEventArgs e)
   at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
   at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)
   at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
   at System.Windows.FrameworkElement.set_DataContext(Object value)
   at Telerik.Windows.Controls.RadPane.OnContextMenuTemplateChanged()
   at Telerik.Windows.Controls.RadPane.OnContextMenuTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty property)
   at MS.Internal.FrameworkCallbacks.InvalidateProperty(IntPtr nativeTarget, UInt32 propertyId)

2 Answers, 1 is accepted

Sort by
0
Rob
Top achievements
Rank 1
answered on 24 Nov 2011, 08:40 PM

Here's a simple project that demonstrates the issue...  After loading this project and unpinning both panes the next refresh will crash.

<UserControl    x:Class="SilverlightApplication83.MainPage"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
>
 
    <Grid x:Name="LayoutRoot" Background="White">
 
        <telerik:RadDocking x:Name="rd" telerik:RadDocking.SerializationTag="RadDocking" PaneStateChange="RadDocking_PaneStateChange">
 
            <!-- main -->
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer telerik:RadDocking.SerializationTag="rsc_Main">
                    <telerik:RadPaneGroup telerik:RadDocking.SerializationTag="rpg_Main">
                        <telerik:RadPane telerik:RadDocking.SerializationTag="rp_Main">
                            <Border Background="Pink" BorderBrush="Red" BorderThickness="2">
                                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="main" Foreground="Red" FontSize="15" />
                            </Border>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
 
            <!-- bottom -->
            <telerik:RadSplitContainer InitialPosition="DockedBottom" telerik:RadDocking.SerializationTag="rsc_Bottom">
                <telerik:RadPaneGroup telerik:RadDocking.SerializationTag="rpg_Bottom">
                    <telerik:RadPane telerik:RadDocking.SerializationTag="rp_Bottom">
                        <Border Background="YellowGreen" BorderBrush="Green" BorderThickness="2">
                            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="bottom" Foreground="Green" FontSize="15" />
                        </Border>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
 
            <!-- right -->
            <telerik:RadSplitContainer InitialPosition="DockedRight" telerik:RadDocking.SerializationTag="rsc_Right">
                <telerik:RadPaneGroup telerik:RadDocking.SerializationTag="rpg_Right">
                    <telerik:RadPane telerik:RadDocking.SerializationTag="rp_Right">
                        <Border Background="LightBlue" BorderBrush="Blue" BorderThickness="2">
                            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="right" Foreground="Blue" FontSize="15" />
                        </Border>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
 
        </telerik:RadDocking>
 
    </Grid>
     
</UserControl>
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.IsolatedStorage;
using System.Windows;
using System.Windows.Controls;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using System.Text;
 
 
namespace SilverlightApplication83
{
 
    public partial class MainPage : UserControl
    {
         
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
 
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            LoadDockingPreferences();
        }
 
        private void LoadDockingPreferences()
        {
            try
            {
                using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
                {
 
                    string xml = string.Empty;
 
                    if (storage.FileExists("test.xml"))
                    {
 
                        using (var isoStream = storage.OpenFile("test.xml", FileMode.Open))
                        {
                            StreamReader reader = new StreamReader(isoStream);
     
                        rd.LoadLayout(isoStream);
 
                        }
 
                    }
 
                }
 
 
 
            }
            catch (FileNotFoundException)
            {
                return;
            }
            catch (IsolatedStorageException)
            {
                return;
            }
        }
 
        private string SaveDockingPreferences()
        {
            string xml;
            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                using (var isoStream = storage.OpenFile("test.xml", FileMode.OpenOrCreate))
                {
                    rd.SaveLayout(isoStream);
                    isoStream.Seek(0, SeekOrigin.Begin);
                    StreamReader reader = new StreamReader(isoStream);
                    xml = reader.ReadToEnd();
                }
            }
            return xml;
        }
 
        private void RadDocking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            SaveDockingPreferences();
        }
 
    }
 
}

0
George
Telerik team
answered on 29 Nov 2011, 03:01 PM
Hello Rob,

 
Thank you for contacting us.

We reproduce the exception on our side with the LIB from 1122, but we can confirm that this problem is already solved and it will be included with the next internal week next week. I hope this is acceptable for you. Please, excuse us for any inconvenience caused.

Regards,
George
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Docking
Asked by
Rob
Top achievements
Rank 1
Answers by
Rob
Top achievements
Rank 1
George
Telerik team
Share this question
or