1
我有名爲MyUserControl的UserControl和名爲MyContainer的另一個UserControl。 如果MyUserControl放置在MyContainer中,則需要填充10,否則爲15。 不久,我想WPF:根據容器更改填充?
<MyContainer>
<MyUserControl>
Hello
</MyUserControl>
</MyContainer>
看起來像
<MyContainer>
<UserControl Padding="10">
Hello
</UserControl>
<MyContainer>
和
<MyUserControl>
Hello
</MyUserControl>
看起來像
<UserControl Padding="15">
Hello
</UserControl>