public MainPage() { InitializeComponent(); PopupControl = new PopupControlSystem(OnBackButtonPressed); SignUpPopup.OnPopupBodyClicked += Constants.CLICK_IGNORE; LogInPopup.OnPopupBodyClicked += Constants.CLICK_IGNORE; ErrorPopup.OnFirstButtonClicked = AuthErrorClose_Clicked; SignUpValidator = new SignUpValidator(SignUpLoginEntry, SignUpPasswordEntry, SignUpPasswordConfirmEntry, SignUpEmailEntry, Constants.VALID_HANDLER, Constants.INVALID_HANDLER); LogInValidator = new LogInValidator(LogInLoginEntry, LogInPasswordEntry, Constants.VALID_HANDLER, Constants.INVALID_HANDLER); }
public CurrentUserProfilePage(User user) { CurrentUser = user; InitializeComponent(); PopupControl = new PopupControlSystem(OnBackButtonPressed); PopupCollection = new SwipablePopupCollection(PopupControl); EditProfileValidator = new EditProfileValidator(FirstNameEntry, LastNameEntry, PhoneEntry, Constants.VALID_HANDLER, Constants.INVALID_HANDLER); PopupCollection.Add(AvatarView); PopupCollection.Add(n1); PopupCollection.Add(n2); }
public void OpenClosePopupTest() { PopupControlSystem popupControlSystem = new PopupControlSystem(() => false); Popup P1 = new Popup(); P1.Closable = true; Popup P2 = new Popup(); P2.Closable = false; Popup P3 = new Popup(); P3.Closable = true; popupControlSystem.OpenPopup(P1); popupControlSystem.OpenPopup(P2); popupControlSystem.OpenPopup(P3); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 3); popupControlSystem.CloseTopPopupAndHideKeyboardIfNeeded(); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 2); popupControlSystem.CloseTopPopupAndHideKeyboardIfNeeded(); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 2); popupControlSystem.CloseTopPopupAndHideKeyboardIfNeeded(true); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 1); popupControlSystem.CloseTopPopupAndHideKeyboardIfNeeded(); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 0); popupControlSystem.CloseTopPopupAndHideKeyboardIfNeeded(); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 0); popupControlSystem.CloseTopPopupAndHideKeyboardIfNeeded(true); Assert.IsTrue(popupControlSystem.OpenedPopupsCount == 0); }
public SwipablePopupCollection(PopupControlSystem popupControl) => this.PopupControl = popupControl;