2017-10-06 76 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; 
} 
相关问题