client/src/Iri.Modernisation.Controls/ViewModel/Main/MainVM.cs
author Matthieu Totet
Fri, 18 Dec 2009 16:45:30 +0100
changeset 25 a9c815025a1b
parent 17 0e4e63f6f567
child 36 b6df6fce6e5d
permissions -rw-r--r--
Update ProductionView + Cleanning Code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     1
using System;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     2
using System.Net;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     3
using System.Windows;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     4
using System.Windows.Controls;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     5
using System.Windows.Documents;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     6
using System.Windows.Ink;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     7
using System.Windows.Input;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     8
using System.Windows.Media;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
     9
using System.Windows.Media.Animation;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    10
using System.Windows.Shapes;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    11
using System.Collections.Generic;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    12
using Iri.Modernisation.Data.Models;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    13
using Iri.Modernisation.BaseMVVM.Commands;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    14
using Iri.Modernisation.BaseMVVM.ViewModel;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    15
namespace Iri.Modernisation.Controls.ViewModel
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    16
{
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    17
    /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    18
    /// ViewModel de Main
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    19
    /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    20
    public class MainVM : BaseMVVM.ViewModel.ViewModel
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    21
    {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    22
        private ConsultationViewVM _consultationViewVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    23
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    24
        /// ViewModel de ConsultationView
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    25
        /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    26
        public ConsultationViewVM ViewModelConsultationView
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    27
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    28
            get
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    29
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    30
                return _consultationViewVM;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    31
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    32
            set
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    33
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    34
                _consultationViewVM = value;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    35
                OnPropertyChanged("ViewModelConsultationView");
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    36
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    37
        }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    38
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    39
        private NavigationBarVM _navigationBarVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    40
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    41
        /// ViewModel de NavigationBar
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    42
        /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    43
        public NavigationBarVM ViewModelNavigationBar
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    44
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    45
            get
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    46
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    47
                return _navigationBarVM;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    48
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    49
            set
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    50
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    51
                _navigationBarVM = value;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    52
                OnPropertyChanged("ViewModelNavigationBar");
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    53
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    54
        }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    55
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    56
        private HeaderControlVM _headerControlVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    57
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    58
        /// ViewsModel de HeaderControl
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    59
        /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    60
        public HeaderControlVM ViewModelHeaderControl
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    61
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    62
            get
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    63
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    64
                return _headerControlVM;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    65
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    66
            set
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    67
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    68
                _headerControlVM = value;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    69
                OnPropertyChanged("ViewModelHeaderControl");
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    70
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    71
        }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    72
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    73
        private ProductionViewVM _productionViewVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    74
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    75
        /// ViewModel de ProductionView
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    76
        /// </summary>
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    77
        public ProductionViewVM ViewModelProductionView
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    78
        {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    79
            get
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    80
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    81
                return _productionViewVM;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    82
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    83
            set
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    84
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    85
                _productionViewVM = value;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    86
                OnPropertyChanged("ViewModelProductionView");
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    87
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    88
        }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    89
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    90
        public MainVM(List<VideoBook> videoBooks)
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    91
        {
13
b5ee436add3d ContextualLinkBinder From ClickMenu
Matthieu Totet
parents: 12
diff changeset
    92
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    93
            InitializeCommands();
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    94
            List<VideoBook> SelectedVideoBooks = videoBooks;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    95
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    96
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    97
            // Initialisation des Components //
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    98
            ViewModelProductionView = new ProductionViewVM();
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    99
            ViewModelConsultationView = new ConsultationViewVM();
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   100
            ViewModelNavigationBar = new NavigationBarVM() { ConsultMenuViewModel = new ConsultMenuVM(SelectedVideoBooks) };
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   101
            ViewModelHeaderControl = new HeaderControlVM();
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
   102
          
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   103
        }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   104
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   105
        private void InitializeCommands()
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   106
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   107
            Commands.Initialize();
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   108
        }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   109
       
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   110
    }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   111
}