I want to creat radio button group like expected output(I added in link). I added a photo in below. please help me to fix my error
<Page.Resources>
<Style x:Key="GroupToggleStyle" TargetType="RadioButton" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Foreground" Value="Blue"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}"
Value="True">
<DataTrigger.Setters>
<Setter Property="Foreground" Value="Red"/>
</DataTrigger.Setters>
</DataTrigger>
</Style.Triggers>
</Style>
</Page.Resources>
<RadioButton GroupName="LanguageGroup" Command="{Binding LanguageChangeCommand}"
CommandParameter="English" Content="English" Width="80"
Style="{StaticResource GroupToggleStyle}" Margin="8,15,162,21" FontSize="30" Grid.Column="3" Grid.Row="3" BorderBrush="#FF860707"/>
<RadioButton GroupName="LanguageGroup" Command="{Binding LanguageChangeCommand}"
CommandParameter="Sinhala" Content="Sinhala" Width="80"
Style="{StaticResource GroupToggleStyle}" Margin="78,19,77,21" FontSize="30" Grid.Column="3" Grid.Row="3"/>
<RadioButton GroupName="LanguageGroup" Command="{Binding LanguageChangeCommand}"
CommandParameter="Tamil" Content="தமிழ்" Width="80"
Style="{StaticResource GroupToggleStyle}" Margin="165,10,10,21" FontSize="30" Grid.Column="3" Grid.Row="3"/>[enter image description here][1]
When designing with WPF you should always use layout containers to arrange your controls unlike the WindowsForms way where you just used to drag and drop controls on the screen. Its a little more complicated in the beginning but really pays off after a short while because your windows become dynamic.
Width is now defined in the layout container so if you need to change it later you only need to change it on the parent.
<StackPanel Width="80">
<RadioButton GroupName="LanguageGroup" Command="{Binding LanguageChangeCommand}" CommandParameter="English" Content="English" Style="{StaticResource GroupToggleStyle}" FontSize="30" Grid.Column="3" Grid.Row="3" BorderBrush="#FF860707"/>
<RadioButton GroupName="LanguageGroup" Command="{Binding LanguageChangeCommand}" CommandParameter="Sinhala" Content="Sinhala" Width="80" Style="{StaticResource GroupToggleStyle}" FontSize="30" Grid.Column="3" Grid.Row="3"/>
<RadioButton GroupName="LanguageGroup" Command="{Binding LanguageChangeCommand}" CommandParameter="Tamil" Content="தமிழ்" Width="80" Style="{StaticResource GroupToggleStyle}" FontSize="30" Grid.Column="3" Grid.Row="3"/>
</StackPanel>
You can now position the stackpanel once and all the buttons will follow