private static RootElement CreateRootElement() { var root = new RootElement("Pulsing Halo"); UIImageView imgView = new UIImageView(new RectangleF(0, 0, 320, 320)); imgView.ContentMode = UIViewContentMode.Center; imgView.Image = UIImage.FromBundle("iPhone.png").Scale(new SizeF(76, 160)); var viewShaker = new ViewShaker(imgView); var animationSection = new Section() { new UIViewElement(String.Empty, imgView, true) }; root.Add(animationSection); var configurationSection = new Section() { new StringElement("Shake", viewShaker.Shake) }; root.Add(configurationSection); return(root); }
public override void ViewDidLoad() { base.ViewDidLoad(); var viewShaker = new ViewShaker(this.viewToShake); viewShaker.AnimationCompleted += this.OnAnimationCompleted; btnShake.TouchUpInside += (sender, e) => { viewShaker.Shake(); }; }