Custom Views
Note
This feature is available in Acuit Pinpoint Workstation version 7.11 or later.
Overview
Custom views are XAML files containing WPF elements that define a user interface that should appear within Acuit Pinpoint Workstation and that can optionally interact with workflows.
Note
While both the workflow and views are defined via XAML, they use different sets of elements.
Custom views can appear in any of the predefined regions within Acuit Pinpoint Workstation that support plug-ins.
General Steps
These are the general steps to create and use custom views with Acuit Pinpoint Workstation:
- Create a XAML file that defines your custom view, keeping in mind within which region in Acuit Pinpoint Workstation you plan for it to appear.
- Deploy the file to the Acuit Pinpoint server and configure Acuit Pinpoint to use it via the Workstation:Views configuration section.
Data Binding
Data Context
Acuit Pinpoint Workstation automatically provides a data context object to each custom view (via the view's DataContext property) that the view can use to interact with workflows via data binding.
The data context object will implement ICustomViewDataContext and will be a single object instance shared by all custom views.
Workflows can make data available to views by defining variables on the root workflow activity.
Views can bind to those variables by name via UnitLoadedWorkflowData
.
Binding Examples
A workflow could produce a message to display in a custom view by defining a root-level variable and then setting it within the workflow like this:
<!-- The root workflow activity: --> <Sequence xmlns="http://schemas.acuit.com/pinpoint/2020/xaml/workflows"> <Sequence.Variables> <Variable Name="Message" Type="string" /> </Sequence.Variables> <!-- Do this anywhere in the workflow to set or change the message: --> <SetVariable Name="Message" Value="Hello, world!" /> </Sequence>
And the view could display the message like this:
<TextBlock Text="{Binding UnitLoadedWorkflowData.Message}" />
A view could contain a button that raises a UICommandEvent that can trigger a WaitForUICommand activity in a workflow like this:
<Button Command="{Binding UnitLoadedWorkflowUICommand}" CommandParameter="Continue">Continue</Button>
And the workflow could wait for the button click like this:
<WaitForUICommand CommandName="Continue" />