public static void AddOnGlobalLayoutAction(this ViewTreeObserver observer, Action callback)
		{
			GlobalLayoutSingleFireListener listener = null;
			listener = new GlobalLayoutSingleFireListener(() =>
			{
				if (observer.IsAlive)
				{
					callback();
				}
			});
			observer.AddOnGlobalLayoutListener(listener);
		}
Example #2
0
        public static void AddOnGlobalLayoutAction(this ViewTreeObserver observer, Action callback)
        {
            GlobalLayoutSingleFireListener listener = null;

            listener = new GlobalLayoutSingleFireListener(() =>
            {
                if (observer.IsAlive)
                {
                    callback();
                }
            });
            observer.AddOnGlobalLayoutListener(listener);
        }