wpf busyindicator 未显示

发布于 2024-11-18 01:31:45 字数 465 浏览 11 评论 0原文

我的窗口上有一个像这样的 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 技术交流群。

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

发布评论

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

评论(2

很快妥协 2024-11-25 01:31:46

BusyIndi​​cator 在哪里定义的?例如,如果您的 XAML 如下所示:

<Grid>
  <BusyIndicator ...>
  </BusyIndicator>

  <ListBox ...>
  </ListBox>
</Grid>

您将永远不会看到 BusyIndi​​cator,因为它位于 ListBox 后面。我建议按照 Chris 的建议使用 BusyIndi​​cator,否则,请确保它不会无意中位于其他视觉效果后面。

Where is the BusyIndicator defined? For example, if your XAML looks like:

<Grid>
  <BusyIndicator ...>
  </BusyIndicator>

  <ListBox ...>
  </ListBox>
</Grid>

You'll never see the BusyIndicator because it's behind the ListBox. I would recommend using the BusyIndicator as suggested by Chris, otherwise, make sure it's not inadvertently behind other visuals.

浅黛梨妆こ 2024-11-25 01:31:45

我总是用 BusyIndi​​cator 包装其他 wpf 内容,然后它会以该内容为中心显示。

<BusyIndicator...>
  <Grid>....</Grid>
</BusyIndicator>

尝试将布局控件包装在 BusyIndi​​cator 中,看看是否符合您的要求。

I've always wrapped other wpf content with the BusyIndicator, it then shows up centered over that content.

<BusyIndicator...>
  <Grid>....</Grid>
</BusyIndicator>

Try wrapping your layout control in the BusyIndicator and see if that does what you are after.

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