aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs
blob: 432982dc2e74cadb4fa117b9675765372fa2fa88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.BL.Entities;
using Tango.MachineStudio.Common.Notifications;
using Tango.SharedUI;

namespace Tango.MachineStudio.DB.ViewModels
{
    public class MachinesViewVM : DbTableViewModel<Machine>
    {
        public MachinesViewVM(INotificationProvider notification) : base(notification)
        {
        }

        protected override void InitializeEntity(Machine entity)
        {
            base.InitializeEntity(entity);
            entity.ProductionDate = DateTime.UtcNow;
        }
    }
}
w"> ObservableCollection<IProjectItem> Items { get; set; } public ObservableCollection<ISolutionItemCommand> Commands { get ; set; } public ProjectItem():base() { Items = new ObservableCollection<IProjectItem>(); } public abstract BitmapSource Image { get; } public abstract FrameworkElement OnGetView(); private FrameworkElement GetView() { return OnGetView(); } protected static BitmapSource GetImage(String name) { if (_imageCache.ContainsKey(name)) { return _imageCache[name]; } else { var image = ResourceHelper.GetImageFromResources(name); _imageCache.Add(name, image); return image; } } public abstract bool CanOpen { get; } public FrameworkElement View => GetView(); } }