aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs
blob: 18c8c3daaf1f28ec2706022d153c9fed763f85e4 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.MachineStudio.Common.Notifications;

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

        protected override void InitializeEntity(Configuration entity)
        {
            base.InitializeEntity(entity);
            entity.CreationDate = DateTime.UtcNow;
        }
    }
}
span>public partial class ReportIssueView : UserControl { private ReportIssueViewVM _vm; public ReportIssueView() { InitializeComponent(); this.Loaded += ReportIssueView_Loaded; this.DataContextChanged += ReportIssueView_DataContextChanged; } private void ReportIssueView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { _vm = this.DataContext as ReportIssueViewVM; } private void ReportIssueView_Loaded(object sender, RoutedEventArgs e) { txt_title.Focus(); } private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { _vm.WorkItem.Area = e.NewValue as Area; toggleArea.IsChecked = false; } private TreeView tree; private void TreeView_Loaded(object sender, RoutedEventArgs e) { tree = sender as TreeView; tree.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged; } private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e) { if (tree.ItemContainerGenerator.Status == System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated) { TreeViewItem i = tree.ItemContainerGenerator.ContainerFromIndex(0) as TreeViewItem; i.IsExpanded = true; } } } }