MahApps/MahApps.Metro — Issue #27: Style incompatibility with Windows Workflow Foundation 4 designer
Author: geoffbennett
Created: 2012-02-27 08:24:14+00:00
State: open

Applying the style in the Controls.xaml style causes the "Browse for Types" option in the type drop-down combo boxes to stop working. None of the other styles have any impact. To reproduce (in VS2010), create a new WPF application. In the code-behind for the Window1.xaml, import the following namespaces:

using System.Activities;
using System.Activities.Presentation;
using System.Activities.Core.Presentation;

Then declare two class members:

private DesignerMetadata _designerMetadata;
private WorkflowDesigner _designer;

Lastly, add the following lines to the constructor:

_designerMetadata = new DesignerMetadata();
_designerMetadata.Register();
_designer = new WorkflowDesigner();
DesignerGrid.Children.Add(_designer.View);
_designer.Load(new ActivityBuilder {Name = "Test Workflow"});

Where DesignerGrid is the name of the grid layout control at the root of the window.

Apply the resources as mentioned in the MahApps.Metro guide page, and change the Window to a MetroWindow.

Run the application, and in the workflow designer, at the bottom of the window, choose "Arguments". Click on the text to "Create a new argument" and an argument with some default settings will be added. Drop down the type combo box, and click on the "Browse for Types..." option. Nothing will happen.

Go back to the resources added to the window and comment out the Controls.xaml resource. Rerun the application and repeat the steps above. The type browser will now load.