Progress window was edded

This commit is contained in:
Evgeny Redikultsev
2023-11-08 21:56:13 +05:00
parent 44c5065d03
commit 36cb0878e9
6 changed files with 133 additions and 25 deletions

View File

@@ -6,18 +6,24 @@
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.ProgressViews"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:InterpolationProgressViewModel}"
Title="InterpolationProgressView" Height="150" Width="200" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
<Grid>
Title="InterpolationProgressView" Height="150" Width="400" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None">
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="IterationCount"/>
<ProgressBar Grid.Column="1" Grid.Row="0" Minimum="{Binding MinValue}" Maximum="{Binding MaxValue}" Value="{Binding Value}"/>
<TextBlock Text="Progress"/>
<ProgressBar Grid.Column="1" Grid.Row="0" Minimum="{Binding MinValue}" Maximum="{Binding MaxValue}" Value="{Binding ProgressValue}"/>
<TextBlock Grid.Row="1" Text="Total step"/>
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding MaxValue}" IsEnabled="False"/>
<TextBlock Grid.Row="2" Text="Current step"/>
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding ProgressValue}" IsEnabled="False"/>
</Grid>
</Window>

View File

@@ -25,7 +25,7 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
{
InitializeComponent();
this.viewModel = viewModel;
this.DataContext = this.viewModel;
DataContext = this.viewModel;
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using StructureHelper.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,10 +7,36 @@ using System.Threading.Tasks;
namespace StructureHelper.Windows.CalculationWindows.ProgressViews
{
public class InterpolationProgressViewModel
public class InterpolationProgressViewModel : ViewModelBase
{
public double MinValue { get; set; }
public double MaxValue { get; set; }
public double Value { get; set; }
private double progressValue;
private double maxValue;
private double minValue;
public double MinValue
{
get => minValue; set
{
minValue = value;
OnPropertyChanged(nameof(MinValue));
}
}
public double MaxValue
{
get => maxValue; set
{
maxValue = value;
OnPropertyChanged(nameof(MaxValue));
}
}
public double ProgressValue
{
get => progressValue;
set
{
progressValue = value;
OnPropertyChanged(nameof(ProgressValue));
}
}
}
}