# HG changeset patch # User cavaliet # Date 1256135329 -7200 # Node ID 33c2e634df130d606af7b1d5d57321d581efbe95 # Parent e78e40b9d761096b25b6d2815c261f1898fd6472 update drag and drop for dragged annotation to be well displayed and avoid DnD problems diff -r e78e40b9d761 -r 33c2e634df13 src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Sun Oct 18 17:42:21 2009 +0200 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Wed Oct 21 16:28:49 2009 +0200 @@ -40,7 +40,7 @@ private double totalmilliseconds; private List AnnotList = new List(); - private float AnnotWidth = 300 + 15; // The surfaceListBox adds 15 pixels between each item + private float AnnotWidth = 850 + 15; // The surfaceListBox adds 15 pixels between each item private CuttingViewModel CuttingVM; private Boolean AnnotWaiting = false; private float AnnotTcBegin; @@ -132,7 +132,7 @@ // When scaleX = 1, 1 second = 1 pixel. To calculate the new scale, we take the real width in account. Double futurScale = (this.ActualWidth-30) / (totalmilliseconds / 1000); //Double futurScale = this.ActualWidth / ((totalmilliseconds<30000) ? (totalmilliseconds/10) : (totalmilliseconds / 1000)); // TEMP FOR SHORT CONTENTS - tv.RenderTransform = new ScaleTransform(futurScale,1); + tv.listview.RenderTransform = new ScaleTransform(futurScale,1); //tv.Width = this.ActualWidth - 30; } @@ -379,8 +379,11 @@ }; // We apply the current scale to the dragged annotation - ((TimelineAnnotationView)cursorVisual.Content).RenderTransform = this.RenderTransform; - + ((TimelineAnnotationView)cursorVisual.Content).RenderTransform = new TransformGroup(); + ((TransformGroup)((TimelineAnnotationView)cursorVisual.Content).RenderTransform).Children.Add(tv.listview.RenderTransform); + // We apply a translate translate transform to place correctly the dragged annotation + ((TransformGroup)((TimelineAnnotationView)cursorVisual.Content).RenderTransform).Children.Add(new TranslateTransform((AnnotWidth / 2) * (1 - ((ScaleTransform)tv.listview.RenderTransform).ScaleX), 0)); + // Add a handler. This will enable the application to change the visual cues. (NOT USEFUL IN FINGERSDANCE CASE) //SurfaceDragDrop.AddTargetChangedHandler(cursorVisual, OnTargetChanged); diff -r e78e40b9d761 -r 33c2e634df13 src/FingersDance.Views/TimelineAnnotationView.xaml --- a/src/FingersDance.Views/TimelineAnnotationView.xaml Sun Oct 18 17:42:21 2009 +0200 +++ b/src/FingersDance.Views/TimelineAnnotationView.xaml Wed Oct 21 16:28:49 2009 +0200 @@ -8,7 +8,7 @@ x:Class="FingersDance.Views.TimelineAnnotationView" xmlns:vw="clr-namespace:FingersDance.Views" x:Name="UserControl" - d:DesignWidth="640" d:DesignHeight="480" Width="300" Height="40"> + d:DesignWidth="640" d:DesignHeight="480" Width="850" Height="40"> diff -r e78e40b9d761 -r 33c2e634df13 src/FingersDance.Views/TimelineView.xaml --- a/src/FingersDance.Views/TimelineView.xaml Sun Oct 18 17:42:21 2009 +0200 +++ b/src/FingersDance.Views/TimelineView.xaml Wed Oct 21 16:28:49 2009 +0200 @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vw="clr-namespace:FingersDance.Views" - xmlns:Custom="http://schemas.microsoft.com/surface/2008"> + xmlns:Custom="http://schemas.microsoft.com/surface/2008" + Width="1700" >