wpf busyindicator 未显示
我的窗口上有一个像这样的 wpf 繁忙指示器:
<Grid><Controls1:BusyIndicator x:Name="busyIndicator2" IsBusy="False" Content="Please wait....." Visibility="Hidden"/>
</Grid>
在按钮中单击我试图将指示器的可见性、isBusy 属性设置为 true 和可见。
void button_click(object sender, RoutedEventArgs e)
{
busyIndicator2.Visibility = System.Windows.Visibility.Visible;
busyIndicator2.IsBusy = true;
}
但指标没有出现。
知道为什么吗?
I have a wpf busy indicator like this on my window:
<Grid><Controls1:BusyIndicator x:Name="busyIndicator2" IsBusy="False" Content="Please wait....." Visibility="Hidden"/>
</Grid>
And in the button click I m trying to set the visiblity,isBusy property of indicator to true and visible.
void button_click(object sender, RoutedEventArgs e)
{
busyIndicator2.Visibility = System.Windows.Visibility.Visible;
busyIndicator2.IsBusy = true;
}
but the indicaotr is not showing up.
Any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
BusyIndicator 在哪里定义的?例如,如果您的 XAML 如下所示:
您将永远不会看到
BusyIndicator
,因为它位于 ListBox 后面。我建议按照 Chris 的建议使用BusyIndicator
,否则,请确保它不会无意中位于其他视觉效果后面。Where is the BusyIndicator defined? For example, if your XAML looks like:
You'll never see the
BusyIndicator
because it's behind the ListBox. I would recommend using theBusyIndicator
as suggested by Chris, otherwise, make sure it's not inadvertently behind other visuals.我总是用 BusyIndicator 包装其他 wpf 内容,然后它会以该内容为中心显示。
尝试将布局控件包装在 BusyIndicator 中,看看是否符合您的要求。
I've always wrapped other wpf content with the BusyIndicator, it then shows up centered over that content.
Try wrapping your layout control in the BusyIndicator and see if that does what you are after.