public void OnTapped() { System.Diagnostics.Debug.WriteLine("{0} was tapped", Text); if (TappedCommand != null && TappedCommand.CanExecute(WorkoutId.ToString())) { TappedCommand.Execute(WorkoutId.ToString()); } var handler = Tapped; if (handler != null) { handler(this, EventArgs.Empty); } }
public override string ToString() { var s = new StringBuilder() .AppendLine(WorkoutId.ToString()) .AppendLine(InstanceId.ToString()) .AppendLine(WorkoutStarted.ToString()) .AppendLine(WorkoutEnded.ToString()); foreach (var score in Scores) { s.AppendLine(score.ToString()); } return(s.ToString()); }
public async void OnDragAborted() { onswap = false; Status = DragState.Aborted; this.Scale = 1; this.Opacity = 1; FontSize = 14; await this.LayoutTo(CurrentBounds, 100, Easing.CubicIn); OnDragCompleted(CurrentTarget); if (DraggedCommand != null && DraggedCommand.CanExecute(new string[] { "-", WorkoutId.ToString() })) { DraggedCommand.Execute(new string[] { "-", WorkoutId.ToString() }); } TapEnabled = true; }
public async void OnDragCompleted(IDrop target) { if (target == CurrentDropBox) { onswap = false; } if (TargetType != target.GetType()) { return; } Constants.CurrentCategoryOrder.Remove(int.Parse(this.ClassId)); Constants.CurrentCategoryOrder.Insert(target.position, int.Parse(this.ClassId)); if (target.DraggableChildren.Count > 0 && onswap) { target.DraggableChildren[0].OnDragCompleted(CurrentDropBox); CurrentDropBox.OnDraggableDropped(target.DraggableChildren[0]); target.DraggableChildren[0].CurrentDropBox = CurrentDropBox; onswap = false; } CurrentTarget = target; CurrentDropBox = target; this.Scale = 1; this.Opacity = 1; FontSize = 10; var view = target as View; if (view != null) { var bounds = view.Bounds; await this.LayoutTo(bounds, 0, Easing.CubicIn); CurrentBounds = bounds; //System.Diagnostics.Debug.WriteLine("{0} current bounds: {1}", Text, CurrentBounds); } Status = DragState.Completed; TapEnabled = false; if (DraggedCommand != null && DraggedCommand.CanExecute(new string[] { ((DropBox)target).Date.ToString("D"), WorkoutId.ToString() })) { DraggedCommand.Execute(new string[] { ((DropBox)target).Date.ToString("d"), WorkoutId.ToString() }); } }