Friend,
I have been scratching my head since two days to fix this issue, that, i have XamTimeline control inside a dock panel of XamDockManager, where DataMapping property is set with the Time value of data collection. It throws null reference exception in 2 scenarios a) When dock panel is undocked ( this happens in my production environment ) b) On launch of the application ( this happens on my POC , this is POC i did to reproduce the error that i am getting in production environment ). In my production environment, no issue till application is launched, it throws exception when a dock panel in undocked first time, once released the panel after undock, then further moving the panel is not throwing exception. Below is my poc code, could you please someone advice me to solve this issue. I can email my POC project if required. Thanks in advance.
My Code is
<igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedRight"> <igDock:ContentPane x:Name="rightEdgeDock" Header="rightttt"> <!-- #BEGIN SNIPPET# --> <ig:XamTimeline x:Name="timeline" Width="Auto" Margin="50,0" VerticalAlignment="Bottom"> <ig:XamTimeline.Axis> <ig:DateTimeAxis ScrollPosition="0.55" ScrollScale=".45" /> </ig:XamTimeline.Axis> <ig:XamTimeline.Series> <ig:DateTimeSeries DataMapping="Time=Time" DataSource="{Binding DateCollection}" /> </ig:XamTimeline.Series> </ig:XamTimeline> <!-- #END SNIPPET# -->
</igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager>
and error trace is :
> InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.TimelineSeries.GetEntries(double time) InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.XamTimeline.GetEntries(double time) InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.XamTimeline.ArrangeDetails() InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.Scene.ArrangeElements() InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.TimelineAxis.Axis_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e) PresentationFramework.dll!System.Windows.SizeChangedEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e) PresentationFramework.dll!System.Windows.FrameworkElement.OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo) PresentationCore.dll!System.Windows.ContextLayoutManager.fireSizeChangedEvents() PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() PresentationCore.dll!System.Windows.UIElement.UpdateLayout() InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.Scene.Axis.set(Infragistics.Controls.Timelines.TimelineAxis value) InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2.dll!Infragistics.Controls.Timelines.Scene.OnApplyTemplate.AnonymousMethod__42_0() WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state) mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state) WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) [Native to Managed Transition] [Managed to Native Transition] WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) PresentationFramework.dll!System.Windows.Application.Run() Chumma_WPF.exe!Chumma_WPF.App.Main() [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()
Thanks
Ravi.
Hello Ravi,
I have tested your POC code that you have provided, and I have received the exception that you are seeing. Upon further investigation, it appears that this exception is being caused from an incorrect syntax for the DataMapping, and if you add a semi-colon after each property mapping, you should no longer see this exception. For example, if you use the following code, everything should work correctly:
<ig:DateTimeSeries DataMapping="Time=Time;" DataSource="{Binding DateCollection}" />
One thing I am rather curious about in this case is whether the exception that is happening when you are floating your XamDockManager pane is the same one as the one you had listed or if it is a different one. Also, which version of the Infragistics for WPF assemblies are you using? I ask this, as there were a few issues that were logged and fixed with the most recent service release with regards to recreation of the XamTimeline, which would throw similar NullReferenceExceptions. These issues should be resolved against specific version 16.2.20162.2141 in Infragistics for WPF 2016 Volume 2.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thank you very Andrew for the quick response and solution. After adding semi-colon, the second issue that is exception thrown on launch of the application has been resolved. Thanks again for that. now i'm getting the NullReference exception that i'm getting in my production environment when i double click on the dock panel header in my POC as well.
so i'll copy my complete code of POC here, where i have 2 dock split panels named 'Lefttt' an 'rightttt' so on. I'm getting that exception when i double click on the header ( or title bar of dock panel ) of 'rightttt' named dockable split pane after launching the application.
My infragistics version is : Infragistics Developer Tools 2016.2 Version 16.2.20162.49 and WPF 2016.2 version 16.2.2045.
<Window
x:Class="Chumma_WPF.Views.DockableWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:igDock="http://infragistics.com/DockManager" xmlns:local="clr-namespace:Chumma_WPF.Views" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="DockableWindow" Width="300" Height="300" mc:Ignorable="d"> <Grid x:Name="gridMain"> <!-- #BEGIN SNIPPET# --> <!-- Create a XamDockManager control --> <igDock:XamDockManager Theme="IGTheme"> <!-- Add panes to the XamDockManager's Panes collection --> <igDock:XamDockManager.Panes> <!-- Left Dock Area ======================================================================= --> <!-- Add a SplitPane with a single ContentPane and set its initial location to DockedLeft The ContentPane will show up as 'pinned' since we have not set its IsPinned property which defaults to true. --> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedLeft"> <igDock:ContentPane x:Name="leftEdgeDock" Header="Lefttt"> <TextBlock Text="testt" /> </igDock:ContentPane> </igDock:SplitPane> <!-- Right Dock Area ====================================================================== --> <!-- Add a SplitPane with a single ContentPane and set its initial location to DockedRight The ContentPane will show up as 'pinned' since we have not set its IsPinned property which defaults to true. --> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedRight"> <igDock:ContentPane x:Name="rightEdgeDock" Header="rightttt"> <!-- #BEGIN SNIPPET# --> <ig:XamTimeline x:Name="timeline" Width="Auto" Margin="50,0" VerticalAlignment="Bottom"> <ig:XamTimeline.Axis> <ig:DateTimeAxis ScrollPosition="0.55" ScrollScale=".45" /> </ig:XamTimeline.Axis> <ig:XamTimeline.Series> <ig:DateTimeSeries DataMapping="Time=Time;" DataSource="{Binding DateCollection}" /> </ig:XamTimeline.Series> </ig:XamTimeline> <!-- #END SNIPPET# -->
</igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager> <!-- #END SNIPPET# --> </Grid></Window>
and Code behind :
using System;using System.Collections.Generic;using System.Collections.ObjectModel;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Shapes;
namespace Chumma_WPF.Views{ /// <summary> /// Interaction logic for DockableWindow.xaml /// </summary> public partial class DockableWindow : Window { public DockableWindow() { InitializeComponent(); gridMain.DataContext = this;
DateCollection = new ObservableCollection<DateColl>(); DateCollection.Add(new DateColl { Time = DateTime.Now }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) }); DateCollection.Add(new DateColl { Time = DateTime.Now.AddDays(10) });
}
public ObservableCollection<DateColl> DateCollection { get; set; } }
public class DateColl { public DateTime Time { get; set; } }}
Please advice me if anything i am missing in my code. Thanks in advance again.
Hi Andrew,
I upgraded my version to 16.2.20162.2141 , that fixed this issue. Thank you very much for your help.