应用主题时 Silverlight 边框对象不可见?

发布于 2024-07-20 07:08:46 字数 570 浏览 1 评论 0原文

我已将 Silverlight Toolkit 主题之一应用到我的 XAML 页面,但现在由于某种原因我的 Border 对象没有显示。 这是设计使然吗? 我已确保明确指定与主题背景形成对比的 BorderBrush 颜色,但这并不能解决问题。

如果有帮助的话,我使用的主题是 Silverlight Toolkit 中的 BureauBlack 主题。 这是我的一个边框的代码片段。

 <Border VerticalAlignment="Top" Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" BorderBrush="Orange"  CornerRadius="10" Margin="0" Height="300">
        <StackPanel>
            <TextBlock Text="Status Panel" FontSize="20" TextAlignment="Center" />
            ...
        </StackPanel>
 </Border>

I have a applied one of the Silverlight Toolkit themes to my XAML page, and now for some reason my Border objects don't show up. Is this by design? I've made sure to explicitly state a BorderBrush color that should contrast the theme background, but this does not fix the issue.

In case it helps, the theme I'm using is the BureauBlack theme from the Silverlight Toolkit.
And here is a code snippet of one of my Borders.

 <Border VerticalAlignment="Top" Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" BorderBrush="Orange"  CornerRadius="10" Margin="0" Height="300">
        <StackPanel>
            <TextBlock Text="Status Panel" FontSize="20" TextAlignment="Center" />
            ...
        </StackPanel>
 </Border>

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

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

发布评论

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

评论(2

差↓一点笑了 2024-07-27 07:08:46

看起来,当加载主题时,它会为大多数对象属性加载自己的默认值集。 在本例中,边框对象的 BorderThickness 属性默认为 0。因此您看不到它。

通过显式地为 BorderThickness 属性指定一个值(当然非零),我的边框就显示出来了。

It looks like when a theme is loaded it loads its own default set of values for most object properties. In this case, the BorderThickness property of the border object defaults to 0. As a result you don't see it.

By explicitly giving the BorderThickness property a value (non-zero ofcourse), I got my border to show up.

ぃ弥猫深巷。 2024-07-27 07:08:46

另外,我可以推荐 Silverlight Spy 工具。
Silverlight Spy 的功能之一是提供所有控件的树,显示它们的所有属性并提供动态更改它们的能力。 它大大减少了解决此类问题的时间。
我在像你这样的情况下使用过几次。

In addition, I can recommend Silverlight Spy tool.
One of the feature of Silverlight Spy is to provide a tree of all controls, to display all their properties and to provide an ability to dynamically change them. It greatly decrease time for such problem resolving.
I've used it several times in cases like your.

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