public LoadingPopup() : base() { ActivityIndicator indicator = new ActivityIndicator(); indicator.HorizontalOptions = LayoutOptions.FillAndExpand; indicator.VerticalOptions = LayoutOptions.FillAndExpand; indicator.Color = (Color)Application.Current.Resources[INDICATOR_COLOR]; indicator.IsRunning = true; StackLayout layout = new StackLayout(); layout.Children.Add(indicator); ContentWrapper = layout; ClickableFrame innerFrame = new ClickableFrame(); innerFrame.Style = (Style)Application.Current.Resources[INNER_FRAME_CLASS]; innerFrame.Content = layout; InnerFrame = innerFrame; ClickableFrame outerFrame = new ClickableFrame(); outerFrame.Style = (Style)Application.Current.Resources[OUTER_FRAME_CLASS]; outerFrame.Content = innerFrame; OuterFrame = outerFrame; UpdateSize(); base.Style = (Style)Application.Current.Resources[POPUP_BACKGROUND_CLASS]; BackgroundColor = (Color)Application.Current.Resources[POPUP_BACKGROUND_COLOR]; IsVisible = false; Closable = false; Content = outerFrame; OnPopupBodyClicked = (e, sender) => true; }
protected void UpdateEvents() { try { Inputs.Clear(); this.OnClick += OnPopupWrapperClicked; ClickableFrame OuterFrame = this.Content as ClickableFrame; OuterFrame.OnClick += OnPopupBodyClicked; ClickableFrame InnerFrame = OuterFrame.Content as ClickableFrame; StackLayout ContentWrapper = InnerFrame.Content as StackLayout; foreach (View input in ContentWrapper.Children) { if (typeof(InputView).IsInstanceOfType(input)) { Inputs.Add(input as InputView); input.Focused += (object sender, FocusEventArgs e) => TotalFocuses++; input.Unfocused += (object sender, FocusEventArgs e) => TotalFocuses--; } } } catch { throw new IllegalPoupStructureException(); } }
public PhotoPopup() : base() { Img image = new Img(); image.HorizontalOptions = LayoutOptions.FillAndExpand; image.VerticalOptions = LayoutOptions.CenterAndExpand; image.ClickedBorderWidth = 0; image.BorderAlways = false; image.Margin = 0; Image = image; StackLayout layout = new StackLayout(); layout.Children.Add(image); ContentWrapper = layout; ClickableFrame innerFrame = new ClickableFrame(); innerFrame.Style = (Style)Application.Current.Resources[INNER_FRAME_CLASS]; innerFrame.HorizontalOptions = LayoutOptions.FillAndExpand; innerFrame.VerticalOptions = LayoutOptions.FillAndExpand; innerFrame.Padding = 0; innerFrame.Content = layout; InnerFrame = innerFrame; ClickableFrame outerFrame = new ClickableFrame(); outerFrame.Style = (Style)Application.Current.Resources[OUTER_FRAME_CLASS]; outerFrame.HorizontalOptions = LayoutOptions.FillAndExpand; outerFrame.VerticalOptions = LayoutOptions.FillAndExpand; outerFrame.Padding = 0; outerFrame.Content = innerFrame; OuterFrame = outerFrame; UpdatePhotoSource(); base.Style = (Style)Application.Current.Resources[POPUP_BACKGROUND_CLASS]; BackgroundColor = (Color)Application.Current.Resources[POPUP_BACKGROUND_COLOR]; IsVisible = false; Closable = true; Content = outerFrame; OnPopupBodyClicked = (e, sender) => true; }
public SimpleMessagePopup() : base() { StackLayout layout = new StackLayout(); ContentWrapper = layout; Label messageLabel = new Label(); messageLabel.Style = (Style)Application.Current.Resources[POPUP_LABEL_CLASS]; messageLabel.HorizontalOptions = LayoutOptions.CenterAndExpand; messageLabel.VerticalOptions = LayoutOptions.FillAndExpand; messageLabel.HorizontalTextAlignment = TextAlignment.Center; messageLabel.VerticalTextAlignment = TextAlignment.Center; MessageLabel = messageLabel; layout.Children.Add(MessageLabel); UpdateMessageText(); UpdateButtons(); ClickableFrame innerFrame = new ClickableFrame(); innerFrame.Style = (Style)Application.Current.Resources[INNER_FRAME_CLASS]; innerFrame.BackgroundColor = (Color)Application.Current.Resources[INNER_FRAME_COLOR]; innerFrame.Content = ContentWrapper; InnerFrame = innerFrame; ClickableFrame outerFrame = new ClickableFrame(); outerFrame.Style = (Style)Application.Current.Resources[OUTER_FRAME_CLASS]; outerFrame.Content = innerFrame; OuterFrame = outerFrame; UpdatePopupShape(); base.Style = (Style)Application.Current.Resources[POPUP_BACKGROUND_CLASS]; BackgroundColor = (Color)Application.Current.Resources[POPUP_BACKGROUND_COLOR]; IsVisible = false; Closable = true; Content = outerFrame; OnPopupBodyClicked = (e, sender) => true; }