|
Rank: Member Groups: Member
Joined: 5/9/2017 Posts: 14
|
If the focus is in the eobrowser control and you do ctrl+1, the app will crash. if the focus is outside, all is ok.
ctrl+1 was selected, but all the combinations i tried don't work see MyCommand.InputGestures.Add(new KeyGesture(Key.D1, ModifierKeys.Control)); for selecting another shortcut
Error is the following:
System.Exception: 'Failed to stop engine 'Default''
Sent a project to test it out via the contact us form.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, We have looked into your test project. Please try to wrap your code into Dispatcher.BeginInvoke:
Code: C#
private void MyCommandExecuted(object sender, ExecutedRoutedEventArgs e)
{
this.Dispatcher.BeginInvoke((System.Action)(() =>
{
EO.WebEngine.Engine.Default.Stop(false);
EO.WebEngine.Engine.Default.Start();
}));
}
This is necessary because you can't try to stop the Engine when the Engine is in the process of trying to call you back (this is like trying to take out the ladder you are currently standing on). So you have to return from your event handler first, then call Stop at a later time, which can be easily achieved by using Dispatcher.BeginInvoke. Thanks!
|
|
Rank: Member Groups: Member
Joined: 5/9/2017 Posts: 14
|
It worked perfectly! Thanks for your help!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Great. Glad that it worked for you!
|
|