client/src/Iri.Modernisation.Controls/ViewModel/Main/MainVM.cs
author totetm <>
Wed, 27 Jan 2010 10:37:39 +0100
changeset 36 b6df6fce6e5d
parent 25 a9c815025a1b
child 42 594fdedecf7f
permissions -rw-r--r--
Sync init XML download. ProductionVideo from URI source
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;
36
b6df6fce6e5d Sync init XML download.
totetm <>
parents: 25
diff changeset
    15
using System.Collections.ObjectModel;
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    16
namespace Iri.Modernisation.Controls.ViewModel
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    17
{
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    18
    /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    19
    /// ViewModel de Main
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    20
    /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    21
    public class MainVM : BaseMVVM.ViewModel.ViewModel
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    22
    {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    23
        private ConsultationViewVM _consultationViewVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    24
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    25
        /// ViewModel de ConsultationView
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    26
        /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    27
        public ConsultationViewVM ViewModelConsultationView
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    28
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    29
            get
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    30
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    31
                return _consultationViewVM;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    32
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    33
            set
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    34
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    35
                _consultationViewVM = value;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    36
                OnPropertyChanged("ViewModelConsultationView");
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
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    40
        private NavigationBarVM _navigationBarVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    41
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    42
        /// ViewModel de NavigationBar
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    43
        /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    44
        public NavigationBarVM ViewModelNavigationBar
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    45
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    46
            get
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    47
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    48
                return _navigationBarVM;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    49
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    50
            set
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    51
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    52
                _navigationBarVM = value;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    53
                OnPropertyChanged("ViewModelNavigationBar");
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
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    57
        private HeaderControlVM _headerControlVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    58
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    59
        /// ViewsModel de HeaderControl
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    60
        /// </summary>
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    61
        public HeaderControlVM ViewModelHeaderControl
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    62
        {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    63
            get
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    64
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    65
                return _headerControlVM;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    66
            }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    67
            set
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    68
            {
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    69
                _headerControlVM = value;
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    70
                OnPropertyChanged("ViewModelHeaderControl");
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
        }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    73
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    74
        private ProductionViewVM _productionViewVM;
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    75
        /// <summary>
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    76
        /// ViewModel de ProductionView
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
    77
        /// </summary>
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    78
        public ProductionViewVM ViewModelProductionView
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    79
        {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    80
            get
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    81
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    82
                return _productionViewVM;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    83
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    84
            set
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    85
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    86
                _productionViewVM = value;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    87
                OnPropertyChanged("ViewModelProductionView");
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    88
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    89
        }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 13
diff changeset
    90
36
b6df6fce6e5d Sync init XML download.
totetm <>
parents: 25
diff changeset
    91
        public MainVM()
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    92
        {
13
b5ee436add3d ContextualLinkBinder From ClickMenu
Matthieu Totet
parents: 12
diff changeset
    93
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    94
            InitializeCommands();
36
b6df6fce6e5d Sync init XML download.
totetm <>
parents: 25
diff changeset
    95
            List<VideoBook> SelectedVideoBooks = new List<VideoBook>();
b6df6fce6e5d Sync init XML download.
totetm <>
parents: 25
diff changeset
    96
            SelectedVideoBooks = SettingsProject.ListVideoBook;
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    97
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    98
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
    99
            // Initialisation des Components //
36
b6df6fce6e5d Sync init XML download.
totetm <>
parents: 25
diff changeset
   100
            ViewModelProductionView = new ProductionViewVM() { RecordedVideoSequences = new ObservableCollection<VideoSequence>(SettingsProject.ProductionVideo) };
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   101
            ViewModelConsultationView = new ConsultationViewVM();
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   102
            ViewModelNavigationBar = new NavigationBarVM() { ConsultMenuViewModel = new ConsultMenuVM(SelectedVideoBooks) };
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   103
            ViewModelHeaderControl = new HeaderControlVM();
25
a9c815025a1b Update ProductionView + Cleanning Code
Matthieu Totet
parents: 17
diff changeset
   104
          
12
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   105
        }
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
        private void InitializeCommands()
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
            Commands.Initialize();
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
       
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   112
    }
513caf1637bf Create MVVM Structure for the Main
Matthieu Totet
parents:
diff changeset
   113
}