我在我的应用程序中使用性能进度条。我正在做的是在开始一些冗长的操作之前使进度条可见性变为Visible,并在操作完成时将其折叠。但是在开始该操作之前它是不可见的。 这是我的代码
ucSearch.prograssBarCanvas.Visibility = System.Windows.Visibility.Visible;
var obj = wb1.InvokeScript("SearchText", ucSearch.txtSearch.Text.Trim());
var result = JsonConvert.DeserializeObject<List<BookChapter>>(obj.ToString());
if (result.Count == 0)
{
ucSearch.txtBlMessage.Visibility = System.Windows.Visibility.Visible;
ucSearch.lstBxResults.Visibility = System.Windows.Visibility.Collapsed;
}
else
{
ucSearch.txtBlMessage.Visibility = System.Windows.Visibility.Collapsed;
ucSearch.lstBxResults.Visibility = System.Windows.Visibility.Visible;
}
ucSearch.lstBxResults.DataContext = null;
ucSearch.lstBxResults.DataContext = result;
ucSearch.prograssBarCanvas.Visibility = System.Windows.Visibility.Collapsed;
我想问为什么它不可见?
答案 0 :(得分:2)
确保进度条的IsEnabled
和IsIndeterminate
属性为true
。
答案 1 :(得分:0)