static async Task <Element> FindDataSourceParentAsync(Element element) { while (!Application.IsApplicationOrNull(element)) { if (element is IDataSourceProvider) { return(element); } element = await TemplateUtilities.GetRealParentAsync(element); } return(null); }
public void GetRealParentAsync() { tlog.Debug(tag, $"GetRealParentAsync START"); try { var view = new BaseHandle(); var testingTarget = TemplateUtilities.GetRealParentAsync(view); Assert.IsNotNull(testingTarget, "Should not be null"); var parent = new BaseHandle(); view.Parent = parent; var testingTarget2 = TemplateUtilities.GetRealParentAsync(view); Assert.IsNotNull(testingTarget, "Should not be null"); } catch (Exception e) { Assert.Fail("Catch exception" + e.Message.ToString()); } tlog.Debug(tag, $"GetRealParentAsync END"); }