Esempio n. 1
0
 /// <summary>
 /// Hunts through the parents to find the current Context.
 /// </summary>
 /// <param name="view"></param>
 /// <returns></returns>
 public static IMauiContext GetMauiContext(this View view)
 {
     //IF there is only one app, with one window, then there is only one context.
     //Don't go hunting!
     if (CometApp.CurrentApp.Windows.Count == 1)
     {
         return(CometApp.MauiContext);
     }
     return(view.FindParentOfType <IMauiContextHolder>()?.MauiContext ?? CometApp.MauiContext);
 }
Esempio n. 2
0
        public static void SetResult <T>(this View view, T value)
        {
            var resultView = view.FindParentOfType <ResultView <T> >();

            resultView.SetResult(value);
        }
Esempio n. 3
0
        public static void SetResultException <T>(this View view, Exception ex)
        {
            var resultView = view.FindParentOfType <ResultView <T> >();

            resultView.SetException(ex);
        }
Esempio n. 4
0
        public static void SetResultCanceled <T>(this View view)
        {
            var resultView = view.FindParentOfType <ResultView <T> >();

            resultView.Cancel();
        }