0
我有一組2個單選按鈕,我需要知道用戶何時單擊其中一個按鈕。 默認情況下(創建頁面時)必須選擇這兩個單選按鈕之一。單選按鈕:用戶單擊和編程選擇的區別
爲什麼從代碼中選擇單選按鈕時會調用檢查回調?我如何區分它們?它使我困擾,因爲當用戶執行操作時,我必須執行一個Web請求,但是當我在初始化時從代碼中選擇它時,它不能執行任何請求。
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
Search(ContractTextBox.Text, true);
}
<ItemsControl ItemsSource="{Binding SelectedMainSearchItem.SubLevels}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="10">
<RadioButton Content="{Binding Name}"
GroupName="ExclusiveGroupL3"
IsChecked="{Binding IsSelected, Mode=TwoWay}"
Checked="RadioButton_Checked"
FontSize="18"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate