locked
Getting rid of the Header on the ActivityDesigner RRS feed

  • Question

  • I'm trying to get rid of the header area that contains the icon and the activity name. I changed from ActivityDesigner to WorkflowViewElement, which successfully gets rid of the header area, but now the activity can no longer be selected,dragged or moved within the workflow after it is initially dropped in. Did I miss something? Thanks
    <sap:WorkflowViewElement x:Class="FSNSEligibilityActivityDesignerLibrary.AndOrActivityDesigner"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
      xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignWidth="89" d:DesignHeight="80" MinWidth="0" MinHeight="0" BorderThickness="5" Collapsible="False" Name="AndOr" ForceCursor="True" AllowDrop="True">  
        
      <Grid Width="Auto" Height="Auto" VerticalAlignment="Center">
        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
          <RadioButton Content="And" Height="16" HorizontalAlignment="Left" Name="AndRadioButton" VerticalAlignment="Center" Click="AndRadioButton_Click" />
          <RadioButton Content="Or" Height="16" HorizontalAlignment="Left" Name="OrRadioButton" VerticalAlignment="Center" Click="OrRadioButton_Click" />
        </StackPanel>
      </Grid>
    </sap:WorkflowViewElement>
    
    Saturday, May 29, 2010 7:22 PM

Answers

  • You need something on the screen that can be dragged. For example, place a TextBlock on the screen. For selection, you will need to implement your own highlighting logic. Here is an example.

     <Border BorderThickness="2">
            <Border.Style>
                <Style TargetType="{x:Type Border}">
                    <Setter Property="BorderBrush" Value="LightGray"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ModelItem.IsSelection}" Value="True">
                            <Setter Property="BorderBrush" Value="Orange"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>

            <Grid Width="Auto" Height="Auto" VerticalAlignment="Center">
                <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                    <RadioButton Content="And" Height="16" HorizontalAlignment="Left" Name="AndRadioButton" VerticalAlignment="Center" Click="AndRadioButton_Click" />
                    <RadioButton Content="Or" Height="16" HorizontalAlignment="Left" Name="OrRadioButton" VerticalAlignment="Center" Click="OrRadioButton_Click" />
                    <TextBlock>Drag Me</TextBlock>
                </StackPanel>
            </Grid>
        </Border>

    Sunday, May 30, 2010 4:18 AM
  • I think the issue is that WorkflowViewElement has a null background brush, which makes it not receive clicks/drag+drops. Try adding a non-null background brush. I think even a transparent one works, but as a non-transparent example, you can change your first <Grid> tag to:

    <Grid Width="Auto" Height="Auto" VerticalAlignment="Center" Background="AliceBlue">

    Tuesday, June 1, 2010 8:02 PM

All replies

  • You need something on the screen that can be dragged. For example, place a TextBlock on the screen. For selection, you will need to implement your own highlighting logic. Here is an example.

     <Border BorderThickness="2">
            <Border.Style>
                <Style TargetType="{x:Type Border}">
                    <Setter Property="BorderBrush" Value="LightGray"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ModelItem.IsSelection}" Value="True">
                            <Setter Property="BorderBrush" Value="Orange"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>

            <Grid Width="Auto" Height="Auto" VerticalAlignment="Center">
                <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                    <RadioButton Content="And" Height="16" HorizontalAlignment="Left" Name="AndRadioButton" VerticalAlignment="Center" Click="AndRadioButton_Click" />
                    <RadioButton Content="Or" Height="16" HorizontalAlignment="Left" Name="OrRadioButton" VerticalAlignment="Center" Click="OrRadioButton_Click" />
                    <TextBlock>Drag Me</TextBlock>
                </StackPanel>
            </Grid>
        </Border>

    Sunday, May 30, 2010 4:18 AM
  • I think the issue is that WorkflowViewElement has a null background brush, which makes it not receive clicks/drag+drops. Try adding a non-null background brush. I think even a transparent one works, but as a non-transparent example, you can change your first <Grid> tag to:

    <Grid Width="Auto" Height="Auto" VerticalAlignment="Center" Background="AliceBlue">

    Tuesday, June 1, 2010 8:02 PM
  • Thanks for the highlighting logic, you're a champ!
    Wednesday, June 2, 2010 2:04 AM