public App() { InitializeComponent(); DependencyService.Register <MockDataStore>(); MainPage = new MyContentPage(); }
public void ContentPageConstructor() { tlog.Debug(tag, $"ContentPageConstructor START"); var testingTarget = new MyContentPage(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <ContentPage>(testingTarget, "Should return ContentPage instance."); AppBar bar = new AppBar() { Title = "AppBar", }; testingTarget.AppBar = bar; tlog.Debug(tag, "AppBar : " + testingTarget.AppBar); testingTarget.AppBar = bar; AppBar bar2 = new AppBar() { Title = "AppBar2", }; testingTarget.AppBar = bar2; tlog.Debug(tag, "AppBar : " + testingTarget.AppBar); View content = new View() { Size = new Size(100, 200), BackgroundColor = Color.Cyan, }; testingTarget.Content = content; tlog.Debug(tag, "Content : " + testingTarget.Content); testingTarget.Content = content; View content2 = new View() { Size = new Size(100, 200), BackgroundColor = Color.Green, }; testingTarget.Content = content2; tlog.Debug(tag, "Content : " + testingTarget.Content); testingTarget.OnDispose(DisposeTypes.Explicit); tlog.Debug(tag, $"ContentPageConstructor END (OK)"); }
public async Task ContentPageOnRelayout() { tlog.Debug(tag, $"ContentPageOnRelayout START"); var testingTarget = new MyContentPage() { Size = new Size(100, 200), BackgroundColor = Color.Cyan, }; Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <ContentPage>(testingTarget, "Should return ContentPage instance."); AppBar bar = new AppBar() { Title = "AppBar", Size = new Size(100, 20) }; testingTarget.AppBar = bar; tlog.Debug(tag, "AppBar : " + testingTarget.AppBar); testingTarget.AppBar = bar; testingTarget.AppBar.WidthSpecification = LayoutParamPolicies.MatchParent; testingTarget.AppBar.HeightSpecification = LayoutParamPolicies.MatchParent; View content = new View() { Size = new Size(100, 180) }; testingTarget.Content = content; testingTarget.Content.WidthSpecification = LayoutParamPolicies.MatchParent; testingTarget.Content.HeightSpecification = LayoutParamPolicies.MatchParent; testingTarget.Size = new Size(200, 400); await Task.Delay(200); testingTarget.OnDispose(DisposeTypes.Explicit); tlog.Debug(tag, $"ContentPageOnRelayout END (OK)"); }