/// <summary>
 /// Back button was clicked - send event to presenter.
 /// </summary>
 private void OnBackButtonClick(object sender, EventArgs e)
 {
     if (BackButtonClicked != null)
     {
         EventArgs args = new EventArgs();
         BackButtonClicked.Invoke(this, args);
     }
 }
    public void OnBackButtonClicked()
    {
        if (BackButtonClicked == null)
        {
            GUIController.Instance.LoadSceneWithTransition(GUIController.SceneNames.MainMenu);
        }
        else
        {
            BackButtonClicked.Invoke();
        }

        BackButtonText.text = defaultText;
    }
        public ExtendedHeaderBox(string title, string subtitle = null, Image image = null)
        {
            var headerBox = new HBox();

            headerBox.Spacing = 0;

            headerTitle = new Label();
            var font = headerTitle.Font;

            headerTitle.Font = font.WithSize(16);

            headerSeparator = new Label(" – ")
            {
                TextColor = Styles.SecondaryTextColor,
                Font      = font.WithSize(14),
            };
            headerSeparator.Accessible.IsAccessible = false;

            headerSubtitle = new Label {
                TextColor = Styles.SecondaryTextColor,
                Font      = font.WithSize(14),
            };

            backButton             = new Button();
            backButton.Style       = ButtonStyle.Flat;
            backButton.MarginRight = 6;
            backButton.Visible     = false;
            backButton.Clicked    += (sender, e) => BackButtonClicked?.Invoke(this, EventArgs.Empty);


            headerBox.PackStart(backButton);
            headerBox.PackStart(headerTitle);
            headerBox.PackStart(headerSeparator);
            headerBox.PackStart(headerSubtitle);

            frame = new FrameBox {
                Content = headerBox,
            };

            Title    = title;
            Image    = image;
            Subtitle = subtitle;

            BackgroundColor   = Styles.BaseBackgroundColor;
            BorderColor       = Styles.ThinSplitterColor;
            Padding           = 15;
            BorderWidthBottom = 1;

            Content = frame;
        }
        public void NavigationService_BackRequested(object sender, BackRequestedEventArgs e)
        {
            e.Handled = true;

            BackClickEventArgs backClickEventArgs = new BackClickEventArgs();

            BackButtonClicked?.Invoke(sender, backClickEventArgs);

            if (GoBack())
            {
            }
            else
            {
                Application.Current.Exit();
            }
        }
        public TopBar()
        {
            // Get the layout
            AddToClassList(UssClassName);
            AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(k_LayoutPath).CloneTree(this);
            styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(k_StylePath));

            // Initialise fields
            m_Icon          = this.Q <VisualElement>(className: IconUssClassName);
            m_BranchInfo    = this.Q <TextElement>(className: BranchInfoUssClassName);
            m_OverflowMenu  = this.Q <IconButton>(className: OverflowMenuUssClassName);
            m_BackContainer = this.Q <VisualElement>(className: BackUssClassName);
            m_BackButton    = this.Q <IconButton>(className: BackButtonUssClassName);
            m_BackText      = this.Q <TextElement>(className: BackTextUssClassName);

            m_OverflowMenu.Clicked += ClickableOnClicked;
            m_BackButton.Clicked   += () => BackButtonClicked?.Invoke();

            HideBackNavigation();
        }
Beispiel #6
0
 private void BackButton_Click(object sender, RoutedEventArgs e) => BackButtonClicked?.Invoke();
 /// <summary>
 /// The click function for the back button.
 /// Goes back to the search tab.
 /// </summary>
 /// <param name="sender">The object sender</param>
 /// <param name="e">The event args</param>
 private void backButton_Click(object sender, EventArgs e)
 {
     this.Parent.Controls.Find("userSearchTab", false)[0].Show();
     BackButtonClicked?.Invoke();
     this.Dispose();
 }
Beispiel #8
0
 private void OnBackButtonClicked()
 {
     BackButtonClicked?.Invoke();
 }
Beispiel #9
0
 protected internal virtual void OnBackButtonClicked(CancelEventArgs e)
 {
     BackButtonClicked?.Invoke(this, e);
 }
 private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
 {
     // await Navigation.PopAsync();
     BackButtonClicked?.Invoke(null, null);
 }
Beispiel #11
0
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     BackButtonClicked?.Invoke(this, new EventArgs());
 }
 private void btnBack_Click(object sender, RoutedEventArgs e)
 {
     BackButtonClicked?.Invoke(sender, e);
 }