I want to have my HMI application automatically scale in size when the user changes the size of the application or it is run on different PC with different screen resolution.

Use a ViewBox in the Window XAML code.

When you create a WPF application by default the first container in the window is a Grid. Each container has an opening and closing statement in the XAML file.

For example:

<Window x:Class=”MainWindow”

xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”

xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

Title=”MainWindow” Height=”350″ Width=”525″>

<Grid>

…..

</Grid>

</Window>



All of your content will be in the grid.

To create a window with resizable content add a ViewBox to the window and put the grid in the ViewBox.

Example:

<Window x:Class=”MainWindow”

xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”

xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

Title=”MainWindow” Height=”350″ Width=”525″>

<Viewbox>

<Grid>

….

</Grid>

</Viewbox>

</Window>



Select the view box and set the stretch property the way you want the application to respond. The options are None, Fill, Uniform and Uniform to Fill. The default is uniform.

How do I implement Data Binding from an Open Automation Software Tag Value?

Use the OPCWPFContent control.  Following is an example:

<Slider Height=""41"" HorizontalAlignment=""Left"" Margin=""70,190,0,0"" Name=""Slider1"" VerticalAlignment=""Top"" Width=""421"" Maximum=""100""
TickPlacement=""BottomRight""
Value=""{Binding Content, ElementName=OPCWPFContent1}"" />
 
<my:OPCWPFContentControl x:Name=""OPCWPFContent1""  Height=""27"" Margin=""222,104,287,0"" VerticalAlignment=""Top""
ToolTipBadQualityText=""0"" ContentBadQualityText=""0"" Content_Tag=""Ramp.Value""/>

I receive an error stating that the Microsoft.Expression.Drawing.dll and Microsoft.Expression.Effects.dll is missing and not found.

These assemblies are included in the installation directory of Open Automation Software and can be included as a Reference in your project as local copy.

Or you can install the Blend SDK from the following link that also includes these files.

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=75e13d71-7c53-4382-9592-6c07c6a00207

What assemblies do I need to deploy with my application?

Include the following in References as Local Copy:

  • C1.Win.C1FlexGrid2.dll
  • Microsoft.Expression.Drawing.dll
  • Microsoft.Expression.Effects.dll
  • Microsoft.Expression.Interactions.dll
  • Nevron.Chart.dll
  • Nevron.Chart.WinForm.dll
  • Nevron.GraphicsGL.dll
  • Nevron.Presentation.dll
  • Nevron.System.dll
  • OPCAlarmControl.dll
  • OPCSystemsInterface.dll
  • OPCTrendControl.dll
  • OPCWPFDashboard.dll

After updating Open Automation Software with the incremental update the project no longer compiles or the application no longer works.

Make sure to Unblock the dlls before copying to C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\ or C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\.

To Unblock the files copy to a trusted location for your system, Desktop works well, then right click on the file and select Properties to select Unblock. Then copy from your Desktop to the correct directory in C:\Program Files\Open Automation Software\OAS\Controls\.

My OPCWPFDashboard Button flashes when the user hovers the mouse over the button.

This is default for a WPF Button control, but the behavior can be changed with the following steps using Expression Blend.

  1. Select the button, and right click on the button, select Edit Template-Edit a Copy.  Select OK.
  2. With the new template selected reset the RenderMouseOver, and RenderPressed property.
  3. Select Triggers, and delete the IsKeyboardFocused trigger.
  4. Apply the new template to all buttons.  Select the button, right click, and select Edit Template-Apply Resource.

Getting Started – WPF HMI Dashboard

  • A ready to go template with built in trending and alarming.
  • Template for developing new windows.
  • Designed to run on multiple PC’s that have different screen resolutions.
  • Provides 10 user customizable desktop displays based on user login.
  • User selections are persisted across all PC terminals.
  • Demonstrates the use of Open Automation Software Custom Objects.
  • Demonstrates how to theme an application.
  • Demonstrates the use and development of gadgets.
  • Demonstrates the use of styles in WPF.
  • A learning tool for developing your own WPF applications.
  • A Window for displaying Reports
  • A Window for displaying XPS documents
  • To download the HMI Dashboard Project go to Download Source Code Examples.
  • Once you have unzipped it you can open it with Visual Studio or Expression Blend.