WPF-Forge/Forge.Forms

Window(options) not working from minimized window

skadefro opened this issue · 6 comments

I'm trying to use your excellent product from within microsoft workflow foundation.
I've created an activity that launches a window using a dynamic form.
In normal operation I will minimize the UI when a workflow is running, so when a dialog, message box or window is opened you will need to force it to have focus. You can do that with window.Focus() or window.BringToFront()
But for some reason, using WindowOptions.BringToFront does not work (or work as I would assume it was suppose to )

object model = Forge.Forms.FormBuilding.FormBuilder.Default.GetDefinition(xmlString);
var options = new Forge.Forms.WindowOptions();
options.TopMost = true; options.BringToFront = true;
var _result = Forge.Forms.Show.Window(options).For<object>(model);

This works perfectly if the calling window is NOT minimized.
But if the window is minimized

  1. I need to manually click the new window in the task bar, or alt-tab too it
  2. when i mouse over the window, the cursor shows a loading icon for 10-15 seconds
  3. topmost is not respected.

Sub request, could we get an options.ScrollViewer , so if the form cannot fit inside the window, you get a scroll bar ?

@skadefro I tried to fix the window activation in ae56fd8 but it still decides to ignore the popup under some conditions. Could you please test it in your environment and let me know if you can figure anything out?

The scroller currently works only in XML. If you wrap your content in a <layout maxHeight="..."> it will display a vertical scrollbar if the content exceeds that number:

image

You can wrap your whole form in a layout or you can leave your buttons out of it such that they are always visible.

The update worked :-)
A little weird ux thing, the window does not have focus, but the cursor is blinking in the first textbox.
( look how the cursor is blinking inside both windows, and textpad is receiving input )
( at first i though it might be a timing issue (me minimizing while the dialog was opening so added a 500ms delay, still same issue )
Untitled

Thanks for the help. Looks like the window is getting logical focus but not keyboard focus. I'll try playing with Keyboard.Focus(...) later.

Hey @skadefro. Sorry for getting back so late. I added Keyboard.Focus(window) but I'm not sure if this will fix the issue. I tested by setting delayed dialogs but I can type right away with or without that line of code. If you can please try it and see if it works better now. Thank you.

If possible try it with an XML form and then a class form and see if the behavior is the same for both cases. If not then it's possible that the initial focus thing is not working for XML.

I think we can close this, i have a working solution, without using Forge.Forms.Show.Window.
Let me know if you make any changes to Window, then I'll gladly try it again