2014-01-21 68 views
1

我有一個列表框,當用戶點擊Button, 時應該提交,有時候加載的數據很快,有時需要一些時間...有沒有簡單的方法來加載一些動畫像一個時鐘,或者可以讓用戶指示該進程正在運行的東西?ListBox加載動畫

我用MVVM與按鈕命令

<ListBox Width="30" 
      Visibility="{Binding IsDataLoaded, 
      Converter= {StaticResource BooleanToVisibilityConverter}}" 
      ItemsSource="{Binding Collection}" 
      FontSize ="15" 
      ScrollViewer.HorizontalScrollBarVisibility="Disabled" > 

       <ListBox.ItemContainerStyle> 
        <Style TargetType="ListBoxItem"> 
         <Setter Property="IsEnabled" Value="False"/> 
         <Style.Triggers> 
          <Trigger Property="IsEnabled" Value="False"> 
           <Setter Property="Foreground" Value="DarkGray" /> 
          </Trigger> 
         </Style.Triggers> 
        </Style> 
       </ListBox.ItemContainerStyle> 
      </ListBox> 



      <Button Content="Go" Command="{Binding GoCommand}" IsEnabled="{Binding IsGoEnabled}" IsDefault="True" Width="60" 
         /> 

回答

1

聽起來你正在尋找一個BusyIndicator喜歡在擴展工具包。

+0

是的,我尋找類似的東西,這是第三方工具? –

+0

這是擴展的WPF工具包,大量使用和依賴。如果你不熟悉它,你一定會發現其他方便的東西。絕對值得關注的是,在許多情況下,使生活更輕鬆,項目更強大。 –

+0

感謝克里斯,投了票,請你提供例子,我如何將它綁定到列表框?因爲我不知道如何使用它在此先感謝 –