Using IWorkflowManager and IScreenManager (1 Viewer)

FreakyJ

Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    @morpheus_xx
    Sorry to bother you again :(

    I basically have one workflow model with several Screens.
    Inside the plugin.xml it is defined like this:
    XML:
    <Register Location="/Workflow/States">
        <WorkflowState Id="CB09DF01-65FA-4550-977C-B685C237ED3D"
            Name="TEST"
            MainScreen="ConfigScreen"
            DisplayLabel="InputDevices"
            WorkflowModel="CC11183C-01A9-4F96-AF90-FAA046981006"/>
        <WorkflowState Id="6ABF367E-346B-459F-B5A6-B61A1E285A64"
            Name="changingInputsMain" MainScreen="ConfigScreenKeyMapping"
            DisplayLabel="changingInputsMain"/>
        <WorkflowState Id="9907E2BF-CCE9-4CF7-9F4D-807F14A5DF47"
            Name="AddKey" MainScreen="ConfigScreenAddKey"
            DisplayLabel="ConfigScreenAddKey"/>
        <WorkflowState Id="FD7FEDE0-9268-41AE-AD0A-CC8066A41ED9"
            Name="AddAction" MainScreen="ConfigScreenAddAction"
            DisplayLabel="ConfigScreenAddAction"/>
      </Register>

    Inside the Workflow Model I use:
    Code:
    ServiceRegistration.Get<IWorkflowManager>().NavigatePush(Guid.Parse("6ABF367E-346B-459F-B5A6-B61A1E285A64"));

    It works, but the problem is that the screen gets added to the Navigation Stack. That means the user can go backwards by using Esc, but this screws up my workflow :(

    So I basically want to swap screens (.xaml files) without putting them on the navigation Stack (read: you can't go back by using Esc, it doesn't appear in the Navigation list on the top left corner.)

    I am sure this is a easy one, but I already spend sooo many hours on it... I promise I always try to figure it out myself first before I start asking you, but I am lost :(
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    First you could try to use: https://github.com/MediaPortal/Medi...tation/Workflow/IWorkflowManager.cs#L126-L138.

    But I don't remember exactly if it still pushes the step to navigation history. According to interface docs its main difference is to be able to use dynamical created WF state ids.

    And you should know that there are always ways to leave a screen, even if you prevent "escape" to pop a navigation state (i.e. by all shortcuts like "H" for "home"). So maybe it's better to use a dialog for input of new items?
    Or only conditionally show different controls in same screen?

    Please explain more in detail what you like to achieve.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    I have basically a wizzard:
    1) you anter Configuration -> than you'Re asked to push a button on the input device you would like to configure
    2) you have a list with all the ammpings for this device -> There you can press add or delete mappins
    3) after pressing Add: A Screen come where you push your key combination
    4) The next screen lets add you a action to this combination
    5) Back to step 2)

    Yousing NavigatePush always adds a an extra item to the nvigation stack, so after adding 5 mappings you have ~15 items in the navigation stack. That feels wrong to me^^

    I saw that function, but was confused that I have to create a new WorkflowState, because I already defined one in th eplugin.xml or am I wrong?
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Yousing NavigatePush always adds a an extra item to the nvigation stack, so after adding 5 mappings you have ~15 items in the navigation stack. That feels wrong to me^^
    The "Finish" step should do a "NavigatePop" to your starting workflow state. This removes all later steps.

    I saw that function, but was confused that I have to create a new WorkflowState, because I already defined one in th eplugin.xml or am I wrong?
    You are right, it's not related to your question.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    I've solved my issue by including the subscreens into a main screen file and use IsVisible on a container element for each subscreen :)
    So thank you for your help ;)
     

    Users who are viewing this thread

    Top Bottom