/// <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); }
public static void SetResult <T>(this View view, T value) { var resultView = view.FindParentOfType <ResultView <T> >(); resultView.SetResult(value); }
public static void SetResultException <T>(this View view, Exception ex) { var resultView = view.FindParentOfType <ResultView <T> >(); resultView.SetException(ex); }
public static void SetResultCanceled <T>(this View view) { var resultView = view.FindParentOfType <ResultView <T> >(); resultView.Cancel(); }