public virtual void Dispose() { TaskCompletionSource.TrySetResult(null); View.RemoveFromSuperview(); #if XAMARIN_FORMS View.Dispose(); #else View.ClearBindingsRecursively(true, true); View.DisposeEx(); #endif TouchToolkitExtensions.RemoveOrientationChangeListener(this); ServiceProvider.AttachedValueProvider.Clear(this); _label = null; }
public virtual void Show() { if (View != null) { return; } View = CreateToastView(); View.Center = GetCenterPoint(View); View.Alpha = 0f; View.Layer.ZPosition = float.MaxValue; TouchToolkitExtensions.AddOrientationChangeListener(this); if (Owner is UIWindow && !TouchToolkitExtensions.IsOS8) { UpdateWindowOrientation(View); } Owner.AddSubview(View); Owner.BringSubviewToFront(View); UIView.Animate(AnimationDuration, 0.0, UIViewAnimationOptions.CurveEaseOut, () => View.Alpha = 1f, ShowCompleted); }