RadWindow in child thread

12 posts, 0 answers
  1. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 15 Jul 2014 Link to this post

    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();
    }
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 17 Jul 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 in reply to Rosen Vladimirov Link to this post

    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.
  5. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 Link to this post

    Here is image
  6. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 17 Jul 2014 Link to this post

    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.
     
  7. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 in reply to Rosen Vladimirov Link to this post

    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.
  8. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 17 Jul 2014 Link to this post

    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.
     
  9. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 in reply to Rosen Vladimirov Link to this post

    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 
  10. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 18 Jul 2014 Link to this post

    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.
     
  11. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 18 Jul 2014 in reply to Rosen Vladimirov Link to this post

    Hello Vladimir, 

    I'm using Visual Studio 2012 and I have  tested the attached project  and everything worked properly without any exception !
  12. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 18 Jul 2014 Link to this post

    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.
     
  13. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 18 Jul 2014 in reply to Rosen Vladimirov Link to this post

    Hi Vladimir,

    I've downloaded the latest internal-build and now everything works perfect. Thank you very much !!!
Back to Top
UI for WPF is Visual Studio 2017 Ready