带有复选框windows 10 app的图像按钮

时间:2015-10-01 04:24:32

标签: windows xaml platform universal

是否可以定义自定义按钮样式。此按钮包含一个复选框。每当单击按钮时,都会选中/取消选中该复选框。

有可能,怎么样? 是否可以处理检查状态。当按钮点击?

还可以从按钮集合中选择已选中的按钮详细信息吗?

1 个答案:

答案 0 :(得分:0)

在XAML中试试这个

<Button Width="200" Height="30">
        <Button.ContentTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <CheckBox IsChecked="{Binding IsCheckedButton}" />
                    <TextBlock Text=" Your Content here" />
                </StackPanel>
            </DataTemplate>
        </Button.ContentTemplate>
    </Button>
相关问题