aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/NavigationMenuItem.cs
blob: 2f72f877144cde34136809e5b59bfbed2f41c62f (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
using Tango.Core;
using Tango.Core.Commands;

namespace Tango.FSE.Common.Navigation
{
    public class NavigationMenuItem : ExtendedObject
    {
        private Action _pressAction;

        public String Name { get; set; }

        public String Description { get; set; }

        public BitmapSource Image { get; set; }

        public bool IsVisible { get; set; }

        public bool IsEnabled { get; set; }

        public RelayCommand PressCommand { get; set; }

        public int Index { get; set; }

        public NavigationMenuItem(Action pressAction)
        {
            IsVisible = true;
            IsEnabled = true;

            _pressAction = pressAction;

            PressCommand = new RelayCommand(() => 
            {
                _pressAction?.Invoke();
            });
        }
    }
}