aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MainViewVM.cs
blob: 306f15c5c5851dba6d76186a3e4a4e1e2a0e03e4 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.MachineStudio.Technician.Navigation;
using Tango.SharedUI;

namespace Tango.MachineStudio.Technician.ViewModels
{
    /// <summary>
    /// Represents the technician module main view, view model.
    /// </summary>
    /// <seealso cref="Tango.SharedUI.ViewModel" />
    public class MainViewVM : ViewModel
    {
        private TechNavigationManager _navigation;

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewVM"/> class.
        /// </summary>
        /// <param name="navigationManager">The navigation manager.</param>
        public MainViewVM(TechNavigationManager navigationManager)
        {
            _navigation = navigationManager;
            NavigateToViewCommand = new RelayCommand<string>(NavigateToView);
        }

        #endregion

        #region Commands

        /// <summary>
        /// Gets or sets the navigate to view command.
        /// </summary>
        public RelayCommand<String> NavigateToViewCommand { get; set; }

        #endregion

        #region Private Methods

        /// <summary>
        /// Navigates to the specified view.
        /// </summary>
        /// <param name="view">The view.</param>
        private void NavigateToView(string view)
        {
            _navigation.NavigateTo((TechNavigationView)Enum.Parse(typeof(TechNavigationView), view, true));
        }

        #endregion
    }
}