Skip to content

Commit

Permalink
Update Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Dec 11, 2023
1 parent ca83767 commit d1d5b33
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
26 changes: 16 additions & 10 deletions ricaun.Revit.UI.StatusBar/Controls/ProgressBarStackPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,29 @@
IsIndeterminate="{Binding IsIndeterminate}"
VerticalAlignment="Center" />

<TextBlock Margin="4"
Text="{Binding DisplayValue, StringFormat={}{0:0}%}"
VerticalAlignment="Center">
</TextBlock>
<Grid Width="30"
Margin="4">
<TextBlock Text="{Binding DisplayValue, StringFormat={}{0:0}%}"
VerticalAlignment="Center"
HorizontalAlignment="Center">
</TextBlock>

</Grid>

<!--
<Rectangle VerticalAlignment="Stretch"
Width="1"
Margin="4"
Stroke="{DynamicResource Color.Static.Foreground}" />
-->

<TextBlock Margin="4"
Text="-"
VerticalAlignment="Center">
</TextBlock>


<Grid Width="16"
Margin="4">
<TextBlock Text="-"
VerticalAlignment="Center"
HorizontalAlignment="Center">
</TextBlock>
</Grid>
<TextBlock Margin="4"
Text="{Binding CurrentOperation}"
VerticalAlignment="Center">
Expand Down
3 changes: 2 additions & 1 deletion ricaun.Revit.UI.StatusBar/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public Result OnStartup(UIControlledApplication application)
ribbonPanel.CreatePushButton<Commands.CommandTheme>("Theme"),
ribbonPanel.CreatePushButton<Commands.CommandDelayIndeterminate>("Delay"),
ribbonPanel.CreatePushButton<Commands.CommandElements>("Elements"),
ribbonPanel.CreatePushButton<Commands.CommandMultiple>("Multiple")
ribbonPanel.CreatePushButton<Commands.CommandMultiple>("Multiple"),
ribbonPanel.CreatePushButton<Commands.CommandView>("View")
);

return Result.Succeeded;
Expand Down
1 change: 0 additions & 1 deletion ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

<StackPanel x:Name="Root" />


</Window>
9 changes: 9 additions & 0 deletions ricaun.Revit.UI.StatusBar/Revit/Views/ThemeView.xaml.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -27,6 +28,13 @@ public ThemeView()
{
this.Close();
}
if (e.Key == System.Windows.Input.Key.R)
{
foreach (var progressBar in Root.Children.OfType<ProgressBarStackPanel>())
{
Run(progressBar);
}
}
};

}
Expand All @@ -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++)
Expand Down

0 comments on commit d1d5b33

Please sign in to comment.