Custom activity in WF 4.0: WorkflowItemsPresenter wont show converted array

Posted by lotusnote on Stack Overflow See other posts from Stack Overflow or by lotusnote
Published on 2010-02-23T11:29:04Z Indexed on 2010/06/10 13:12 UTC
Read the original article Hit count: 680

Hi There,

we have an Array which is converted via a Binded Converter:

else if (TTools.IsOfBaseClass(value.GetType(), typeof(System.Activities.Presentation.Model.ModelItemCollection)))
        {

              OurBaseClass[] test = (value as ModelItemCollection).GetCurrentValue() as OurBaseClass[];
              List<OurBaseClass> listOfArray = new List<OurBaseClass>();
              foreach (OurBaseClass item in test)
                {
                     listOfArray.Add(item);
                }
                return listOfArray;

        }

the convertion works well but it is not shown in our dynamically gui

gui code with bindings:

<sap:WorkflowItemsPresenter xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"  Grid.Column="0" Name="MyArray" Items="{Binding Path=ModelItem.MyArray}"  MinWidth="150" Margin="0">
                <sap:WorkflowItemsPresenter.SpacerTemplate >
                    <DataTemplate>
                        <TextBlock  Foreground="DarkGray" Margin="30">..</TextBlock>
                    </DataTemplate>
                </sap:WorkflowItemsPresenter.SpacerTemplate>
                <sap:WorkflowItemsPresenter.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="0"/>
                    </ItemsPanelTemplate>
                </sap:WorkflowItemsPresenter.ItemsPanel>
            </sap:WorkflowItemsPresenter>

Why is the gui not shown as a List??? it works well without converter. Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf-binding