void OnLoadHomePage(FigmaSharp.Models.FigmaNode node) { BackgroundColor = Xamarin.Forms.Color.White; RenderViewWithConverters(node); var navigationMenuButton = RendererService.FindViewByName <IButton>("HomeNavigationMenuButton"); navigationMenuButton.Clicked += (s, e) => { if (s is IViewTransitable figmaTransition) { ProcessTransitionNodeID(figmaTransition.TransitionNodeID); } }; var planVisitButton = RendererService.FindViewByName <IButton>("PlanVisitCustomButton"); planVisitButton.Clicked += (s, e) => { if (s is IViewTransitable figmaTransition) { ProcessTransitionNodeID(figmaTransition.TransitionNodeID); } }; }
void OnLoadLoginPage(FigmaSharp.Models.FigmaNode node) { //Background color SetValue(NavigationPage.BarBackgroundColorProperty, Xamarin.Forms.Color.Black); //Title color SetValue(NavigationPage.BarTextColorProperty, Xamarin.Forms.Color.White); BackgroundColor = Xamarin.Forms.Color.Black; //we add some temporal converters process all the textfields into real views RenderViewWithConverters(node, new LoginTextFieldConverter()); //adds some logic to the current rendered views var loginButton = RendererService.FindViewByName <IButton>("LoginCustomButton"); #region Logic code if (loginButton == null) { return; } loginButton.Clicked += (s, e) => { var emailTextField = FindNativeViewByName <Entry>("EmailTextField"); var passwordTextField = FindNativeViewByName <Entry>("PasswordTextField"); if (emailTextField.Text == "1234" && passwordTextField.Text == "1234") { if (s is IViewTransitable figmaTransition) { ProcessTransitionNodeID(figmaTransition.TransitionNodeID); } } else { DisplayAlert("Credentials error", "You have entered a wrong user or password", "OK"); } }; #endregion }