如何在扩展器标题中设置多重绑定和图像

发布于 2024-10-05 01:47:59 字数 646 浏览 0 评论 0原文

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

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

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

如何在其中设置图像?

提前致谢!

perhaps you can help me to solve this problem. I want to display a Text-Multibinding and an image in the header of my expander.

This is my simplified coding of the expander:

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

How can I set an image in there?

thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜爱纠缠 2024-10-12 01:47:59

试试这个:

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

Try this:

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文