2

也许你可以帮我解决这个问题。我想在扩展器的标题中显示文本多重绑定和图像。

这是我对扩展器的简化编码:

       <Expander
        x:Name="_myExpander">
        <Expander.Header>
            <MultiBinding
                Converter="{StaticResource ExpanderHeaderConverter}">
                <Binding
                    Path="Property1" />
                <Binding
                    Path="Property2" />
                <Binding
                    Path="Property3" />
            </MultiBinding>
        </Expander.Header>

        <local:Content/>

    </Expander>

如何在其中设置图像?

提前致谢!

4

1 回答 1

8

试试这个:

<Expander.Header>
    <StackPanel Orientation="Horizontal">
        <Image Source="{Binding ...}"/>
        <TextBlock>
            <TextBlock.Text>
                <MultiBinding Converter="{StaticResource ExpanderHeaderConverter}">
                    <Binding Path="Property1" />
                    <Binding Path="Property2" />
                    <Binding Path="Property3" />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
    </StackPanel>
</Expander.Header>
于 2010-12-01T16:19:38.110 回答