src/FingersDance.Control.Base/SurfaceWindow1.xaml.cs
author sarias
Thu, 16 Jul 2009 22:49:26 +0200
changeset 0 f603bde47f41
permissions -rw-r--r--
Le repository FingersDance avec nouvelle arborescence. Tous les \obj et \bin on été ignoré ainsi que les .suo .cache etc.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     1
using System;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     2
using System.Collections.Generic;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     3
using System.Linq;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     4
using System.Text;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     5
using System.Windows;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     6
using System.Windows.Controls;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     7
using System.Windows.Data;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     8
using System.Windows.Documents;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
     9
using System.Windows.Input;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    10
using System.Windows.Media;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    11
using System.Windows.Media.Imaging;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    12
using System.Windows.Shapes;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    13
using System.Windows.Threading;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    14
using Microsoft.Surface;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    15
using Microsoft.Surface.Presentation;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    16
using Microsoft.Surface.Presentation.Controls;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    17
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    18
namespace FingersDance.Control.Base
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    19
{
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    20
    /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    21
    /// Interaction logic for SurfaceWindow1.xaml
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    22
    /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    23
    public partial class SurfaceWindow1 : SurfaceWindow
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    24
    {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    25
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    26
        /// Default constructor.
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    27
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    28
        public SurfaceWindow1()
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    29
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    30
            InitializeComponent();
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    31
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    32
            // Add handlers for Application activation events
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    33
            AddActivationHandlers();
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    34
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    35
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    36
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    37
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    38
        /// Occurs when the window is about to close. 
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    39
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    40
        /// <param name="e"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    41
        protected override void OnClosed(EventArgs e)
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    42
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    43
            base.OnClosed(e);
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    44
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    45
            // Remove handlers for Application activation events
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    46
            RemoveActivationHandlers();
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    47
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    48
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    49
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    50
        /// Adds handlers for Application activation events.
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    51
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    52
        private void AddActivationHandlers()
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    53
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    54
            // Subscribe to surface application activation events
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    55
            ApplicationLauncher.ApplicationActivated += OnApplicationActivated;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    56
            ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    57
            ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    58
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    59
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    60
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    61
        /// Removes handlers for Application activation events.
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    62
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    63
        private void RemoveActivationHandlers()
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    64
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    65
            // Unsubscribe from surface application activation events
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    66
            ApplicationLauncher.ApplicationActivated -= OnApplicationActivated;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    67
            ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    68
            ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated;
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    69
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    70
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    71
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    72
        /// This is called when application has been activated.
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    73
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    74
        /// <param name="sender"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    75
        /// <param name="e"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    76
        private void OnApplicationActivated(object sender, EventArgs e)
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    77
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    78
            //TODO: enable audio, animations here
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    79
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    80
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    81
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    82
        /// This is called when application is in preview mode.
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    83
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    84
        /// <param name="sender"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    85
        /// <param name="e"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    86
        private void OnApplicationPreviewed(object sender, EventArgs e)
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    87
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    88
            //TODO: Disable audio here if it is enabled
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    89
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    90
            //TODO: optionally enable animations here
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    91
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    92
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    93
        /// <summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    94
        ///  This is called when application has been deactivated.
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    95
        /// </summary>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    96
        /// <param name="sender"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    97
        /// <param name="e"></param>
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    98
        private void OnApplicationDeactivated(object sender, EventArgs e)
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
    99
        {
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
   100
            //TODO: disable audio, animations here
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
   101
        }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
   102
    }
f603bde47f41 Le repository FingersDance avec nouvelle arborescence.
sarias
parents:
diff changeset
   103
}