.net 老子弹还在
我以wpf中的扩展器为例。工作正常,但旧子弹仍然显示贝西的新子弹。代码如下:.net 老子弹还在,.net,wpf,xaml,wpf-controls,expander,.net,Wpf,Xaml,Wpf Controls,Expander,我以wpf中的扩展器为例。工作正常,但旧子弹仍然显示贝西的新子弹。代码如下: <Expander Name="ExpanderControl" HorizontalAlignment="Left" Background="LavenderBlush" ExpandDirection="Down" IsExpanded="False" Width="250" FontSize="20" FontWeight="Bold" Foreground="Green" >
<Expander Name="ExpanderControl"
HorizontalAlignment="Left" Background="LavenderBlush"
ExpandDirection="Down" IsExpanded="False" Width="250"
FontSize="20" FontWeight="Bold" Foreground="Green" >
<Expander.Header>
<BulletDecorator>
<BulletDecorator.Bullet>
<Image Width="50" Source="Flowers.jpg"/>
</BulletDecorator.Bullet>
<TextBlock Margin="20,0,0,0">Flower Header</TextBlock>
</BulletDecorator>
</Expander.Header>
<TextBlock TextWrapping="Wrap" FontSize="14" FontWeight="Light" Foreground="Black">
This is an Expander control. Within this control, all contents will be wrapped.
At run-time, you may expand or collapse this control. Type more text here to be
Jump around and hype.
</TextBlock>
</Expander>
花穗
这是一个扩展器控制。在此控件中,所有内容都将被包装。
在运行时,您可以展开或折叠此控件。请在此处键入更多文本
跳来跳去,大肆宣传。
用于扩展器的控制模板
定义了一个切换按钮
,其内容是绑定到标题
属性的模板。此切换按钮
还有一个控制模板
,其定义方式是有两列:一列用于椭圆
(箭头表示为路径
),另一列用于ContentPresenter
(承载标题
内容)
若要更改此行为,您需要在扩展器上重新定义模板
属性我在其周围找到了一个工作区
<BulletDecorator.Bullet>
<Image Width="50" Source="Flowers.jpg" Margin="-20,0,0,0"/>
</BulletDecorator.Bullet>
根据你的需要留出-20的边距,它将覆盖旧子弹。我知道这不是正确的方法,但对我来说很有效