80 lines
2.0 KiB
C#
80 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Controls;
|
|
using Ui.ProductionControls.Enums;
|
|
|
|
namespace Ui.ProductionControls
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for PictureProgress.xaml
|
|
/// </summary>
|
|
public partial class ctlPictureProgressBar : UserControl
|
|
{
|
|
public class ImageElement
|
|
{
|
|
public event EventHandler OnChanged;
|
|
private string name;
|
|
public string Name
|
|
{
|
|
get { return name; }
|
|
set
|
|
{
|
|
name = value;
|
|
OnChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
private ImgStatus state;
|
|
public ImgStatus State
|
|
{
|
|
get { return state; }
|
|
set
|
|
{
|
|
state = value;
|
|
OnChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
private Img image;
|
|
public Img Image
|
|
{
|
|
get { return image; }
|
|
set
|
|
{
|
|
image = value;
|
|
OnChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
internal void Force()
|
|
{
|
|
OnChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
private Dictionary<ImageElement, PictureProgressModel> imageElements;
|
|
public ctlPictureProgressBar()
|
|
{
|
|
InitializeComponent();
|
|
imageElements = new Dictionary<ImageElement, PictureProgressModel>();
|
|
}
|
|
|
|
public void Add(ImageElement add)
|
|
{
|
|
|
|
PictureProgressModel mdl = new PictureProgressModel(add);
|
|
imageElements.Add(add, mdl);
|
|
stackImages.Children.Add(new ctlPictureProgress(mdl));
|
|
add.Force();
|
|
|
|
}
|
|
|
|
public void AddRange(List<ImageElement> progressBar)
|
|
{
|
|
foreach (var item in progressBar)
|
|
{
|
|
Add(item);
|
|
}
|
|
}
|
|
}
|
|
}
|