Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 老子弹还在_.net_Wpf_Xaml_Wpf Controls_Expander - Fatal编程技术网

.net 老子弹还在

.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" >

我以wpf中的扩展器为例。工作正常,但旧子弹仍然显示贝西的新子弹。代码如下:

<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的边距,它将覆盖旧子弹。我知道这不是正确的方法,但对我来说很有效