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

RadWindow.Alert Exception

3 Answers 234 Views
Window
This is a migrated thread and some comments may be shown as answers.
rui
Top achievements
Rank 1
rui asked on 11 Jan 2017, 07:52 AM

There is a small probability issue:

when in a child thread  call the RadWindow.Alert method  to show a message window 

i use Application.Current.Dispatcher.BeginInvoke to call main thread

 Application.Current.Dispatcher.BeginInvoke((Action)delegate
                {
                    RadWindow.Alert(new DialogParameters { Header = StringResources.GetCodeMessage("TiShi"), Content = "error", Owner = Application.Current.MainWindow });
                });

then there is a NullReferenceException  occur

the exception stack is as following

在 Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item)
   在 System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   在 System.Linq.Enumerable.Max(IEnumerable`1 source)
   在 System.Linq.Enumerable.Max[TSource](IEnumerable`1 source, Func`2 selector)
   在 Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__6(Double total, List`1 next)
   在 System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
   在 Telerik.Windows.Controls.Primitives.TabStripPanel.MeasureOverride(Size availableSize)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 System.Windows.ContextLayoutManager.UpdateLayout()
   在 System.Windows.UIElement.UpdateLayout()
   在 System.Windows.Interop.HwndSource.SetLayoutSize()
   在 System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   在 System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   在 System.Windows.Window.SetRootVisual()
   在 System.Windows.Window.SetRootVisualAndUpdateSTC()
   在 System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
   在 System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   在 System.Windows.Window.CreateSourceWindowDuringShow()
   在 System.Windows.Window.SafeCreateWindowDuringShow()
   在 System.Windows.Window.ShowHelper(Object booleanBox)
   在 System.Windows.Window.Show()
   在 System.Windows.Window.ShowDialog()
   在 Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(Boolean isModal)
   在 Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal)
   在 Telerik.Windows.Controls.RadWindow.ShowDialog()
   在 Telerik.Windows.Controls.RadWindow.ConfigureModal(RadAlert content, DialogParameters dialogParams)
   在 Telerik.Windows.Controls.RadWindow.Alert(DialogParameters dialogParameters)
   在 Eurlanda.DataShire.DataShireIDE.MainUserControl.<MainUserControl_Loaded>b__13() 位置 g:\datashire_cloud_IDE\Eurlanda.DataShire.DataShireIDE\MainUserControl.xaml.cs:行号 528
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I have no idea about this  issue  

Is any solution to avoid?

 

3 Answers, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 13 Jan 2017, 03:02 PM
Hi Rui,

We've tried to reproduce the issue at our side but to no avail.
I suggest you open a support thread and attach your project so we can investigate further.

Regards,
Polya
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
rui
Top achievements
Rank 1
answered on 16 Jan 2017, 08:21 AM

This issue is under A very small probability, It is difficult to appear again,

if the exception message  is  no help ,it seems there is no way to solve

0
Polya
Telerik team
answered on 17 Jan 2017, 08:53 AM
Hello Rui,

If you manage to reproduce it in a sample project please write back with more details so we can investigate further.

Regards,
Polya
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Window
Asked by
rui
Top achievements
Rank 1
Answers by
Polya
Telerik team
rui
Top achievements
Rank 1
Share this question
or