How to display alert dialog at desired location and return result?

codemaster007codemaster007 USMember ✭✭
edited April 2016 in Xamarin.Android

I have a keyboard modal window which is 9*9. And used it fill Sudoku game board. In android studio , to get the location of the button I used the following code


        int tag=(int)_selectedButton.getTag();
int[] location=new int[2];
        _p=new Point();


ShowKeyBoard is like this

int offsetX=30;
int offsetY=30;
_popupWindow.showAtLocation(_keyBoardLayout, Gravity.NO_GRAVITY, _p.x+offsetX, _p.y+offsetY);
After that he selects a key and I dismiss the popup window.

public void BtnKey1Pressed(View view)

In Xamarin what I did until now is

protected void InitKeyBoard()
 //Init KeyBoard
            _keyBoard = new AlertDialog.Builder(this);
            _keyBoard.SetView(LayoutInflater.Inflate(Resource.Layout.keyboard, null));

private void BtnGrdMatrix_Click(object sender,EventArgs es)


How can I do that in Xamarin Android.? Is it possible to get return data like this in xamarin.?

What I want is

int selectedKey=ShowKeyBoard();

Sign In or Register to comment.