2016-09-22 4 views
0

라디오 버튼 컨트롤과 라디오 버튼이 선택되어있는 기반으로 사용할 수있는 일부 종속 컨트롤이 있습니다.부모의 속성을 기반으로 중첩 된 LayoutGroup에 대해 IsEnabled를 설정합니다.

이렇게하려면 LayoutGroupIsEnabled{Binding IsSelected, ElementName=radioButtonControlName}으로 바인딩하려고합니다. 그래도 작동하지 않습니다. 나는 ListBoxEdit 제어의 LayoutGroup의 외부를 이동하는 경우

내 XAML은 예상대로 작동, 덧붙여이

<Grid> 
    <dxlc:LayoutGroup Orientation="Horizontal"> 
     <dxe:ListBoxEdit ShowBorder="False" StyleSettings="{dxe:RadioListBoxEditStyleSettings}" HorizontalContentAlignment="Stretch"> 
      <dxe:ListBoxEditItem Name="radioButtonA" IsSelected="{Binding IsASelected, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"> 
       <dxlc:LayoutGroup> 
        <dxlc:LayoutItem Label="A"> 
         <dxlc:LayoutGroup Name="aLayoutGroup" IsEnabled="{Binding IsSelected, ElementName=radioButtonA}"> 
          <dxlc:LayoutItem Label="Date A"> 
           <dxe:DateEdit EditValue="{Binding DateA, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/> 
          </dxlc:LayoutItem> 
          <dxlc:LayoutItem Label="Text A"> 
           <dxe:TextEdit EditValue="{Binding TextA, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/> 
          </dxlc:LayoutItem> 
         </dxlc:LayoutGroup> 
        </dxlc:LayoutItem> 
       </dxlc:LayoutGroup> 
      </dxe:ListBoxEditItem> 
      <dxe:ListBoxEditItem Name="radioButtonB" IsSelected="{Binding IsASelected, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"> 
       <dxlc:LayoutGroup> 
        <dxlc:LayoutItem Label="B"> 
         <dxlc:LayoutGroup Name="bLayoutGroup" IsEnabled="{Binding IsSelected, ElementName=radioButtonB}"> 
          <dxlc:LayoutItem Label="Date B"> 
           <dxe:DateEdit EditValue="{Binding DateB, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/> 
          </dxlc:LayoutItem> 
          <dxlc:LayoutItem Label="Text B"> 
           <dxe:TextEdit EditValue="{Binding TextB, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/> 
          </dxlc:LayoutItem> 
         </dxlc:LayoutGroup> 
        </dxlc:LayoutItem> 
       </dxlc:LayoutGroup> 
      </dxe:ListBoxEditItem> 
     </dxe:ListBoxEdit> 
    </dxlc:LayoutGroup> 
</Grid> 

것 같습니다. 그런 다음 문제는 라디오 버튼을 종속 컨트롤과 정렬하는 방법을 모르겠다는 것입니다. 누군가 내가 그 사람들을 적절하게 조정할 수 있다면 그 해결책도 효과가 있다고 생각합니다.

답변

0

라디오 버튼을 동적으로 생성하지 않기 때문에 ListBoxEdit을 사용하지 않고 대신 내 레이아웃에 RadioButton 요소를 넣기로했습니다. 나는 IsSelected 바인딩을 IsChecked으로 바꿀 필요가 있었지만 다른 점은 거의 같은 방식으로 작동합니다.

관련 문제