private void SetupFromBase(LayoutConstructorBase constructor) { ConstructorBase = constructor; ConstructorBase.SetupButtonImageSources(); this.ConstructorBase.Button1Tap.Tapped += Button1_Pressed; this.ConstructorBase.Button2Tap.Tapped += Button2_Pressed; this.ConstructorBase.Button3Tap.Tapped += Button3_Pressed; this.ConstructorBase.Button4Tap.Tapped += Button4_Pressed; this.Button1.GestureRecognizers.Add(ConstructorBase.Button1Tap); this.Button2.GestureRecognizers.Add(ConstructorBase.Button2Tap); this.Button3.GestureRecognizers.Add(ConstructorBase.Button3Tap); this.Button4.GestureRecognizers.Add(ConstructorBase.Button4Tap); if (constructor.IsCoolStuffPage) { this.Button2.IsVisible = false; this.Button3.IsVisible = false; this.Button4.IsVisible = false; this.ViewContent = constructor.CoolStuffPage; } else { this.ViewContent = ConstructorBase.ContentsPage; SetButtonColours(this.Button2); // Button2 is Contents View } OnPropertyChanged(nameof(this.ViewContent)); }
public MainTopicLayout(LayoutConstructorBase constructor) { this.ThemeColour = constructor.ButtonsColour; this.BindingContext = this; InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); this.ThemeIcon = constructor.Icon; this.ThemeIcon = constructor.Icon; this.ThemeIcon.Margin = 5; this.ThemeIcon.Scale = 0; this.ThemeIcon.Opacity = 0; AbsoluteLayout.SetLayoutBounds(ThemeIcon, new Rectangle(0, 0, 50, 50)); ContentAbsoluteLayout.Children.Add(ThemeIcon); SetupFromBase(constructor); SetButtonSizes(); }