From d1d5b33431fda1c40f24f77558f3e1d1615d845b Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Mon, 11 Dec 2023 15:38:19 -0300 Subject: [PATCH] Update Progress --- .../Controls/ProgressBarStackPanel.xaml | 26 ++++++++++++------- ricaun.Revit.UI.StatusBar/Revit/App.cs | 3 ++- .../Revit/Views/ThemeView.xaml | 1 - .../Revit/Views/ThemeView.xaml.cs | 9 +++++++ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ricaun.Revit.UI.StatusBar/Controls/ProgressBarStackPanel.xaml b/ricaun.Revit.UI.StatusBar/Controls/ProgressBarStackPanel.xaml index 1770130..46b749d 100644 --- a/ricaun.Revit.UI.StatusBar/Controls/ProgressBarStackPanel.xaml +++ b/ricaun.Revit.UI.StatusBar/Controls/ProgressBarStackPanel.xaml @@ -35,10 +35,14 @@ IsIndeterminate="{Binding IsIndeterminate}" VerticalAlignment="Center" /> - - + + + + + - - - - + + + + + diff --git a/ricaun.Revit.UI.StatusBar/Revit/App.cs b/ricaun.Revit.UI.StatusBar/Revit/App.cs index f9e51d5..75bac5e 100644 --- a/ricaun.Revit.UI.StatusBar/Revit/App.cs +++ b/ricaun.Revit.UI.StatusBar/Revit/App.cs @@ -18,7 +18,8 @@ public Result OnStartup(UIControlledApplication application) ribbonPanel.CreatePushButton("Theme"), ribbonPanel.CreatePushButton("Delay"), ribbonPanel.CreatePushButton("Elements"), - ribbonPanel.CreatePushButton("Multiple") + ribbonPanel.CreatePushButton("Multiple"), + ribbonPanel.CreatePushButton("View") ); return Result.Succeeded; diff --git a/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml b/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml index c8e81c8..43b9c17 100644 --- a/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml +++ b/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml @@ -10,5 +10,4 @@ - diff --git a/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml.cs b/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml.cs index 3b0d07a..3adf4bf 100644 --- a/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml.cs +++ b/ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml.cs @@ -1,6 +1,7 @@ using ricaun.Revit.UI.StatusBar.Controls; using ricaun.Revit.UI.StatusBar.Controls.Themes; using System; +using System.Linq; using System.Threading.Tasks; using System.Windows; @@ -27,6 +28,13 @@ public ThemeView() { this.Close(); } + if (e.Key == System.Windows.Input.Key.R) + { + foreach (var progressBar in Root.Children.OfType()) + { + Run(progressBar); + } + } }; } @@ -44,6 +52,7 @@ private void Run(ProgressBarStackPanel progressBar) { Task.Run(async () => { + progressBar.Data.CurrentValue = 0; await Task.Delay(1000); progressBar.Data.CurrentValue = 0; for (int i = (int)progressBar.Data.MinimumValue; i <= (int)progressBar.Data.MaximumValue; i++)