如何在<style>
body {
background: rgba(13, 190, 81, .5);
}
.customcol:hover {
background: rgba(13, 190, 81, .8);
}
.customcol {
width: 33.33%;
float: left;
text-align: center;
box-sizing: border-box;
color: white;
height: 86vh;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
background: transparent;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.fa-6x {
font-size: 6em;
}
.fa-7x {
font-size: 7em;
}
</style>
<div class="col customcol">
<i class="fa fa-credit-card fa-5x " aria-hidden="true"></i>
<div>
<h3>Kartlar</h3>
</div>
</div>
中停用按钮?
我有一个名为wpf
的列,它应该包含值availability
或available
,
如果值为unavailable
,我想禁用该按钮:
unavailable
答案 0 :(得分:0)
您可以尝试使用DataTemplate触发器并在其中设置所需的属性。例如,如果Availability是DataTemplateColumn的DataContext中的属性,它将看起来像这样:
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="deployBtn" Click="deployBtn_Click" Height="25" Width="45" Background="#FF43B46C" Margin="0 -3 0 0">
//...your code
</Button>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding DataContext.Availability RelativeSource={RelativeSource AncestorType=DataTemplateColumn}}" Value="Unavailable">
<Setter Property="IsEnabled" TargetName="deployBtn" Value="False"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>