WorkflowView.ShadowDepth Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the ShadowDepth for the WorkflowView.

Namespace:   System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

Public Property ShadowDepth As Integer

Property Value

Type: System.Int32

The shadow depth in pixels.

Use the ShadowDepth to get or adjust the shadow depth of text shown on the workflow design surface.

The following code example demonstrates how you can obtain an instance of the WorkflowView class using the GetView method. The code then sets several WorkflowView properties, including HScrollBar and VScrollBar, ShadowDepth, and calls the FitToScreenSize method.

Dim designerHost As IDesignerHost = CType(designSurface.GetService(GetType(IDesignerHost)), IDesignerHost)
If designerHost IsNot Nothing And designerHost.RootComponent IsNot Nothing Then

    Dim rootDesigner As IRootDesigner = CType(designerHost.GetDesigner(designerHost.RootComponent), IRootDesigner)
    If rootDesigner IsNot Nothing Then

        Me.designSurface = designSurface
        Me.loader = loader
        Me.workflowView = CType(rootDesigner.GetView(ViewTechnology.Default), WorkflowView)
        Me.workflowView.Dock = DockStyle.Fill
        Me.workflowView.TabIndex = 1
        Me.workflowView.TabStop = True
        Me.workflowView.HScrollBar.TabStop = False
        Me.workflowView.VScrollBar.TabStop = False
        Me.workflowView.ShadowDepth = 0
        Me.workflowView.EnableFitToScreen = True

        Dim selectionService As ISelectionService = CType(GetService(GetType(ISelectionService)), ISelectionService)
        Dim changeService As IComponentChangeService = CType(GetService(GetType(IComponentChangeService)), IComponentChangeService)

        If selectionService IsNot Nothing Then
            AddHandler selectionService.SelectionChanged, AddressOf OnSelectionChanged
        End If

        If changeService IsNot Nothing Then

            AddHandler changeService.ComponentAdded, AddressOf changeService_ComponentAdded
            AddHandler changeService.ComponentChanged, AddressOf changeService_ComponentChanged
            AddHandler changeService.ComponentRemoved, AddressOf changeService_ComponentRemoved
            AddHandler changeService.ComponentRename, AddressOf changeService_ComponentRename
        End If
    End If
End If

The UnloadWorkflow method that is called in the code above removes a currently loaded workflow in order to prepare for the loading of a new workflow and is implemented as follows:

Private Sub UnloadWorkflow()

    Dim designerHost As IDesignerHost = CType(GetService(GetType(IDesignerHost)), IDesignerHost)
    If designerHost IsNot Nothing And designerHost.Container.Components.Count > 0 Then
        WorkflowLoader.DestroyObjectGraphFromDesignerHost(designerHost, CType(designerHost.RootComponent, Activity))
    End If

    If Me.designSurface IsNot Nothing Then
        Me.designSurface = Nothing
    End If

    If Me.workflowView IsNot Nothing Then
        Me.workflowView = Nothing
    End If

End Sub

.NET Framework
Available since 3.0
Return to top