title: Determining checked Radiobutton from groupbox in WPF following MVVM
body: <p>I have a groupbox with some radiobuttons. How do I get to know which one which is checked? I am using WPF and following MVVM.</p>
  
  <pre><code>&lt;GroupBox Name="grpbx_pagerange" Header="Print Range"&gt;
      &lt;Grid &gt;
          &lt;RadioButton Name="radbtn_all" Content="All Pages" GroupName="radios_page_range" IsChecked="True"  /&gt;
          &lt;RadioButton x:Name="radbtn_curr" Content="Current Page" GroupName="radios_page_range"  /&gt;
          &lt;RadioButton Name="radbtn_pages" Content="Page Range" GroupName="radios_page_range" /&gt;
  
          ....
  
  &lt;/GroupBox&gt;
  </code></pre>
  
  <p>Now, one way I could figure out was to bind each RadioButton's <code>IsChecked</code> Property to some property in ViewModel and then do if..else sort of logic in my ViewModel to figure out the selected radiobutton.</p>
  
  <p>But Is there any other elegant way?</p>