Files
CustomerPanel-Test/UserControls/CustomProgressBar.xaml.cs
2026-03-05 09:56:57 +01:00

57 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace C4IT_CustomerPanel.UserControls
{
/// <summary>
/// Interaktionslogik für CustomProgressBar.xaml
/// </summary>
public partial class CustomProgressBar : UserControl
{
public CustomProgressBar()
{
InitializeComponent();
ProgressValue = 0;
}
private int privProgressValue = 0;
public int ProgressValue {
get { return privProgressValue; }
set {
privProgressValue = value;
if (privProgressValue < 0)
privProgressValue = 0;
if (privProgressValue > 100)
privProgressValue = 100;
double W = this.ActualWidth * ((double)privProgressValue / 100);
ProgressRect.Width = W;
}
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
ProgressValue = privProgressValue;
}
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
ProgressValue = privProgressValue;
}
}
}