Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

We are facing an issue while using PopupLayout in Xamarin forms iOS.

$
0
0

Hi,

We are facing an issue while using PopupLayout in Xamarin forms iOS.

After adding the popupLayout as content to the Parent Layout i am unable to fire the click event for the button.

Can anybody please help me out.

public partial class Page1 : ContentPage
{
public Button btn1 = new Button();

    public Page1()
    {
        InitializeComponent();
        btn1.Text = "Click Me";

        _StackLayout.Children.Add(btn1);

      //  Alert.alertPopUpLayout.Content = _StackLayout;

      //  Content = Alert.alertPopUpLayout;



        btn1.Clicked += btn1_Clicked;
       this.OpenButton.Clicked += OpenButtonClicked;
       this.OpenButton1.Clicked += OpenButton1_Clicked;
    }

    void btn1_Clicked(object sender, EventArgs e)
    {
        try
        {
            string str = string.Empty;
            str = "fddd";
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }

    void OpenButton1_Clicked(object sender, EventArgs e)
    {
        try
        {
            string str = string.Empty;
            str = "fddd";
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }

    void OpenButtonClicked(object sender, EventArgs e)
    {
        //var popupLayout = this.Content as PopupLayout;

        StackLayout _objStackLayout = Alert.AlertDialog(2, _StackLayout, "123", "sdfgewrgfewfwe");
        Alert.alertPopUpLayout.ShowPopup(_objStackLayout);
            //cmn.AlertDialog("General Client Error", "Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107 + cb93e16 + f50fe49 + d7c18e6 + 5b9a565 + 0f3a25d + 607156e + 75511aa + e4d16c0 + 686f3eb + 211a271 + dd281ee +  NOTHING _LA.BF.1.1.04.04.02.162.107 + cb93e16 + f50fe49 + d7c18e6", 4, _StackLayout);
        Button btn = Alert.btnPositive;
        btn.Clicked += btnPositive;
        //popupLayout.ShowPopup (_objStackLayout);

        Button btnCancel = Alert.btnCancel;
        btnCancel.Clicked += btnCancel_Clicked;
    }

    void btnCancel_Clicked(object sender, EventArgs e)
    {
        if (Alert.alertPopUpLayout.IsPopupActive)
        {
            Alert.alertPopUpLayout.DismissPopup();             
        }
        else
        {

        }

        Alert.EnableParentControls(_StackLayout);
    }


    public void btnPositive(object sender, EventArgs e)
    {
        if (Alert.alertPopUpLayout.IsPopupActive)
        {
            Alert.alertPopUpLayout.DismissPopup();
            //StackLayout stk = (StackLayout)_StackLayout;

            //foreach (var item in stk.Children)
            //{
            //    item.IsEnabled = false;
            //}

//_StackLayout.IsVisible = true;

        }
        else
        {

            //StackLayout stk = (StackLayout)_StackLayout;

            //foreach (var item in stk.Children)
            //{
            //    item.IsEnabled = true;
            //}
            //_StackLayout.IsVisible = true;
        }

        Alert.EnableParentControls(_StackLayout);

    }

}

Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>