【发布时间】:2018-10-25 15:55:06
【问题描述】:
我在 XAML 中有这个
<ControlTemplate TargetType="{x:Type Button}">
<Image ...>
</ControlTemplate>
我想在 C# 代码中实现相同的目标。我怎样才能做到这一点?
ControlTemplate ct = new ControlTemplate();..
Image img = new Image();..
现在如何将此图像分配给控制模板?我们可以这样做还是我在这里遗漏了任何概念?
【问题讨论】:
标签: c# wpf xaml contentcontrol