Push Changes from other Github
This commit is contained in:
50
uniper_hmi/UniperHMI/Common/FlowStationsViewModelBase.cs
Normal file
50
uniper_hmi/UniperHMI/Common/FlowStationsViewModelBase.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using InfineonHMI.Model;
|
||||
|
||||
namespace InfineonHMI.Common
|
||||
{
|
||||
public sealed partial class FlowStationsViewModelBase : ObservableValidator, IChangeTrackingEx
|
||||
{
|
||||
private ObservableCollection<StationEntry> initFlowStations = new();
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<StationEntry> flowStations = new ObservableCollection<StationEntry>();
|
||||
|
||||
public void AcceptChanges()
|
||||
{
|
||||
initFlowStations = new(FlowStations);
|
||||
}
|
||||
|
||||
public bool IsChanged => !initFlowStations.Equals(FlowStations);
|
||||
public void DiscardChanges()
|
||||
{
|
||||
FlowStations = new(initFlowStations);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class FlowReceipe : ObservableValidator, IChangeTrackingEx
|
||||
{
|
||||
|
||||
private ObservableCollection<FlowReceipeEntry> initEntries = new();
|
||||
[ObservableProperty] private ObservableCollection<FlowReceipeEntry> flowReceipeEntries;
|
||||
|
||||
|
||||
public void AcceptChanges()
|
||||
{
|
||||
initEntries = new(FlowReceipeEntries);
|
||||
}
|
||||
|
||||
public bool IsChanged => !FlowReceipeEntries.Equals(initEntries);
|
||||
public void DiscardChanges()
|
||||
{
|
||||
FlowReceipeEntries = new(initEntries);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user