MVVM
authorPAMPHILE Jonathan <pamphile@efrei.fr>
Wed, 14 Oct 2009 14:02:31 +0200
changeset 148 c379899e9c94
parent 147 1a5da89daee9
child 149 df197df887d3
MVVM
.hgignore
src/FingersDance.Control.Screen/UserControlScreen.xaml.cs
src/FingersDance.Control.SessionInput/FingersDance.Control.SessionInput.csproj
src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml
src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml.cs
src/FingersDance.Control/FingersDance.Control.csproj
src/FingersDance.Data/FingersDance.Data.csproj
src/FingersDance.Data/Project.cs
src/FingersDance.Data/Session.cs
src/FingersDance.Data/User.cs
src/FingersDance.ViewModel/ProjectViewModel.cs
src/FingersDance.ViewModel/SessionViewModel.cs
src/FingersDance.ViewModel/UserViewModel.cs
src/FingersDance/MainSurfaceWindow.xaml.cs
--- a/.hgignore	Wed Oct 14 13:45:55 2009 +0200
+++ b/.hgignore	Wed Oct 14 14:02:31 2009 +0200
@@ -36,4 +36,4 @@
 glob:desktop.ini
 glob:*.orig
 glob:src\FingersDance\Resources\videos.xml
-relre:glob:*.wmv
+glob:*.wmv
--- a/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -1,6 +1,7 @@
 using System;
 using System.IO;
 using System.Net;
+using System.Collections.Generic;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Data;
@@ -20,28 +21,27 @@
         public int id = 0;
         public event EventHandler UC_Screen_NewSession;
         public MainViewModel MainViewModel;
-        public User User = new User();
+        public ProjectViewModel Project = new ProjectViewModel();
+        List<Session> sessions = new List<Session>();
+        User User = new User();
 
         public UserControlScreen(int id, MainViewModel mvmodel)
         {
             this.InitializeComponent();
             this.id = id;
             MainViewModel = mvmodel;
-
             if (MainViewModel.Session.VideoPath.Equals(""))
             {
                 //1-Creation de la ListVideo
                 UserControlListVideo ListVideo = new UserControlListVideo();
                 ListVideo.Name = "ListVideo1";
-
                 //2-Ajout de la ListVideo au ControlScreen
                 this.AddToGrid(ListVideo);
-
                 //3-Creation des Events pour chaque item de la video
                 ListVideo.EH_ItemVideo1_ContactDown += new System.EventHandler(this.ListVideo_EH_ItemVideo_ContactDown);
             }
             else
-                ListVideo_EH_ItemVideo_ContactDown(null, null);
+                OpenProject();
         }
 
         //Rajout un UIElement vers la grid du screen.
@@ -56,42 +56,136 @@
 
         private void ListVideo_EH_ItemVideo_ContactDown(object sender, EventArgs e)
         {
-            //1-Creation d'une nouvelle seance.                
-            UserControlSessionInput SessionInput = new UserControlSessionInput();
-            SessionInput.Name = "SessionInput";
-
             try
             {
-                //2-Recuperer la Grid (Layout root du UC screen)qui contient le UCListVideo et l'ajouter.
-                
-                LayoutRoot.Children.Add(SessionInput);
-
-                //2.5 rensegner la video choisie au screen
-                if (sender != null)
-                    MainViewModel.CreateSession(((UserControlListVideo)sender).VideoName, ((UserControlListVideo)sender).path);
-
-                //3-Creation des Events
-                SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
-                //4-Supression du UC List Video
+                //1 rensegner la video choisie au screen
+                MainViewModel.CreateSession(((UserControlListVideo)sender).VideoName, ((UserControlListVideo)sender).path);
+                //2-Supression du UC List Video
                 LayoutRoot.Children.Remove((UserControlListVideo)sender);
+                OpenSession();
             }
             catch (Exception ex) { }
         }
-        
+
+        private void OpenSession()
+        {
+            try
+            {
+                sessions = LoadSessions(MainViewModel.Session.VideoPath);
+                UserControlListSession listSession = new UserControlListSession(sessions);
+                listSession.Name = "ListSession";
+                LayoutRoot.Children.Add(listSession);
+                listSession.EH_List_ContactDown += new EventHandler(listSession_EH_List_ContactDown);
+            }
+            catch (Exception) { }
+        }
+
+        private List<Session> LoadSessions(string name)
+        {
+            try
+            {
+                return new List<Session>();
+            }
+            catch (Exception) 
+            {
+                return new List<Session>();
+            }
+        }
+
+        void listSession_EH_List_ContactDown(object sender, EventArgs e)
+        {
+            try
+            {
+                LayoutRoot.Children.Remove((UserControlListSession)sender);
+                if (((UserControlListSession)sender).SelectedItem.Equals("New Session"))
+                {
+                    UserControlSessionInput SessionInput = new UserControlSessionInput();
+                    SessionInput.Name = "SessionInput";
+                    LayoutRoot.Children.Add(SessionInput);
+                    SessionInput.EH_SurfaceButtonSubmit_ContactDown += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
+                }
+                else
+                {
+                    foreach (Session elt in sessions)
+                    {
+                        if (elt.Name.Equals(((UserControlListSession)sender).SelectedItem))
+                        {
+                            MainViewModel.Session.Projects = elt.Projects;
+                            OpenProject();
+                            return;
+                        }
+                    }
+                }
+            }
+            catch (Exception) { }
+        }
+
         private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e)
         {
             try
             {
-                //1-Creation du projet
-                User = ((UserControlSessionInput)sender).User;
-                MainViewModel.CreateProject(User);
+                MainViewModel.Session.Alias = ((UserControlSessionInput)sender).Alias;
+                MainViewModel.Session.Email = ((UserControlSessionInput)sender).Email;
+                MainViewModel.Session.Description = ((UserControlSessionInput)sender).Description;
+                MainViewModel.Session.Name = ((UserControlSessionInput)sender).Name;
+                
                 //2-Suppression UCSession Input
                 LayoutRoot.Children.Remove((UserControlSessionInput)sender);
-                //3-Suppression du UC Screen
-                if(UC_Screen_NewSession!=null)
-                    UC_Screen_NewSession(this, new EventArgs());
+                OpenProject();
             }
             catch (Exception ex) { }
         }
+
+        private void OpenProject()
+        {
+            try
+            {
+                UserControlListProject listProjects = new UserControlListProject(MainViewModel.Session.Projects);
+                listProjects.Name = "ListProjects";
+                LayoutRoot.Children.Add(listProjects);
+                listProjects.EH_Item_ContactDown += new EventHandler(listProjects_EH_Item_ContactDown);
+            }
+            catch (Exception) { }
+        }
+
+        void listProjects_EH_Item_ContactDown(object sender, EventArgs e)
+        {
+            try
+            {
+                LayoutRoot.Children.Remove((UserControlListProject)sender);
+                if (((UserControlListProject)sender).SelectedItem.Equals("New Project"))
+                {
+                    UserControlNewProject newProject = new UserControlNewProject(User);
+                    newProject.Name = "newProject";
+                    LayoutRoot.Children.Add(newProject);
+                    newProject.EH_NewProject_ContactDown += new EventHandler(newProject_EH_NewProject_ContactDown);
+                } 
+                else
+                {
+                    foreach(KeyValuePair<string, Project> elt in MainViewModel.Session.Projects)
+                        if (elt.Key.Equals(((UserControlListProject)sender).SelectedItem))
+                        {
+                            Project = new ProjectViewModel(elt.Value);
+                            if (UC_Screen_NewSession != null)
+                                UC_Screen_NewSession(this, new EventArgs());
+                            return;
+                        }
+                }
+            }
+            catch (Exception) { }
+        }
+
+        void newProject_EH_NewProject_ContactDown(object sender, EventArgs e)
+        {
+            try
+            {
+                LayoutRoot.Children.Remove((UserControlNewProject)sender);
+                Project = new ProjectViewModel(((UserControlNewProject)sender).Project);
+                MainViewModel.Session.Projects.Add(Project.Name, Project.Project);
+                if (UC_Screen_NewSession != null)
+                    UC_Screen_NewSession(this, new EventArgs());
+            }
+            catch (Exception) { }
+        }
 	}
 }
\ No newline at end of file
--- a/src/FingersDance.Control.SessionInput/FingersDance.Control.SessionInput.csproj	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Control.SessionInput/FingersDance.Control.SessionInput.csproj	Wed Oct 14 14:02:31 2009 +0200
@@ -70,9 +70,18 @@
     </Reference>
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="WindowsBase" />
-    <Reference Include="PresentationCore" />
-    <Reference Include="PresentationFramework" />
+    <Reference Include="UIAutomationProvider">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="PresentationCore">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="PresentationFramework">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
     <Reference Include="Microsoft.Surface" />
     <Reference Include="Microsoft.Surface.Presentation" />
     <Reference Include="Microsoft.Surface.Presentation.Generic" />
@@ -80,6 +89,18 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Resource>
+    <Page Include="UserControlListProject.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UserControlListSession.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UserControlNewProject.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="UserControlSessionInput.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -109,6 +130,15 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="UserControlListProject.xaml.cs">
+      <DependentUpon>UserControlListProject.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UserControlListSession.xaml.cs">
+      <DependentUpon>UserControlListSession.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UserControlNewProject.xaml.cs">
+      <DependentUpon>UserControlNewProject.xaml</DependentUpon>
+    </Compile>
     <AppDesigner Include="Properties\" />
   </ItemGroup>
   <ItemGroup>
@@ -125,6 +155,10 @@
     <Resource Include="Resources\WindowBackground.jpg" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\FingersDance.Control\FingersDance.Control.csproj">
+      <Project>{4DC517DD-1601-481E-BAAC-6FE271417F46}</Project>
+      <Name>FingersDance.Control</Name>
+    </ProjectReference>
     <ProjectReference Include="..\FingersDance.Data\FingersDance.Data.csproj">
       <Project>{EAF384DB-2AE4-4132-839D-60F9DAFDEAD8}</Project>
       <Name>FingersDance.Data</Name>
--- a/src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml	Wed Oct 14 14:02:31 2009 +0200
@@ -4,10 +4,13 @@
 	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 	mc:Ignorable="d"
-	xmlns:Custom="http://schemas.microsoft.com/surface/2008" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
+	xmlns:Custom="http://schemas.microsoft.com/surface/2008" 
+    xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
 	x:Class="FingersDance.Control.SessionInput.UserControlSessionInput"
 	x:Name="UserControl"
-	Background="#FFA09E9E" Width="256" Height="192">
+	Background="#FFA09E9E" 
+    Width="256" 
+    Height="192">
 
 	<UserControl.Resources>
 		<Style x:Key="FingersDance.Control.SurfaceRadioButton" TargetType="{x:Type Custom:SurfaceRadioButton}">
--- a/src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Control.SessionInput/UserControlSessionInput.xaml.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -14,19 +14,27 @@
 	public partial class UserControlSessionInput
 	{
         public event EventHandler EH_SurfaceButtonSubmit_ContactDown;
-        public User User = new User();
+        public string Name = "";
+        public string Email = "";
+        public string Alias = "";
+        public string Description = "";
 
 		public UserControlSessionInput()
 		{
 			this.InitializeComponent();
             ST_Date.Text = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();
-		}
+        }
+
+        #region Actions
 
         private void SurfaceButtonSubmit_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
         {
             if (!ST_Alias.Text.Equals("") && !ST_Date.Text.Equals("") && !ST_Email.Text.Equals("") && !ST_Name.Text.Equals(""))
             {
-                User = new User(ST_Name.Text, ST_Email.Text, ST_Alias.Text);
+                Name= ST_Name.Text;
+                Email= ST_Email.Text;
+                Alias = ST_Alias.Text;
+                Description = ST_Desc.Text;
                 if (EH_SurfaceButtonSubmit_ContactDown != null)
                     EH_SurfaceButtonSubmit_ContactDown(this, new EventArgs());
             }
@@ -36,11 +44,16 @@
         {
             if (!ST_Alias.Text.Equals("") && !ST_Date.Text.Equals("") && !ST_Email.Text.Equals("") && !ST_Name.Text.Equals(""))
             {
-                User = new User(ST_Name.Text, ST_Email.Text, ST_Alias.Text);
+                Name = ST_Name.Text;
+                Email = ST_Email.Text;
+                Alias = ST_Alias.Text;
+                Description = ST_Desc.Text;
                 if (EH_SurfaceButtonSubmit_ContactDown != null)
                     EH_SurfaceButtonSubmit_ContactDown(this, new EventArgs());
             }
         }
 
+        #endregion
+
 	}
 }
\ No newline at end of file
--- a/src/FingersDance.Control/FingersDance.Control.csproj	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Control/FingersDance.Control.csproj	Wed Oct 14 14:02:31 2009 +0200
@@ -77,6 +77,7 @@
     <Reference Include="Microsoft.Surface.Presentation.Generic" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CustomListBoxItem.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
--- a/src/FingersDance.Data/FingersDance.Data.csproj	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Data/FingersDance.Data.csproj	Wed Oct 14 14:02:31 2009 +0200
@@ -32,26 +32,6 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x86\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
-    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <OutputPath>bin\x86\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <Optimize>true</Optimize>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
-    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Core">
--- a/src/FingersDance.Data/Project.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Data/Project.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -8,10 +8,23 @@
     [Serializable]
     public class Project
     {
+        private string _name = "";
+        private string _date = "";
+        private string _description = "";
         private User _user = new User();
         private Cutting _cutting = new Cutting();
 
         #region Constructor
+
+        public Project(string name, string date, string desc, User u, Cutting c)
+        {
+            _date = date;
+            _description = desc;
+            _name = name;
+            _user = u;
+            _cutting = c;
+        }
+
         public Project(User u, Cutting c)
         {
             _user = u;
@@ -24,11 +37,31 @@
         #endregion
 
         #region Properties
+
+        public string Date
+        {
+            get { return _date; }
+            set { _date = value; }
+        }
+
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        public string Description
+        {
+            get { return _description; }
+            set { _description = value; }
+        }
+
         public User User
         {
             get { return _user; }
             set { _user = value; }
         }
+
         public Cutting Cutting
         {
             get { return _cutting; }
--- a/src/FingersDance.Data/Session.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Data/Session.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -8,8 +8,12 @@
     [Serializable]
     public class Session
     {
+        private String _name = "";
         private String _videoname = "";
         private String _videopath = "";
+        private String _alias = "";
+        private String _email = "";
+        private String _description = "";
         private Dictionary<String, Project> _projects = new Dictionary<String, Project>();
 
         #region Constructor
@@ -24,17 +28,36 @@
         #endregion
 
         #region Properties
-        public String VideoName
+        public String Name
         {
-            get { return _videoname; }
-            set { _videoname = value; }
+            get { return _name; }
+            set { _name = value; }
         }
+
         public String Videopath
         {
             get { return _videopath; }
             set { _videopath = value; }
         }
 
+        public String Alias
+        {
+            get { return _alias; }
+            set { _alias = value; }
+        }
+
+        public String Email
+        {
+            get { return _email; }
+            set { _email = value; }
+        }
+
+        public String Description
+        {
+            get { return _description; }
+            set { _description = value; }
+        }
+
         public Dictionary<String, Project> Projects
         {
             get { return _projects; }
--- a/src/FingersDance.Data/User.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.Data/User.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -14,44 +14,42 @@
     {
         private String _name="";
         private String _email="";
-        private String _alias="";
         private String _colorkey="";
 
         #region Constructor
-        public User(String name, String email, String alias)
+        
+        public User(String name, String email)
         {
             _name = name;
             _email = email;
-            _alias = alias;
         }
 
-        public User(String name, String email, String alias,String color)
+        public User(String name, String email,String color)
         {
             _name = name;
             _email = email;
-            _alias = alias;
             _colorkey = color;
         }
+        
         public User()
         { }
+        
         #endregion
 
         #region Properties
+        
         public String Name
         {
             get { return _name; }
             set { _name = value; }
         }
+
         public String Email
         {
             get { return _email; }
             set { _email = value; }
         }
-        public String Alias
-        {
-            get { return _alias; }
-            set { _alias = value; }
-        }
+
         #endregion
     }
 }
--- a/src/FingersDance.ViewModel/ProjectViewModel.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.ViewModel/ProjectViewModel.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -22,7 +22,30 @@
         #endregion
 
         #region Properties
-        
+
+        public Project Project
+        {
+            get { return project; }
+        }
+
+        public string Date
+        {
+            get { return project.Date; }
+            set { project.Date = value; }
+        }
+
+        public string Name
+        {
+            get { return project.Name; }
+            set { project.Name = value; }
+        }
+
+        public string Description
+        {
+            get { return project.Description; }
+            set { project.Description = value; }
+        }
+
         public User User
         {
             get { return project.User; }
--- a/src/FingersDance.ViewModel/SessionViewModel.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.ViewModel/SessionViewModel.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -23,10 +23,10 @@
 
         #region Properties
 
-        public String VideoName
+        public String Name
         {
-            get { return session.VideoName; }
-            set { session.VideoName = value; }
+            get { return session.Name; }
+            set { session.Name = value; }
         }
 
         public String VideoPath
@@ -35,6 +35,24 @@
             set { session.Videopath = value; }
         }
 
+        public String Alias
+        {
+            get { return session.Alias; }
+            set { session.Alias = value; }
+        }
+
+        public String Email
+        {
+            get { return session.Email; }
+            set { session.Email = value; }
+        }
+
+        public String Description
+        {
+            get { return session.Description; }
+            set { session.Description = value; }
+        }
+
         public Dictionary<String, Project> Projects
         {
             get { return session.Projects; }
--- a/src/FingersDance.ViewModel/UserViewModel.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance.ViewModel/UserViewModel.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -15,27 +15,24 @@
         public UserViewModel(User u) {
             user.Name = u.Name;
             user.Email = u.Email;
-            user.Alias = u.Alias;
             //Possibles Commands
         }
         #endregion
 
         #region Properties
+
         public String Name
         {
             get { return user.Name; }
             set { user.Name = value; }
         }
+        
         public String Email
         {
             get { return user.Email; }
             set { user.Email = value; }
         }
-        public String Alias
-        {
-            get { return user.Alias; }
-            set { user.Alias = value; }
-        }
+
         #endregion
     }
 }
--- a/src/FingersDance/MainSurfaceWindow.xaml.cs	Wed Oct 14 13:45:55 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml.cs	Wed Oct 14 14:02:31 2009 +0200
@@ -375,7 +375,7 @@
                 Grid root = (Grid)(((UserControlScreen)sender).Parent);
                 root.Children.Remove(((UserControlScreen)sender));
                 //2-Creation du User Panel
-                Project newProject = _mainviewmodel.CreateProject(((UserControlScreen)sender).User);
+                Project newProject = ((UserControlScreen)sender).Project.Project;
 
                 if ((Panel1 != null && Panel1.Project.Equals(newProject)) || (Panel2 != null && Panel2.Project.Equals(newProject)) || (Panel3 != null && Panel3.Project.Equals(newProject)) || (Panel4 != null && Panel4.Project.Equals(newProject)))
                     return;