public ButtonGroupContainer(TextWriter contextTextWriter, string dropDownButtonText, SlideDirection direction) { writer = contextTextWriter; var starterTemplate = "<div class=\"btn-group\"><a class=\"btn btn-primary btn-group-xs dropdown-toggle\" data-toggle=\"dropdown\">{0}<span class=\"caret\"></span></a><ul class=\"dropdown-menu\">"; starterTemplate = string.Format(starterTemplate, dropDownButtonText); writer.WriteLine(starterTemplate); }
private void NagivateToPage(SlideDirection direction, PlaylistsPage page) { this.SlideInFrom = direction == SlideDirection.RightToLeft ? Constants.SlideDistance : -Constants.SlideDistance; switch (page) { case PlaylistsPage.Playlists: this.regionManager.RequestNavigate(RegionNames.PlaylistsRegion, typeof(PlaylistsPlaylists).FullName); break; case PlaylistsPage.SmartPlaylists: this.regionManager.RequestNavigate(RegionNames.PlaylistsRegion, typeof(PlaylistsSmartPlaylists).FullName); break; default: break; } }
private void NagivateToPage(SlideDirection direction, InformationPage page) { this.SlideInFrom = direction == SlideDirection.RightToLeft ? Constants.SlideDistance : -Constants.SlideDistance; switch (page) { case InformationPage.Help: this.regionManager.RequestNavigate(RegionNames.InformationRegion, typeof(InformationHelp).FullName); break; case InformationPage.About: this.regionManager.RequestNavigate(RegionNames.InformationRegion, typeof(InformationAbout).FullName); break; default: break; } }
/// <summary> /// Slide the toolbar to the previous button. /// </summary> public void SlideToolbarButtonsToPrev() { // Do not slide before the first button if (toolbarButtonsIndex > 0) { UpdateToolbarButtonsLocation(toolbarButtonsPanel, 1, SlideDirection.Previous); toolbarButtonsIndex--; } // If autosliding and at first button, wrap around to the last button else if (toolbarButtonsIndex == 0 && this.autoSlide == true) { UpdateToolbarButtonsLocation(toolbarButtonsPanel, toolbarButtons.Count - 1, SlideDirection.Next); toolbarButtonsIndex = toolbarButtons.Count - 1; } lastSlideDirection = SlideDirection.Previous; }
/// <summary> /// Slide the toolbar to the next button. /// </summary> public void SlideToolbarButtonsToNext() { // Do not slide after the last button if (toolbarButtonsIndex < toolbarButtons.Count - 1) { UpdateToolbarButtonsLocation(toolbarButtonsPanel, 1, SlideDirection.Next); toolbarButtonsIndex++; } // If autosliding and at last button, wrap around to first button else if (toolbarButtonsIndex == toolbarButtons.Count - 1 && this.autoSlide == true) { UpdateToolbarButtonsLocation(toolbarButtonsPanel, toolbarButtons.Count - 1, SlideDirection.Previous); toolbarButtonsIndex = 0; } lastSlideDirection = SlideDirection.Next; }
public static SlideDirection GetReversedSlideDirection(SlideDirection dir) { switch (dir) { default: case C_SlideShow.SlideDirection.Left: return(C_SlideShow.SlideDirection.Right); case C_SlideShow.SlideDirection.Top: return(C_SlideShow.SlideDirection.Bottom); case C_SlideShow.SlideDirection.Right: return(C_SlideShow.SlideDirection.Left); case C_SlideShow.SlideDirection.Bottom: return(C_SlideShow.SlideDirection.Top); } }
public CoverArtControlViewModel(IPlaybackService playbackService, ICacheService cacheService, IMetadataService metadataService) { this.playbackService = playbackService; this.cacheService = cacheService; this.metadataService = metadataService; this.playbackService.PlaybackSuccess += (_, e) => { this.SlideDirection = e.IsPlayingPreviousTrack ? SlideDirection.UpToDown : SlideDirection.DownToUp; this.RefreshCoverArtAsync(this.playbackService.CurrentTrack); }; this.playbackService.PlayingTrackChanged += (_, __) => this.RefreshCoverArtAsync(this.playbackService.CurrentTrack); // Defaults this.SlideDirection = SlideDirection.DownToUp; this.RefreshCoverArtAsync(this.playbackService.CurrentTrack); }
private void RefreshDisplay(SlideDirection slideDirection = SlideDirection.Creation) { switch (slideDirection) { case SlideDirection.Creation: Index = 0; Batches[Index].Generate(); Batches[Index].Visibility = Visibility.Visible; if (Batches.Length == 1) break; Batches[Index + 1].Generate(); Batches[Index + 1].Visibility = Visibility.Collapsed; break; case SlideDirection.Right: if (Index == Batches.Length - 1) break; if (Index != 0) Batches[Index - 1].Liberate(); Batches[Index].Visibility = Visibility.Collapsed; Batches[Index + 1].Visibility = Visibility.Visible; Index += 1; if (Index == Batches.Length - 1) break; Batches[Index + 1].Generate(); break; case SlideDirection.Left: if (Index == 0) break; if (Index != Batches.Length - 1) Batches[Index + 1].Liberate(); Batches[Index].Visibility = Visibility.Collapsed; Batches[Index - 1].Visibility = Visibility.Visible; Index -= 1; if (Index == 0) break; Batches[Index - 1].Generate(); break; default: throw new ArgumentOutOfRangeException(nameof(slideDirection), slideDirection, null); } }
protected ScreenOffset CalcScreenOffset(SlideDirection inDir) { SlideDirection dir = inDir; if (inDir == SlideDirection.random) { int idx = UnityEngine.Random.Range(0, 4); switch (idx) { case 0: dir = SlideDirection.bottom; break; case 1: dir = SlideDirection.left; break; case 2: dir = SlideDirection.top; break; case 3: dir = SlideDirection.right; break; } } switch (dir) { case SlideDirection.bottom: return(new ScreenOffset(Utils.OffsetCalcMode.Centered, Utils.OffsetCalcMode.ScreenBottom)); case SlideDirection.left: return(new ScreenOffset(Utils.OffsetCalcMode.ScreenLeft, Utils.OffsetCalcMode.Centered)); case SlideDirection.top: return(new ScreenOffset(Utils.OffsetCalcMode.Centered, Utils.OffsetCalcMode.ScreenTop)); case SlideDirection.right: return(new ScreenOffset(Utils.OffsetCalcMode.ScreenRight, Utils.OffsetCalcMode.Centered)); } return(new ScreenOffset(Utils.OffsetCalcMode.Centered, Utils.OffsetCalcMode.ScreenBottom)); }
void Update() { if (Block.State == BlockState.Sliding) { Elapsed += Time.deltaTime; if (Elapsed >= Duration) { Block.State = TargetState; Block.Type = TargetType; Direction = SlideDirection.None; if (Block.State == BlockState.Idle) { matchDetector.RequestMatchDetection(Block); } } } }
static Matrix <int> ConvertForMovement(Matrix <int> matrix, SlideDirection direction, bool isPreparation) { Matrix <int> convertedMatrix; switch (direction) { case SlideDirection.Right: { convertedMatrix = new Matrix <int>(matrix); break; } case SlideDirection.Left: { convertedMatrix = matrix.GetHorizontalInversed(); break; } case SlideDirection.Down: { convertedMatrix = matrix.GetTransposed(); break; } case SlideDirection.Up: { if (isPreparation) { convertedMatrix = matrix.GetTransposed().GetHorizontalInversed(); } else { convertedMatrix = matrix.GetHorizontalInversed().GetTransposed(); } break; } default: throw new ArgumentException(nameof(direction)); } return(convertedMatrix); }
private ImageFadeType GetSlideFadeType(Slide slide, Slide previousSlide, SlideDirection direction) { var thisSlideFadeInType = direction == SlideDirection.Forward ? slide.FadeInForward ? ImageFadeType.FadeIn : ImageFadeType.None : slide.FadeInReverse ? ImageFadeType.FadeIn : ImageFadeType.None; if (previousSlide == null) { // previous image (if any) is a regular image _not_ a slide var regularImageFadeType = _optionsService.ImageFadeType; switch (regularImageFadeType) { case ImageFadeType.CrossFade: case ImageFadeType.FadeInOut: case ImageFadeType.FadeOut: if (thisSlideFadeInType == ImageFadeType.FadeIn) { return(ImageFadeType.CrossFade); } return(thisSlideFadeInType); default: return(thisSlideFadeInType); } } var previousSlideFadeOutType = direction == SlideDirection.Forward ? previousSlide.FadeOutForward ? ImageFadeType.FadeOut : ImageFadeType.None : previousSlide.FadeOutReverse ? ImageFadeType.FadeOut : ImageFadeType.None; if (thisSlideFadeInType == ImageFadeType.FadeIn && previousSlideFadeOutType == ImageFadeType.FadeOut) { return(ImageFadeType.CrossFade); } if (previousSlideFadeOutType == ImageFadeType.FadeOut) { return(ImageFadeType.FadeOut); } return(thisSlideFadeInType); }
private void GotoState(ApplicationStates state) { ApplicationStates cur = App.CurrentState; if (state == ApplicationStates.Back) { if (App.PreviousState == ApplicationStates.Back) { return; } state = App.PreviousState; } if (state == App.CurrentState) { return; } FrameworkElement view = (FrameworkElement)IoC.Repository[state.ToString() + "View"]; if (view == null) { return; } //BaseViewModel vm = (BaseViewModel)IoC.Repository[state.ToString() + "ViewModel"]; //if (vm != null) // view.DataContext = vm; SlideDirection direction = SlideDirection.Left; var dir = App.SlideDirections.Where(s => s.Item1 == cur && s.Item2 == state).FirstOrDefault(); if (dir != null) { direction = dir.Item3; } slide.Slide(view, direction); App.PreviousState = App.CurrentState; App.CurrentState = state; }
public static Vector2 GetDirection(SlideDirection direction) { switch (direction) { case SlideDirection.LEFT: return(new Vector2(-1.0f, 0f)); case SlideDirection.RIGHT: return(new Vector2(1.0f, 0f)); case SlideDirection.TOP: return(new Vector2(0f, -1.0f)); case SlideDirection.BOTTOM: return(new Vector2(0f, 1.0f)); default: throw new Exception(); } }
void Update() { if (block.State == BlockState.Sliding) { Elapsed += Time.deltaTime; if (Elapsed >= slideDuration.Value) { block.State = targetState; block.Type = targetType; Elapsed = 0; Direction = SlideDirection.None; if (matchDetector != null) { matchDetector.RequestMatchDetection(block); } } } }
/// <summary> /// Returns thickness used in animation. Animations from directions start with this thickness /// and animations to directions end with this thickness /// </summary> /// <param name="offset"></param> /// <param name="direction"></param> /// <returns></returns> private static Thickness GetSlideThickness(double offset, SlideDirection direction) { switch (direction) { case SlideDirection.Left: return(new Thickness(-offset, 0, offset, 0)); case SlideDirection.Top: return(new Thickness(0, -offset, 0, offset)); case SlideDirection.Right: return(new Thickness(offset, 0, -offset, 0)); case SlideDirection.Bottom: return(new Thickness(0, offset, 0, -offset)); default: throw new ArgumentException("Invalid Slide Direction"); } }
private void SetNowPlaying() { if (this.playbackService.Queue.Count > 0) { if (this.IsShowcaseButtonChecked) { this.SlideDirection = SlideDirection.LeftToRight; this.regionManager.RequestNavigate(RegionNames.NowPlayingContentRegion, typeof(NowPlayingScreenShowcase).FullName); } else { this.SlideDirection = SlideDirection.RightToLeft; this.regionManager.RequestNavigate(RegionNames.NowPlayingContentRegion, typeof(NowPlayingScreenList).FullName); } } else { this.SlideDirection = SlideDirection.RightToLeft; this.regionManager.RequestNavigate(RegionNames.NowPlayingContentRegion, typeof(NothingPlayingControl).FullName); } }
public PlaybackInfoControlViewModel(IPlaybackService playbackService) { this.playbackService = playbackService; this.refreshTimer.Interval = this.refreshTimerIntervalMilliseconds; this.refreshTimer.Elapsed += RefreshTimer_Elapsed; this.playbackService.PlaybackSuccess += (_, e) => { this.SlideDirection = e.IsPlayingPreviousTrack ? SlideDirection.UpToDown : SlideDirection.DownToUp; this.refreshTimer.Stop(); this.refreshTimer.Start(); }; this.playbackService.PlaybackProgressChanged += (_, __) => this.UpdateTime(); this.playbackService.PlayingTrackPlaybackInfoChanged += (_, __) => this.RefreshPlaybackInfoAsync(this.playbackService.CurrentTrack.Value, true); // Defaults this.SlideDirection = SlideDirection.DownToUp; this.RefreshPlaybackInfoAsync(this.playbackService.CurrentTrack.Value, false); }
public RTSlider() { _title = "Slider"; _titleFont = new Font(FontFamily.GenericSansSerif, 8); _titleColor = Color.DimGray; _showTitle = true; _minVal = -1; _maxVal = 1; _logScale = false; _val = 0; _format = "F2"; _unit = ""; _valueColor = Color.DimGray; _valueFont = new Font(FontFamily.GenericSansSerif, 8); _showValue = true; _showScale = true; _scaleColor = Color.DimGray; _slideWidth = 5; _slideKnob = 20; _slideColor = Color.Silver; _slideMarkColor = Color.Red; _slideMarkFill = Color.DarkRed; _slideDirection = SlideDirection.Vertical; _slideScaleDist = 20; _slideScaleWidth = 10; _showScaleValues = true; _scaleFont = new Font(FontFamily.GenericSansSerif, 8); _lableLength = 3; _scaleValueColor = Color.DimGray; brushSlideMark = new SolidBrush(_slideMarkFill); penSlideMark = new Pen(_slideMarkColor); penSlide = new Pen(_slideColor); valueBrush = new SolidBrush(_valueColor); titleBrush = new SolidBrush(_titleColor); scaleFontBrush = new SolidBrush(_scaleValueColor); scalePen = new Pen(_scaleColor); this.DoubleBuffered = true; }
private void OnPrevious(object sender, RoutedEventArgs e) { if (_selIndex == MaxShapeCount) { return; } var shape = _rootShape.Shapes.ElementAt(_selIndex); shape.ImplicitAnimations = _slideRightImplicitAnimationCollection; shape.Offset = HideOffset; _selIndex++; _nextIndex = _selIndex; UpdateButtonState(); slideDirection = SlideDirection.RightToLeft; _startVal = 1; _endVal = -0.5f; _sw.Start(); }
public CoverArtControlViewModel(IPlaybackService playbackService, ICacheService cacheService, IMetadataService metadataService) { this.playbackService = playbackService; this.cacheService = cacheService; this.metadataService = metadataService; this.refreshTimer.Interval = this.refreshTimerIntervalMilliseconds; this.refreshTimer.Elapsed += RefreshTimer_Elapsed; this.playbackService.PlaybackSuccess += (_, e) => { this.SlideDirection = e.IsPlayingPreviousTrack ? SlideDirection.UpToDown : SlideDirection.DownToUp; this.refreshTimer.Stop(); this.refreshTimer.Start(); }; this.playbackService.PlayingTrackArtworkChanged += (_, __) => this.RefreshCoverArtAsync(this.playbackService.CurrentTrack); // Defaults this.SlideDirection = SlideDirection.DownToUp; this.RefreshCoverArtAsync(this.playbackService.CurrentTrack); }
private void SlideCompleted(UserControl newView, SlideDirection slideDirection) { ViewFrame.Navigate(newView); Manager.MainWindowViewModel.ViewFrameSource = newView; if (slideDirection == SlideDirection.None) { return; } Storyboard sb = new Storyboard(); switch (slideDirection) { case SlideDirection.Left: sb = (this.FindResource("slideScreenInFromRightAndShow") as Storyboard).Clone(); break; case SlideDirection.Right: sb = (this.FindResource("slideScreenInFromLeftAndShow") as Storyboard).Clone(); break; case SlideDirection.Up: sb = (this.FindResource("slideScreenInFromBelowAndShow") as Storyboard).Clone(); break; case SlideDirection.Down: sb = (this.FindResource("slideScreenInFromAboveAndShow") as Storyboard).Clone(); break; default: break; } Storyboard.SetTarget(sb, Viewer); sb.Begin(); }
/// <summary> /// Navigates the current view frame source to a different view control. /// </summary> /// <param name="newView">View control to navigate to.</param> /// <param name="slideDirection">Frame navigation transition slide direction.</param> public void NavigateToView(UserControl newView, SlideDirection slideDirection) { Storyboard sb; string resource = string.Empty; switch (slideDirection) { case SlideDirection.Left: resource = "slideScreenOutToLeftAndFade"; break; case SlideDirection.Right: resource = "slideScreenOutToRightAndFade"; break; case SlideDirection.Up: resource = "slideScreenOutToAboveAndFade"; break; case SlideDirection.Down: resource = "slideScreenOutToBelowAndFade"; break; } if (!string.IsNullOrEmpty(resource)) { sb = (this.FindResource(resource) as Storyboard).Clone(); Storyboard.SetTarget(sb, Viewer); sb.Completed += (sender, e) => { SlideCompleted(newView, slideDirection); }; sb.Begin(); return; } SlideCompleted(newView, SlideDirection.None); }
// Update is called once per frame void Update() { //if(Clock.Instance.State != Clock.ClockState.Game) { // return; //} if (block.State == BlockState.Sliding) { Elapsed += Time.deltaTime; if (Elapsed >= Duration) { block.State = TargetState; block.Type = TargetType; Direction = SlideDirection.None; if (block.State == BlockState.Idle) { matchDetector.RequestMatchDetection(block); } } } }
private Vector2 GetSlidePosition(SlideDirection direction) { float canvasSize = (direction == SlideDirection.Left || direction == SlideDirection.Right) ? m_Dialog.rectTransform.root.GetComponent <Canvas>().pixelRect.width : m_Dialog.rectTransform.root.GetComponent <Canvas>().pixelRect.height; float dialogSize = (direction == SlideDirection.Left || direction == SlideDirection.Right) ? LayoutUtility.GetPreferredWidth(m_Dialog.rectTransform) : LayoutUtility.GetPreferredHeight(m_Dialog.rectTransform); dialogSize *= 1.1f; switch (direction) { case SlideDirection.Bottom: return(new Vector2(0f, -(canvasSize + dialogSize))); case SlideDirection.Left: return(new Vector2(-(canvasSize + dialogSize), 0f)); case SlideDirection.Right: return(new Vector2(canvasSize + dialogSize, 0f)); case SlideDirection.Top: return(new Vector2(0f, canvasSize + dialogSize)); } return(Vector2.zero); }
public static DialogAnimatorSlide AddOrSetupDialogAnimatorSlide(MaterialDialogCompat materialDialog, float animationDuration, SlideDirection slideInDirection, SlideDirection slideOutDirection, Tween.TweenType slideInTweenType, Tween.TweenType slideOutTweenType) { var animator = GetOrAddTypedDialogAnimator <DialogAnimatorSlide>(materialDialog); if (animator != null) { animator.m_AnimationDuration = animationDuration; animator.m_SlideInDirection = slideInDirection; animator.m_SlideOutDirection = slideOutDirection; if (slideInTweenType == Tween.TweenType.Custom || slideOutTweenType == Tween.TweenType.Custom) { Debug.LogWarning("Cannot set tween type to 'Custom'"); } else { animator.m_SlideInTweenType = slideInTweenType; animator.m_SlideOutTweenType = slideOutTweenType; } } return(animator); }
public static DialogAnimatorSlide AddOrSetupDialogAnimatorSlide(MaterialDialogCompat materialDialog, float animationDuration, SlideDirection slideInDirection, SlideDirection slideOutDirection) { var animator = GetOrAddTypedDialogAnimator <DialogAnimatorSlide>(materialDialog); if (animator != null) { animator.m_AnimationDuration = animationDuration; animator.m_SlideInDirection = slideInDirection; animator.m_SlideOutDirection = slideOutDirection; } return(animator); }
private Vector2 GetSlidePosition(SlideDirection direction) { float canvasSize = (direction == SlideDirection.Left || direction == SlideDirection.Right) ? m_Dialog.rectTransform.root.GetComponent<Canvas>().pixelRect.width : m_Dialog.rectTransform.root.GetComponent<Canvas>().pixelRect.height; float dialogSize = (direction == SlideDirection.Left || direction == SlideDirection.Right) ? LayoutUtility.GetPreferredWidth(m_Dialog.rectTransform) : LayoutUtility.GetPreferredHeight(m_Dialog.rectTransform); dialogSize *= 1.1f; switch (direction) { case SlideDirection.Bottom: return new Vector2(0f, -(canvasSize + dialogSize)); case SlideDirection.Left: return new Vector2(-(canvasSize + dialogSize), 0f); case SlideDirection.Right: return new Vector2(canvasSize + dialogSize, 0f); case SlideDirection.Top: return new Vector2(0f, canvasSize + dialogSize); } return Vector2.zero; }
public static IDisposable ButtonGroup(this HtmlHelper htmlHelper, string dropDownButtonText = "Actions", SlideDirection direction = SlideDirection.Down) { var writer = htmlHelper.ViewContext.Writer; return new ButtonGroupContainer(writer, dropDownButtonText, direction); }
/// <summary> /// Slides the transition following the transition arrow /// to avoid colliding with the colliding rectangle /// </summary> /// <param name="center">The current center of the text box</param> /// <param name="colliding">The colliding rectangle</param> /// <returns></returns> public Point Slide(Point center, Rectangle colliding, SlideDirection direction) { Point retVal; double angle = Angle; if (direction == SlideDirection.Up) { retVal = new Point((int)(center.X + Math.Cos(angle) * DELTA), (int)(center.Y + Math.Sin(angle) * DELTA)); } else { retVal = new Point((int)(center.X - Math.Cos(angle) * DELTA), (int)(center.Y - Math.Sin(angle) * DELTA)); } return retVal; }
/// <summary> /// Provides derived classes an opportunity to handle changes /// to the ForwardDirection property. /// </summary> /// <param name="oldForwardDirection">The old ForwardDirection value</param> /// <param name="newForwardDirection">The new ForwardDirection value</param> protected virtual void OnForwardDirectionChanged( SlideDirection oldForwardDirection, SlideDirection newForwardDirection) { ((SlideAnimation)this.ForwardInAnimation).Direction = newForwardDirection; ((SlideAnimation)this.ForwardOutAnimation).Direction = newForwardDirection; }
void SlidePage(SlideDirection dir) { RectTransform curpage = null; switch (dir) { case SlideDirection.Up: curpage = FPage; FPage = DPage; DPage = BPage; BPage = UPage; UPage = curpage; break; case SlideDirection.Down: curpage = FPage; FPage = UPage; UPage = BPage; BPage = DPage; DPage = curpage; break; case SlideDirection.Left: curpage = FPage; FPage = RPage; RPage = BPage; BPage = LPage; LPage = curpage; break; case SlideDirection.Right: curpage = FPage; FPage = LPage; LPage = BPage; BPage = RPage; RPage = curpage; break; } SetPagePosition (); }
private static DoubleAnimationUsingKeyFrames CreateFrontElementSlideAnimation(SlideDirection direction, FrameworkElement elementToMove, Duration duration) { var animation = new DoubleAnimationUsingKeyFrames(); double offset = elementToMove.ActualWidth; animation.BeginTime = new TimeSpan(0); animation.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = new TimeSpan(0), Value = direction == SlideDirection.SlideLeftToRight ? -offset : 0 }); animation.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = new TimeSpan(duration.TimeSpan.Ticks), Value = direction == SlideDirection.SlideLeftToRight ? 0 : -offset }); Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(CompositeTransform.TranslateX)")); Storyboard.SetTarget(animation, elementToMove); return animation; }
public SlideEventArgs(SlideDirection direction) { Direction = direction; }
public DialogAnimatorSlide(float animationDuration, SlideDirection slideInDirection, SlideDirection slideOutDirection) { m_AnimationDuration = animationDuration; m_SlideInDirection = slideInDirection; m_SlideOutDirection = slideOutDirection; }
public DialogAnimatorSlide(float animationDuration, SlideDirection slideInDirection, SlideDirection slideOutDirection) { m_AnimationDuration = animationDuration; m_SlideInDirection = slideInDirection; m_SlideOutDirection = slideOutDirection; }
/// <summary> /// Initialize with direction /// </summary> /// <param name="dir">Direction</param> /// <param name="user_data">User data</param> public SlidingEventArgs(SlideDirection dir, object user_data) { _slide_direction = dir; _user_data = user_data; }
public DialogAnimatorSlide(float animationDuration, SlideDirection slideInDirection, SlideDirection slideOutDirection, Tween.TweenType slideInTweenType, Tween.TweenType slideOutTweenType) { m_AnimationDuration = animationDuration; m_SlideInDirection = slideInDirection; m_SlideOutDirection = slideOutDirection; if (slideInTweenType == Tween.TweenType.Custom || slideOutTweenType == Tween.TweenType.Custom) { Debug.LogWarning("Cannot set tween type to 'Custom'"); } else { m_SlideInTweenType = slideInTweenType; m_SlideOutTweenType = slideOutTweenType; } }
public SlideFinishedEventArgs(SlideDirection dir) { Direction = dir; }
public static Task Slide(this UIView view, SlideDirection slideDirection, double duration = DefaultAnimationDuration, UIViewAnimationOptions animationOptions = UIViewAnimationOptions.CurveLinear) { System.Diagnostics.Debug.WriteLine("Slide Direction: {0}", slideDirection); CGAffineTransform startingTransform, endingTransform; switch (slideDirection) { case SlideDirection.FromBottom: startingTransform = CGAffineTransform.MakeTranslation(0f, view.Bounds.Height); endingTransform = CGAffineTransform.MakeIdentity(); break; case SlideDirection.FromLeft: startingTransform = CGAffineTransform.MakeTranslation(-view.Bounds.Width, 0f); endingTransform = CGAffineTransform.MakeIdentity(); break; case SlideDirection.FromRight: startingTransform = CGAffineTransform.MakeTranslation(view.Bounds.Width, 0f); endingTransform = CGAffineTransform.MakeIdentity(); break; case SlideDirection.FromTop: startingTransform = CGAffineTransform.MakeTranslation(0f, -view.Bounds.Height); endingTransform = CGAffineTransform.MakeIdentity(); break; case SlideDirection.ToBottom: startingTransform = CGAffineTransform.MakeIdentity(); endingTransform = CGAffineTransform.MakeTranslation(0f, view.Bounds.Height); break; case SlideDirection.ToLeft: startingTransform = CGAffineTransform.MakeIdentity(); endingTransform = CGAffineTransform.MakeTranslation(-view.Bounds.Width, 0f); break; case SlideDirection.ToRight: startingTransform = CGAffineTransform.MakeIdentity(); endingTransform = CGAffineTransform.MakeTranslation(view.Bounds.Width, 0f); break; case SlideDirection.ToTop: startingTransform = CGAffineTransform.MakeIdentity(); endingTransform = CGAffineTransform.MakeTranslation(0f, -view.Bounds.Height); break; default: startingTransform = CGAffineTransform.MakeIdentity(); endingTransform = CGAffineTransform.MakeIdentity(); break; } view.Transform = startingTransform; var animationCompleted = new TaskCompletionSource <object> (); UIView.Animate(duration, 0, animationOptions, () => { if (animationCompleted.Task.IsCanceled) { return; } view.Transform = endingTransform; }, () => animationCompleted.TrySetResult(null) ); return(animationCompleted.Task); }
/// <summary> /// Initialize with direction /// </summary> /// <param name="dir">Direction</param> /// <param name="user_data">User data</param> public SlidingEventArgs(SlideDirection dir, object user_data) { _slide_direction = dir; _user_data = user_data; }
public OobeViewModel(IDialogService dialogService, IEventAggregator eventAggregator) { this.dialogService = dialogService; this.eventAggregator = eventAggregator; this.dialogService.DialogVisibleChanged += (isDialogVisible) => { this.IsOverlayVisible = isDialogVisible; }; this.eventAggregator.GetEvent <ChangeOobeSlideDirectionEvent>().Subscribe((slideDirection) => { this.SlideDirection = slideDirection; }); // Initial slide direction this.SlideDirection = SlideDirection.RightToLeft; }
public void SlideIn(SlideDirection pDirection) { Position = Offset; if( SourceObject != null ) { Position += SourceObject.Position; } Vector2 Destination; switch(pDirection){ case(SlideDirection.LEFT): Destination = new Vector2(Position.X - Width, Position.Y); break; case(SlideDirection.RIGHT): Position += new Vector2(-Width, 0.0f); Destination = new Vector2(Position.X + Width, Position.Y); break; case(SlideDirection.UP): Position += new Vector2(0.0f, -Height); Destination = new Vector2(Position.X, Position.Y + Height); break; case(SlideDirection.DOWN): default: Destination = new Vector2(Position.X, Position.Y - Height); break; } Sequence baseSequence = new Sequence(); baseSequence.Add( new CallFunc( () => { Visible = true; EventHandler handler = OnSlideInStart; if ( handler != null ) { handler( this, null ); } } ) ); baseSequence.Add( new MoveTo( Destination, MoveDuration) ); baseSequence.Add( new CallFunc( () => { EventHandler handler = OnSlideInComplete; if ( handler != null ) { handler( this, null ); } } ) ); this.RunAction( baseSequence ); if (DismissDelay > 0.0f) { Sequence sequence = new Sequence(); sequence.Add( new DelayTime(DismissDelay) ); sequence.Add( new CallFunc( () => {AllowDismiss (); } ) ); this.RunAction(sequence); } if (Lifetime > 0.0f) { Sequence sequence = new Sequence(); sequence.Add( new DelayTime(1.0f + Lifetime) ); sequence.Add( new CallFunc( () => {SlideOut(); } ) ); this.RunAction(sequence); } }
public DialogAnimatorSlide(float animationDuration, SlideDirection slideInDirection, SlideDirection slideOutDirection, Tween.TweenType slideInTweenType, Tween.TweenType slideOutTweenType) { m_AnimationDuration = animationDuration; m_SlideInDirection = slideInDirection; m_SlideOutDirection = slideOutDirection; if (slideInTweenType == Tween.TweenType.Custom || slideOutTweenType == Tween.TweenType.Custom) { Debug.LogWarning("Cannot set tween type to 'Custom'"); } else { m_SlideInTweenType = slideInTweenType; m_SlideOutTweenType = slideOutTweenType; } }
public void SlideOut(SlideDirection pDirection) { InputManager.Instance.TapDetected -= HandleInputManagerInstanceTapDetected; InputManager.Instance.DragDetected -= HandleInputManagerInstanceDragDetected; Vector2 Destination; Destination = Offset; if (SourceObject != null) { Destination += SourceObject.Position; } switch(pDirection){ case(SlideDirection.LEFT): Destination += new Vector2(-Width, 0.0f); break; case(SlideDirection.DOWN): Destination += new Vector2(0.0f, -Height); break; default: break; } Sequence sequence = new Sequence(); sequence.Add( new CallFunc( () => { EventHandler handler = OnSlideOutStart; if ( handler != null ) { handler( this, null ); } } ) ); sequence.Add( new MoveTo( Destination, MoveDuration) ); sequence.Add( new CallFunc( () => { // Visible=false; EventHandler handler = OnSlideOutComplete; if ( handler != null ) { handler( this, null ); } } ) ); this.RunAction(sequence); }
/// <summary> /// Initializes a new instance of the <see cref="SlideTransition"/> class. /// </summary> /// <param name="direction">The direction.</param> public SlideTransition(SlideDirection direction) { SlideDirection = direction; Duration = new Duration(TimeSpan.FromSeconds(0.3)); }
public EffectsBuilder SlideIn(SlideDirection direction) { return Add(EffectsList.SlideIn, direction.ToString().ToLower()); }
public void SelectNextFile(SlideDirection direction) { if (SelectedItems.Count == 0) { return; } var item = SelectedItems[0]; fileListView.SelectedIndices.Clear(); var index = item.Index; if (direction == SlideDirection.Front) { index++; if (index == fileListView.Items.Count - 1) { index = 0; } } else { index--; if (index == 0) { index = fileListView.Items.Count - 1; } } fileListView.SelectedIndices.Add(index); }
/// <summary> /// Provides derived classes an opportunity to handle changes /// to the BackwardDirection property. /// </summary> /// <param name="oldBackwardDirection">The old BackwardDirection value</param> /// <param name="newBackwardDirection">The new BackwardDirection value</param> protected virtual void OnBackwardDirectionChanged( SlideDirection oldBackwardDirection, SlideDirection newBackwardDirection) { ((SlideAnimation)this.BackwardInAnimation).Direction = newBackwardDirection; ((SlideAnimation)this.BackwardOutAnimation).Direction = newBackwardDirection; }