I'm using custom Activity and overriding OnMouseDoubleClick method. Everything works good but after double click on Activity is that self displayed in designer. It means that in designer is not shown whole workflow but only this Activity. How to disable self-opening Activity in custom designer. Here is my code in ActivityDesigner.xaml.cs
/// <summary>
/// Raises the <see cref="E:System.Windows.Controls.Control.MouseDoubleClick"/> routed event.
/// </summary>
/// <param name="e">The event data.</param>
protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
{
e.Handled = true;
this.OpenDialogOnDoubleClick();
}
To disable that behabiour you've to use ActivityDesignerOptionsAttribute, in particular its AllowDrillIn property.
Use it on your activity class:
[ActivityDesignerOptions(AllowDrillIn = false)]
public sealed class MyActivity : CodedActivity
{
/* ... */
}
Or if you're using IRegisterMetadata:
internal class Metadata : IRegisterMetadata
{
private AttributeTable attributes;
// Called by the designer to register any design-time metadata.
public void Register()
{
var builder = new AttributeTableBuilder();
builder.AddCustomAttributes(
typeof(MyActivity),
new ActivityDesignerOptionsAttribute{ AllowDrillIn = false });
MetadataStore.AddAttributeTable(builder.CreateTable());
}
}