Problems with radTransitionControl in threaded window

2 posts, 0 answers
  1. Paw
    Paw avatar
    8 posts
    Member since:
    Mar 2010

    Posted 05 Jan 2011 Link to this post

    Hi
    In my application each thread is implemented in its own thread like:

    public void OpenPartViewer(AbstractPart part)
    {
      Thread newWindowThread = new Thread(new ThreadStart(ThreadStartingPoint));
      newWindowThread.SetApartmentState(ApartmentState.STA);
      newWindowThread.IsBackground = true;
      newWindowThread.Start();
      part_ = part;
    }
      
    private void ThreadStartingPoint()
    {
      // Create a new window
      PartViewerMainWindow win = new PartViewerMainWindow(part_);
      win.Closed += (sender1, e1) => win.Dispatcher.InvokeShutdown();
      win.Show();
      // Start the new window's Dispatcher
      System.Windows.Threading.Dispatcher.Run();
    }

    In one of the dialogs I previously used a ContentControl which I now want to replace with a RadTransitionControl like the above.

    <telerik:RadTransitionControl x:Name="PartViewerContent" Grid.Column="1" VerticalContentAlignment="Stretch"     HorizontalContentAlignment="Stretch"
            Content="{Binding ElementName=TreeView, Path=SelectedItem}"
            ContentTemplateSelector="{StaticResource PartViewerContentSelector}">
    </telerik:RadTransitionControl>

    But after changing to RadTransitionControl I get an error when I change selection in the treeview:

    The calling thread cannot access this object because a different thread owns it

    I asume it is raised because the transitions is rendered in the main thead but I don't know. And more important. Can I do some magic to make it work.

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 11 Jan 2011 Link to this post

    Hi Paw,

     I cannot fully understand what your scenario is. As it sounds quite complicated, could you please open a support ticket and send us a sample project that reproduces the problem? This would help investigate what exactly goes wrong.

    Regards,
    Miroslav Nedyalkov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top