2016-10-18 4 views
1

나는 ListView에 일부 데이터를 렌더링하기 위해 다음과 같은 XAML 코드를 사용하고 있습니다 :RelativeLayout 제약 조건을 바인딩 할 수 있습니까?

<ListView x:Name="myListView" 
      ItemsSource="{Binding myData}" 
      RowHeight="230"> 
    <ListView.ItemTemplate> 
     <DataTemplate> 
     <ViewCell> 
      <ViewCell.View> 
      <RelativeLayout Padding="1"> 
       <StackLayout x:Name="stackLayoutTitle" 
          Padding="5" 
          Orientation="Vertical" 
          VerticalOptions="EndAndExpand" 
          RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}" 
          RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"> 
       <Label Text="{Binding myText}" 
         FontSize="Medium" 
         FontAttributes="Bold" 
         TextColor="Black"> 
       </Label> 
       </StackLayout> 
      </RelativeLayout> 
      </ViewCell.View> 
     </ViewCell> 
     </DataTemplate> 
    </ListView.ItemTemplate> 
    </ListView> 

을 데이터 확인을 렌더링합니다. 이제, RelativeYConstranit의 Factor 속성에 밴딩을 사용하여 몇 가지 계산을 기반으로 각 StackLayout을 배치합니다. 이 같은 뭔가 (인자 속성을 참조하십시오) : 앱을 실행할 때

RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor={Binding someValue}}" 

, 나는 오류를 얻고있다.

누구에게도 바인딩 식을 사용할 수 있는지 알고 있습니까?

감사합니다.

답변

0

이 문제가 있습니다. "Factor"는 BindingProperty가 아닙니다. 그러므로 지금은 불가능합니다.