2011-11-25 9 views
0

Silverlightで新しくできました。 オブジェクトのリストを持つビューモデルに観測可能なコレクションがあります。どのようにラジオボタングループにバインドするのですか?Silverlight - Observableコレクションをラジオボタンリストでバインドする方法をご存知ですか?

私は以下を試しましたが、ラジオボタングループのようには動作しません。

<UserControl.Resources> 

     <DataTemplate x:Key="TableItemTemplate"> 

      <StackPanel Width="auto" Orientation="Horizontal" > 
       <RadioButton Margin="1,1,1,1" 
          > 
       </RadioButton > 
       <TextBlock Text="{Binding Caption}"></TextBlock> 
      </StackPanel> 
     </DataTemplate> 

    </UserControl.Resources> 

<ListBox Margin ="3,3,3,3" 
         ItemsSource="{Binding OptionLIst}" 
         ItemTemplate="{StaticResource TableItemTemplate}" 
         > 
      </ListBox> 

答えて

1

ラジオボタン

GroupName="myGroup" 
にGroupNameの属性を追加します。
関連する問題