2013-03-13 2 views
0

디자이너에서 내가 가지고있는 활동에 대해 ExpressionTextBox 컨트롤을 사용하여 약간의 문제가 있습니다. XAML에서 ExpressionType 속성을 으로 설정하는 방법 을 정의하는 개체 IEnumerable`1 generic? 나는 그것을 전혀 설정하지 않고 떠날 수 있지만, 이상적으로는 디자인 타임에 이것으로 제어 할 수있는 검증 지원을 받고 싶습니다. 제대로 XAML에서 ExpressionType의 속성을 설정하는 방법에ExpressionTextBox의 ExpressionType을 제네릭 형식으로 설정하십시오.

<View:ExpressionTextBox 
    VerticalContentAlignment="Center" 
    Expression="{Binding Path=ModelItem.SelectedDestinations, Converter={StaticResource ResourceKey=ArgumentToExpressionConverter}, ConverterParameter=Out}" 
    ExpressionType="{x:Type TypeName=Generic:IEnumerable[Communication:CommunicationDeliveryDestination]}" 
    OwnerActivity="{Binding Path=ModelItem}" /> 

어떤 아이디어 :

나는 작동하지 않습니다 다음을 시도했습니다? 아래는 내 활동을위한 디자이너의 전체 XAML입니다.

<sap:ActivityDesigner x:Class="UrbanScience.ELS.Orchestration.Activities.Design.SelectDestinationsByLeadDestinationTypeDesigner" 
    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:View="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation" 
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation" 
    xmlns:Generic="clr-namespace:System.Collections.Generic;assembly=mscorlib" 
         xmlns:System="clr-namespace:System;assembly=mscorlib"> 

    <sap:ActivityDesigner.Resources> 
     <ResourceDictionary> 
      <sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" /> 
     </ResourceDictionary> 
    </sap:ActivityDesigner.Resources> 

    <Grid Height="50"> 
     <Grid.RowDefinitions> 
      <RowDefinition /> 
      <RowDefinition /> 
     </Grid.RowDefinitions> 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition MinWidth="200" /> 
      <ColumnDefinition MinWidth="200" /> 
     </Grid.ColumnDefinitions> 

     <TextBlock Text="Lead Destination Type:" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" /> 
     <ComboBox Name="LeadDestinationTypeItems" VerticalAlignment="Center" SelectedIndex="0" Grid.Row="0" Grid.Column="1" SelectionChanged="OnLeadDestinationTypeChanged" /> 

     <TextBlock Text="Assign selected destinations to:" VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" /> 
     <View:ExpressionTextBox VerticalContentAlignment="Center" 
           Expression="{Binding Path=ModelItem.SelectedDestinations, Converter={StaticResource ResourceKey=ArgumentToExpressionConverter}, ConverterParameter=Out}" 
           ExpressionType="{x:Type TypeName=Generic:IEnumerable[Communication:CommunicationDeliveryDestination]}" 
           OwnerActivity="{Binding Path=ModelItem}" Grid.Row="1" Grid.Column="1"> 
     </View:ExpressionTextBox> 
    </Grid> 
</sap:ActivityDesigner> 

답변

0

사용 ModelItem 속성 유형을 얻을 같이, 그것에 바인딩 : 나에게

ExpressionType={Binding ModelItem.Properties[SelectedDestinations].PropertyType.GenericTypeArguments[0]} 
+1

이 _SelectedDestinations_ 여기에 무엇을 의미하는지 분명하지 않다. 실세계 예제를 추가 할 수 있습니까? 예 : public InArgument의 경우 ActualValue {get; 세트; }', XAML의 실제 바인딩은'ExpressionType = "{Binding ModelItem.Properties [ActualValue] .PropertyType.GenericTypeArguments [0]}" "와 유사합니까? 감사. – Achim

관련 문제