Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running RibbonWindow not on the main thread. #325

Closed
polepage opened this issue Jun 10, 2016 · 3 comments
Closed

Running RibbonWindow not on the main thread. #325

polepage opened this issue Jun 10, 2016 · 3 comments
Labels
Milestone

Comments

@polepage
Copy link

For reasons out of my control (involving legacy code and things like that), I want to run a RibbonWindow on another UI thread. However, because of the use of Application.Current.MainWindow in IconConverter and ObjectToImageConverter, The application obviously crash because I'm calling from another thread.

Is there a way around this that does not requires me to build my own version of Fluent.Ribbon?
If not, would a thread friendly version of those converters would be considered if submitted for contribution?

Thank you
Pierre

Environment

  • Fluent.Ribbon v4.0.3.394
  • Theme: Office 2013
  • Windows 10
  • .NET Framework 4.6.1
@batzen batzen added this to the 5.0.0 milestone Jun 10, 2016
@batzen
Copy link
Member

batzen commented Jun 10, 2016

I would happily accept a version of those converters which is thread friendly.
Any ideas you would like to share?

@polepage
Copy link
Author

For now my only idea is to always access the property on the main thread using an Invoke on the Application.Current.Dispatcher. However this is a bit less friendly for normal people that use the main thread as their UI thread.

I'll gladly provide more ideas as they come and I will offer my contribution when I have some actual working code.

Thanks.
Pierre.

@batzen
Copy link
Member

batzen commented Jun 11, 2016

Switching to the applications main thread would cause the current window, running in a different thread, to be locked until the main thread is no longer locked.
I will add checks for different threads and just disabled dpi scaling for the images if the converter is not run on the applications main thread.

@batzen batzen closed this as completed in 7785664 Jun 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants