0
UWP我想設置一個按鈕樣式命令,但我的命令不火:(XAML命令裏面一個樣式
任何明顯浮現在腦海?
<Style x:Key="TimeBtnStyle" BasedOn="{StaticResource ClickBtnStyle}" TargetType="Button">
<Setter Property="Command" Value="{Binding Path=vm.CommandTester}"/>
<Setter Property="CommandParameter" Value="{Binding Content}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid" Background="Transparent">
<Border CornerRadius="12" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="4">
<ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" ContentTransitions="{TemplateBinding ContentTransitions}">
</ContentPresenter>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
綁定不二傳手支持。即使這樣做,不這樣做。 –
@JustinXL那麼,如何調用命令從風格? – Maf
我別建議這樣做。爲什麼你需要一種風格的命令呢? –