2017-10-06 38 views
0

我對C#並不陌生,但我對XAML/MVVM是新手。如何增加單選按鈕的大小

我正在開發一個觸摸屏應用程序。它有許多單選按鈕,但我需要它們更大,以便當有人觸摸它們時,它們會被檢查。

我不介意單選按鈕周圍的區域是否設置了檢查,或者單選按鈕的實際大小是否增加。

這是我的單選按鈕代碼。大約有20個,所以最少量的代碼可能是最好的。

<RadioButton HorizontalAlignment="Center" VerticalAlignment="Center" GroupName="History" Grid.Column="2" Grid.Row="3" Command="{Binding HealthQuestionsTrue}" CommandParameter="MedicalHistory"></RadioButton> 
<RadioButton HorizontalAlignment="Center" VerticalAlignment="Center" GroupName="History" Grid.Column="3" Grid.Row="3" Command="{Binding HealthQuestionsFalse}" CommandParameter="MedicalHistory"></RadioButton> 
+0

使用它在視框中 – Tcraft

+0

@Lithium我沒有發現問題,但它的工作 – Calvin

回答

0

分配一個ID,並在CSS調整大小,或者將他們全部以同樣的方式被改變分配的CssClass和CSS同樣改變。

例如

<RadioButton ID="Button1 "HorizontalAlignment="Center" VerticalAlignment="Center" GroupName="History" Grid.Column="2" Grid.Row="3" Command="{Binding HealthQuestionsTrue}" CommandParameter="MedicalHistory"></RadioButton> 

<RadioButton CSSClass="buttons" "HorizontalAlignment="Center" VerticalAlignment="Center" GroupName="History" Grid.Column="2" Grid.Row="3" Command="{Binding HealthQuestionsTrue}" CommandParameter="MedicalHistory"></RadioButton> 

和CSS將

#Button1{ 
    width:50px; 
} 

OR

.buttons{ 
    width:50px; 
} 
相關問題