The UIProvider is used to initiate new UI flows, for example showing the
login dialog. To get an instance of UIProvider to work with, import the
IUIProvider service in your constructor:
[ImportingConstructor]
public ExampleViewModel(IUIProvider uiProvider)
{
this.uiProvider = uiProvider;
}
To initiate a UI flow, call SetupUI with the desired UIControllerFlow,
passing in an IConnection if the flow is not the login flow:
// Here we're starting the login flow (Authentication) so we pass null as the
// connection.
var transition = uiProvider.SetupUI(UIControllerFlow.Authentication, null)
To run the flow, call RunUI:
uiProvider.RunUI();
The SetupUI method returned an observable which tracks the current state of
the UI flow and will complete when the flow is complete, either because the
flow progressed to completion or because the user cancelled the operation:
transition.Subscribe(
_ => { /* Called with the current flow state */ },
() => { /* Called when the flow completes */ });