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

RadWindow in child thread

11 Answers 286 Views
Window
This is a migrated thread and some comments may be shown as answers.
Tigran
Top achievements
Rank 1
Tigran asked on 15 Jul 2014, 03:44 PM
Hi everyone,

I'm creating RadWindow in separate thread, but when I reopen window after closing it , I'm getting System.Threading.Tasks.TaskCanceledException and don't know why. Here is my code

private void OnCreateNewWindow( object sender,  RoutedEventArgs e)
{
 
Thread thread = new Thread(() =>
                    {
 RadWindow win = new RadWindow();
 
 win.Show();
 
                            win.Closed += (sender2, e2) =>
                                {
                                    win.Dispatcher.InvokeShutdown();
                                };  
 
System.Windows.Threading.Dispatcher.Run();
});
 
thread.SetApartmentState(ApartmentState.STA);
                thread.IsBackground = true;
                thread.Start();
}

11 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 17 Jul 2014, 05:50 AM
Hi Tigran,

I've tested your code and everything is working fine on my side. I'm sending you my test project, could you modify it in order to reproduce the issue, so we'll be able to investigate it on our side? I've tested it with our latest official release - 2014.2 617 - is this the version you are using? Also are you using Tasks in any part of your application - the code you've sent is using Threads and it is not expected to raise TaskCanceledException.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Tigran
Top achievements
Rank 1
answered on 17 Jul 2014, 12:15 PM
Hello Rosen Vladimirov, thank you for your response very much.
I've tested project but it crashed. here are my steps:

 1) click on button  "Open Window in new thread", window opened successfully.

2) close opened window

3) click on button again. Program crashed.  
I have added try, catch blocks , and here is exception in image file.
0
Tigran
Top achievements
Rank 1
answered on 17 Jul 2014, 12:19 PM
Here is image
0
Rosen Vladimirov
Telerik team
answered on 17 Jul 2014, 01:35 PM
Hi Tigran,

May I ask you for the exact version of UI for WPF that you are using? I've tested the project with 2014.2 617 and everything is working fine on my side. I'm sending you a video demonstrating my test.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Tigran
Top achievements
Rank 1
answered on 17 Jul 2014, 01:51 PM
I watched video and everything was OK. I cannot understand  what's the reason, I'll try to test on another computer. I'm using version is  2014.2.617.45 Trial.  Thank you a lot for your time.
0
Rosen Vladimirov
Telerik team
answered on 17 Jul 2014, 02:56 PM
Hi Tigran,

We'll be waiting for you to test it on another machine, but meanwhile you can check the following:
1) Have you added the required assemblies:
    - Telerik.Windows.Controls.dll
    - Telerik.Windows.Controls.Navigation.dll
    - Telerik.Windows.Data.dll

2) What is the Operating system of your machine, I've tested it on Windows 8.1?
3) Do you have Touch screen or any Accessibility program running (Narrator, Maginifier, etc.)

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Tigran
Top achievements
Rank 1
answered on 17 Jul 2014, 09:25 PM
I've tested project on another machine but unforunately result was the same.Also I've reviewed and
1) Assemblies you've noted were added.
2) My OS is Win 7 x64
3) There aren't any running accessibility programs 
0
Rosen Vladimirov
Telerik team
answered on 18 Jul 2014, 11:32 AM
Hello Tigran,

Thank you for the additional information. We've tested the same project on machine with Windows 7 x64 and everything is working fine on our side. We've tested it with Visual Studio 2012 and Visual Studio 2013 - which one are you using?

Also can you try the attached project, which is not using Telerik controls and see if the same exception will be raised again?

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Tigran
Top achievements
Rank 1
answered on 18 Jul 2014, 11:40 AM
Hello Vladimir, 

I'm using Visual Studio 2012 and I have  tested the attached project  and everything worked properly without any exception !
0
Rosen Vladimirov
Telerik team
answered on 18 Jul 2014, 12:27 PM
Hi Tigran,

We have finally reproduced the issue. It turned out there is a difference when you use .Net 4.0 assemblies and .Net 4.5 assemblies in the last release. However the issue is already fixed, so you can download our latest internal build and test it on your side - everything should be working fine with it.

Hope this helps. Feel free to contact us in case you have any other problems or concerns. 

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Tigran
Top achievements
Rank 1
answered on 18 Jul 2014, 01:51 PM
Hi Vladimir,

I've downloaded the latest internal-build and now everything works perfect. Thank you very much !!!
Tags
Window
Asked by
Tigran
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Tigran
Top achievements
Rank 1
Share this question
or