Beispiel #1
0
		void TxtVersion_Click (object sender, EventArgs e)
		{
			Dialog dialog = new Dialog(this);
			dialog.SetContentView(Resource.Layout.CustomDialog);
			dialog.SetTitle("Giới thiệu");



			dialog.FindViewById<TextView> (Resource.Id.txt_d1).Text = UrlHelper.About();

			dialog.Show();
		}
        void NewElement_Clicked(object sender, EventArgs e)
        {
            var d = new Dialog(Xamarin.Forms.Forms.Context);
            d.SetTitle((this.Element as ButtonOpenDialog).TitleModal);
            var renderer = RendererFactory.GetRenderer((this.Element as ButtonOpenDialog).ContentModal);
            // TODO : à ajuster
            Android.Widget.LinearLayout.LayoutParams params1 = new Android.Widget.LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            params1.Height = 300;
            d.AddContentView(renderer.ViewGroup, params1);
            d.Show();

            this.UpdateLayout();
        }
        //        protected override void OnCreate(Bundle bundle){
        //            base.OnCreate (bundle);
        //            SetContentView (Resource.Layout.AlertDialog);
        //
        //            Button bt = FindViewById<Button> (Resource.Id.button1);
        //
        //            bt.Click += delegate {
        //                CreateAddProjectDialog ();
        //            };
        //
        //            }
        /*
         *Klasa koja otvara prikaz povijesti placenih parkiranja.
         * */
        public static void CreateListDialog(Context context,List<string> lista)
        {
            Dialog dialog = new Dialog (context);
            dialog.SetContentView (Resource.Layout.DialogList);
            ListView lv = (ListView)dialog.FindViewById (Resource.Id.dialogList);
            //List<string> lista = new List<string> ();
            lv.Adapter = new ArrayAdapter<String> (context, Android.Resource.Layout.TestListItem, lista);
            dialog.Window.SetBackgroundDrawableResource (Android.Resource.Color.BackgroundDark);
            //dialog.Window.SetLayout(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
            //dialog.Window.RequestFeature(WindowFeatures.NoTitle);

            dialog.SetCancelable(true);
            dialog.SetTitle ("Povijest poruka.");
            dialog.Show();
        }
        void ShowProxySettings ()
        {
            dialog = new Dialog (this);
            dialog.SetContentView (Resource.Layout.Proxy);
            dialog.SetTitle ("Proxy Settings"); 
            dialog.SetCancelable (true);

            dialog.CancelEvent += DialogDismissHandler;

            Button btnProxySave = (Button)dialog.FindViewById (Resource.Id.btnProxySave);
            Button btnProxyCancel = (Button)dialog.FindViewById (Resource.Id.btnProxyCancel);

            btnProxySave.Click += EnableProxy; 
            btnProxyCancel.Click += DisableProxy;
            
            proxyUsername = (EditText)dialog.FindViewById (Resource.Id.proxyUsername);
            proxyPassword = (EditText)dialog.FindViewById (Resource.Id.proxyPassword);
            proxyServer = (EditText)dialog.FindViewById (Resource.Id.proxyServer);
            proxyPort = (EditText)dialog.FindViewById (Resource.Id.proxyPort);
            
            tgProxy = (ToggleButton)dialog.FindViewById (Resource.Id.tbProxy);
            tgProxy.CheckedChange += ProxyCheckedChanged;
            tgProxy.Checked = true;

            if (proxy != null) {
                tgProxy.Checked = true;
                tvProxy.Text = SetProxyText(true);
            } else {
                tgProxy.Checked = false;

                tvProxy.Text = SetProxyText(false);
            }

            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyServer))) {
                proxyServer.Text = proxy.ProxyServer;
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyPort.ToString()))) {
                proxyPort.Text = proxy.ProxyPort.ToString();
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyUserName))) {
                proxyUsername.Text = proxy.ProxyUserName;
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyPassword))) {
                proxyPassword.Text = proxy.ProxyPassword;
            }

            dialog.Show();
        }
Beispiel #5
0
 //string[] values;
 //Dialog dialog;
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     //string text = Intent.GetStringArrayListExtra ("MyData") ?? "Data not available";
     SetContentView (Resource.Layout.listview);
     FindViewById<Button> (Resource.Id.btnCreate).Click += delegate {
         Console.WriteLine("check{0}","inside btncreate");
         Dialog dialog = new Dialog(this);
         dialog.SetTitle("form");
     //				dialog.SetContentView(Resource.Layout.build);
         //var alert = new AlertDialog.Builder(Forms.Context);
     //				AlertDialog.Builder dialog= new AlertDialog.Builder(this,Android.App.AlertDialog.ThemeHoloLight);
     //				dialog.SetView (FindViewById<View> (Resource.Layout.build));
         //dialog.Create();
         dialog.Show();
     };
 }
Beispiel #6
0
        /// <summary>
        /// overrided bool to show a dialog window 
        /// when trying to exit the controller
        /// </summary>
        /// <param name="keyCode"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
        {
            //if the back key is pressed
            if (keyCode == Keycode.Back)
            {
                updateThread.Abort();
                //set the content view to the dialogwindow content
                //outside this contentview we are unable to find our resources
                SetContentView(Resource.Layout.DialogWindow);

                //create a new dialog
                dialog = new Dialog(this);
                dialog.SetContentView(Resource.Layout.DialogWindow);
                dialog.SetTitle("OML");
                dialog.SetCancelable(true);

                //set the dialog text
                dialogTxt = FindViewById<TextView>(Resource.Id.dialogText);
                dialogTxt.Text = "By leaving the controller interface you will exit the current session. \n\n Do you wish to continue?";

                //set the buttons
                okButton = FindViewById<Button>(Resource.Id.okButton);
                cancelButton = FindViewById<Button>(Resource.Id.cancelButton);

                //handle click events
                okButton.Click += delegate
                {
                    //change the background and finish the current activity (controller)
                    okButton.SetBackgroundResource(Resource.Drawable.okbutton_pressed);
                    //Close the Activity
                    Finish();
                    //Ends the Current Session!
                    Settings_Singleton.Instance.CloseCurrentSession();
                    //Close the Viewer TCP
                    Settings_Singleton.Instance.CloseViewerTCP();

                };//end delegate
                cancelButton.Click += delegate
                {
                    //change the background, cancel the dialog and set the contentview back to the controller
                    //so we can continue with our activity
                    cancelButton.SetBackgroundResource(Resource.Drawable.cancelbutton_pressed);
                    dialog.Cancel();
                    this.OnCreate(bundle);
                };//end delegate

                return true;
            }//end if
             	        return base.OnKeyDown(keyCode, e);
        }
 private void StrokeJoinDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Join");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner)dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_joins));
    
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var cap = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition).ToString();
             switch (cap)
             {
                 case "round":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Round;
                     break;
                 case "miter":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Miter;
                     break;
                 case "bevel":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Bevel;
                     break;
             }
             dialog.Dismiss();
         };
     dialog.Show();
 }
 private void StrokeStyleDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Style");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner)dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_styles));
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var cap = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition).ToString();
             switch (cap)
             {
                 case "stroke":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.Stroke;
                     break;
                 case "fill":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.Fill;
                     break;
                 case "fill+stroke":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.FillAndStroke;
                     break;
             }
             dialog.Dismiss();
         };
     dialog.Show();
 }
 private void StrokeWidthDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Width");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner) dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_widths));
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var strokeWidth = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition);
             m_SignatureCapture.StrokeWidth = int.Parse(strokeWidth.ToString());
             dialog.Dismiss();
         };
     dialog.Show();
 }
Beispiel #10
0
        private void DisplayDialogOkey()
        {
            //Close Keyboard
            InputMethodManager inputMgr = GetSystemService(InputMethodService) as InputMethodManager;
            if (CurrentFocus != null)
                inputMgr.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);

            //Open Connect Dialog!
            //set the content view to the dialogwindow content
            //outside this contentview we are unable to find our resources
            SetContentView(Resource.Layout.DialogWindow);

            //create a new dialog
            dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.DialogWindow);
            dialog.SetTitle("OML");
            dialog.SetCancelable(true);

            //set the dialog text
            dialogTxt = FindViewById<TextView>(Resource.Id.dialogText);

            //set the buttons
            okButton = FindViewById<Button>(Resource.Id.okButton);
            cancelButton = FindViewById<Button>(Resource.Id.cancelButton);

            //Hide Cancel buttom, Only Okey needed
            cancelButton.Visibility = ViewStates.Invisible;

            okButton.Click += delegate
            {
                //change the background, close the dialog and set the contentview back to the live / connection screen
                //so we can continue with our activity
                //Draw Click
                okButton.SetBackgroundResource(Resource.Drawable.okbutton_pressed);
                //Close Dialog
                dialog.Cancel();
                this.OnCreate(bundle);
            };//end delegate
        }
 private Dialog CreateDeviceDialog()
 {
     Dialog dialog = new Dialog (this);
     dialog.SetTitle ("Select Device or Event");
     dialog.Window.SetLayout (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
     dialog.SetContentView (Resource.Layout.SelectDongles);
     dialog.Window.SetTitleColor (Color.White);
     return dialog;
 }
Beispiel #12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.dialog);

            // Normal Dialog
            Button mbtnAlert = FindViewById<Button> (Resource.Id.btnDialog);
            mbtnAlert.Click += delegate
            {
                new AlertDialog.Builder(this)
                    .SetTitle("Alert!")
                        .SetMessage("This is the content of the alert")
                        .SetPositiveButton("Ok", delegate
                                           {
                            Toast.MakeText(this, "Clicked ok", ToastLength.Short).Show();
                        })
                        .SetNegativeButton("Cancel", delegate
                                           {
                            Toast
                                .MakeText(this, "Clicked cancel", ToastLength.Short)
                                    .Show();
                        })
                        .Show();
            };

            //Progress Dialog
            Button mbtnProgress = FindViewById<Button>(Resource.Id.btnProgress);
            mbtnProgress.Click += delegate
            {
                ProgressDialog progressDialog = ProgressDialog.Show(this, "Running", "Please wait...", true);

                new Thread(new ThreadStart(delegate
                                           {
                    Thread.Sleep(5000);

                    RunOnUiThread(() => progressDialog.Hide());
                })).Start();
            };

            //Custom Dialog
            Button mbtnCustom = FindViewById<Button> (Resource.Id.btnCustom);
            mbtnCustom.Click += delegate
            {
                Dialog dialog = new Dialog(this);
                dialog.SetContentView(Resource.Layout.custom_dialog);
                dialog.SetTitle("This is a custom dialog");
                dialog.SetCancelable(true);
                EditText input = (EditText) dialog.FindViewById (Resource.Id.editTextD);
                TextView txtv = (TextView)dialog.FindViewById(Resource.Id.textView1);
                Button btnOk = (Button)dialog.FindViewById(Resource.Id.btnOk);
                btnOk.Click += delegate
                {
                    if (input.Text.Length>0){
                        Toast.MakeText(this, input.Text, ToastLength.Short).Show();
                    } else {
                        Toast.MakeText(this, "Clicked ok", ToastLength.Short).Show();
                    }

                    dialog.Cancel();
                };
                Button btnCancel = (Button)dialog.FindViewById(Resource.Id.btnCancel);
                btnCancel.Click += delegate
                {
                    dialog.Cancel();
                };

                dialog.Show();
            };

            Button mbackBtn = FindViewById<Button> (Resource.Id.BackBtn5);
            mbackBtn.Click += delegate
            {
                Finish();
            };
        }
 private Dialog CreateFilterDialog()
 {
     Dialog dialog = new Dialog (this);
     dialog.SetTitle ("Select Dongles To Show");
     dialog.Window.SetLayout (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
     dialog.SetContentView (Resource.Layout.SelectDongles);
     dialog.Window.SetTitleColor (Color.LightYellow);
     return dialog;
 }
        protected override Dialog OnCreateDialog(int id)
        {
            //return base.OnCreateDialog (id);
            switch (id) {
            case DLG_WORK_TIME_WARNING:
                Dialog dialog = new Dialog (this);
                dialog.SetTitle ("Предупреждение");
                dialog.SetContentView (Resource.Layout.Dialog);
                dialog.FindViewById <Button> (Resource.Id.btnDlgClose).Click += (object sender, EventArgs e) => {
                    this.Finish();
                };

                dialog.SetCancelable (false);
                return dialog;
            }
            return null;
        }
Beispiel #15
0
        /// <summary>
        /// Opens a dialog window with the choice to release the object we picked up (ring)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void releaseClick(object sender, EventArgs e)
        {
            //reset the button drawable
            btnDrawableReset();
            //set the background
            release.SetBackgroundResource(Resource.Drawable.releasebutton_pressed);

            updateThread.Abort();

            //set the content view to the dialogwindow content
            //outside this contentview we are unable to find our resources
            SetContentView(Resource.Layout.DialogWindow);

            //create a new dialog
            dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.DialogWindow);
            dialog.SetTitle("Release ring");
            dialog.SetCancelable(true);

            //set the dialog text
            dialogTxt = FindViewById<TextView>(Resource.Id.dialogText);
            dialogTxt.Text = "Are you sure you want to release the ring?";

            //set the buttons
            okButton = FindViewById<Button>(Resource.Id.okButton);
            cancelButton = FindViewById<Button>(Resource.Id.cancelButton);

            //handle click events
            okButton.Click += delegate
            {
                //change the background and finish the current activity (controller)
                okButton.SetBackgroundResource(Resource.Drawable.okbutton_pressed);

                //set bool true to get carmen to release the ring
                Send_Singleton.Instance.releaseRing = 1;

                SetContentView(Resource.Layout.Controller);
                this.OnCreate(bundle);
                //Close the dialog
                dialog.Cancel();
            };//end delegate
            cancelButton.Click += delegate
            {
                //change the background, cancel the dialog and set the contentview back to the controller
                //so we can continue with our activity
                cancelButton.SetBackgroundResource(Resource.Drawable.cancelbutton_pressed);
                dialog.Cancel();
                this.OnCreate(bundle);
            };//end delegate
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            _flurryClient = new FlurryClient();

            _context = this;
            _loginError = new TextView(this);

            SetContentView(Resource.Layout.loginweblayout);
            _endlogin = new TextView(this);
            //_messageDialogBuilder = new AlertDialog.Builder(this);
            _loginWebView = FindViewById<WebView>(Resource.Id.loginWebView);
            _loginWebView.Settings.SavePassword = false;

            //_loginWebView.Settings.JavaScriptEnabled = true;

            _loginWebView.Settings.PluginsEnabled = true;
            _loginWebView.Settings.JavaScriptCanOpenWindowsAutomatically = true;
            _loginWebView.SaveEnabled = false;
            _loginWebView.SetWebViewClient(new ItsbetaLoginWebViewClient(this));
            _loginWebView.SetWebChromeClient(new ItsbetaLoginWebViewChromeClient());
            // "https://www.facebook.com/dialog/oauth?response_type=token&display=popup&client_id={0}&redirect_uri={1}&scope={2}",
            _loginWebView.LoadUrl(String.Format(
                "https://m.facebook.com/dialog/oauth/?response_type=token&" +
                                                    "client_id={0}"+
                                                    "&redirect_uri={1}" +
                                                    "&scope={2}",
                    //"https://www.facebook.com/dialog/oauth/?response_type=token&display=popup&client_id={0}&redirect_uri={1}&scope={2}",
                    AppInfo._fbAppId, AppInfo._loginRedirectUri, AppInfo._fbScope));

            RelativeLayout progressDialogRelativeLayout = new RelativeLayout(this);
            LayoutInflater progressDialoglayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService);
            View progressDialogView = progressDialoglayoutInflater.Inflate(Resource.Layout.progressdialoglayout, null);
            _progressDialogMessage = (TextView)progressDialogView.FindViewById(Resource.Id.progressDialogMessageTextView);
            progressDialogRelativeLayout.AddView(progressDialogView);
            _progressDialog = new ProgressDialog(this, Resource.Style.FullHeightDialog);
            _progressDialog.Show();
            _progressDialog.SetContentView(progressDialogRelativeLayout);
            _progressDialog.Dismiss();

            _progressDialog.Show();
            _progressDialog.SetCanceledOnTouchOutside(false);

            /////

            RelativeLayout errorDialogRelativeLayout = new RelativeLayout(this);
            LayoutInflater errorDialoglayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService);
            View errorDialogView = errorDialoglayoutInflater.Inflate(Resource.Layout.wrongcodedialoglayout, null);
            _errorDialogReadyButton = (Button)errorDialogView.FindViewById(Resource.Id.readyButton);
            _errorDialogTitle = (TextView)errorDialogView.FindViewById(Resource.Id.textView1);
            _errorDialogMessage = (TextView)errorDialogView.FindViewById(Resource.Id.textView2);

            errorDialogRelativeLayout.AddView(errorDialogView);
            _errorDialog = new Dialog(this, Resource.Style.FullHeightDialog);
            _errorDialog.SetTitle("");
            _errorDialog.SetContentView(errorDialogRelativeLayout);

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            _endlogin.TextChanged += delegate //здесь инициализировать все необходимое перед запуском...
            {
                Finish();
                StartActivity(typeof(FirstBadgeActivity));
            };
            _loginError.TextChanged += delegate { Finish(); StartActivity(typeof(LoginActivity)); };
        }
        // Dialog zur Anzeige der Customer-Auswahl
        private void customerDialog(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View setCustomer = inflater.Inflate(Resource.Layout.SetCustomer, container);
            dialog = new Dialog(container.Context);
            dialog.SetContentView(setCustomer);
            dialog.SetTitle("Search & select customer");
            tv_customer_search = (AutoCompleteTextView)dialog.FindViewById(Resource.Id.autocomplete);
            tv_customer_search.Threshold = 1;

            ThreadPool.QueueUserWorkItem(o =>
            {
                getCustomers(tv_customer_search, null);
            });

            dialog.Show();

            //tv_customer_search.AfterTextChanged += delegate
            //{
            //    AfterTextChanged_Customer(this.tv_customer_search, null);
            //};
            Button btnSelect = (Button)dialog.FindViewById(Resource.Id.btnSelect);
            Button btnCancel = (Button)dialog.FindViewById(Resource.Id.btnCancel);

            btnCancel.Click += delegate
            {
                btnCancelOnClick(this, null);
            };

            btnSelect.Click += delegate
            {
                btnSelectOnClick(this, null);
            };
        }
Beispiel #18
0
        public void TwitterPermissions()
        {
            if (!twitterBox.Checked)
                return;

            ISharedPreferences prefs = GetSharedPreferences(Global.PREFS_NAME, 0);
            string AccountName = prefs.GetString ("TwitterName", "");

            Dialog dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.TwitterPopup);
            EditText twitterNameBox = (EditText)dialog.FindViewById(Resource.Id.twitterNameBox);
            twitterNameBox.Text = AccountName;
            dialog.SetTitle("Twitter");
            dialog.SetCancelable(false);

            dialog.FindViewById(Resource.Id.twitterCancel).Click += delegate {
                twitterBox.Checked = false;
                dialog.Dismiss();
            };
            dialog.FindViewById(Resource.Id.twitterConfirm).Click += delegate {
                AccountName = twitterNameBox.Text;
                ISharedPreferencesEditor editor = prefs.Edit ();
                editor.PutString("TwitterName", AccountName);
                editor.Commit();
                dialog.Dismiss();
                Log.Debug ( TAG, AccountName );
            };
            dialog.Show();
        }
 private void ShowLoginPopup(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
     View loginPopup = inflater.Inflate(Resource.Layout.Login, container);
     dialog = new Dialog(container.Context);
     dialog.SetContentView(loginPopup);
     dialog.SetTitle("Login");
     tv_customer_search = (AutoCompleteTextView)dialog.FindViewById(Resource.Id.autocomplete);
     tv_customer_search.Threshold = 1;
     EditText tfLogin =null;
     EditText tfPwd=null;
     //GUI-Elemente werden an Variablennamen gebunden
     //und entsprechende Events zugewiesen.
     tfLogin = loginPopup.FindViewById<EditText>(Resource.Id.tfLogin);
     tfPwd = loginPopup.FindViewById<EditText>(Resource.Id.tfPwd);
     Button btnLogin = loginPopup.FindViewById<Button>(Resource.Id.btnLogin);
     btnLogin.Click += delegate
     {
         ThreadPool.QueueUserWorkItem(o => btnLoginOnClick(btnLogin, null,tfLogin.Text, tfPwd.Text));
     };
 }
 private void Item_Order_Popup(String itemID, LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
     View itemOrderPopup = inflater.Inflate(Resource.Layout.Item_Order_Popup, null);
     dialog = new Dialog(container.Context);
     dialog.SetContentView(itemOrderPopup);
     dialog.SetTitle("Order selected Item");
     String itemDesc = null;
     ItemSingle item = item_list_adapter.getItem(itemID);
     EditText itemName = (EditText) dialog.FindViewById(Resource.Id.itemName);
     EditText amount = (EditText) dialog.FindViewById(Resource.Id.Amount);
     EditText basePrice = (EditText) dialog.FindViewById(Resource.Id.BasePrice);
     EditText discount = (EditText) dialog.FindViewById(Resource.Id.Discount);
     TextView endprice = (TextView) dialog.FindViewById(Resource.Id.Endprice);
     Button btnOrder = (Button)dialog.FindViewById(Resource.Id.btnOrder);
     Button btnCancel = (Button)dialog.FindViewById(Resource.Id.btnCancelOrder);
     itemDesc = item.description;
     itemName.Text = item.no;
     amount.Text = "";
     amount.Hint = "Amount...";
     basePrice.Text = item.unitprice;
     discount.Text = "";
     discount.Hint = "Discount...";
     endprice.Text = "0.00";
     dialog.Show();
     amount.AfterTextChanged += delegate{
         ThreadPool.QueueUserWorkItem(o =>
         {
             amount_TextChanged(this, null);
         });
     };
     btnOrder.Click += delegate{
         btnOrder_Click(this,null);
     };
 }