diff -r 2d4ec5ab2a40 -r 5f8d275750e7 client/src/Iri.Modernisation.Controls/ViewModel/PolemicElementVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/PolemicElementVM.cs Tue Jan 05 15:53:48 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/PolemicElementVM.cs Fri Jan 08 11:33:24 2010 +0100 @@ -20,10 +20,7 @@ /// public class PolemicElementVM : MenuableViewModel { - /// - /// Timer lançant le ClickMenu - /// - private System.Windows.Threading.DispatcherTimer DisplayTimer = new System.Windows.Threading.DispatcherTimer(); + private MouseButtonEventArgs _selectedCoord; /// @@ -222,38 +219,27 @@ Description = _element.Description; Tags = _element.Tags; Chapter = _element.Chapter; - DisplayTimer.Interval = new TimeSpan(0, 0, 0, 0, 500); - DisplayTimer.Tick += new EventHandler(myDispatcherTimer_Tick); + if (_element is Annotation) { _type = ((Annotation)_element).Type.Color; } } - - /// - /// Lors d'un Tick,c'est à dire, lors d'un appuie long sur un élément - /// - /// - /// - void myDispatcherTimer_Tick(object sender, EventArgs e) - { - DisplayTimer.Stop(); - Commands.PolemicElement.ElementSelected.Execute(_selectedCoord, _element); - } + - - public override void MenuableUserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + + public override void ActiveContextualMenu(object sender, MouseButtonEventArgs e) { _selectedCoord = e; Commands.PolemicElement.SelectPolemicElement.Execute(_element); - DisplayTimer.Start(); + Commands.PolemicElement.ElementSelected.Execute(_selectedCoord, _element); } - public override void MenuableUserControl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) + public override void DisactiveContextualMenu(object sender, MouseButtonEventArgs e) { - DisplayTimer.Stop(); + Commands.ContextualBinderLayer.EndBind.Execute(Type, _element); }