Пример #1
0
        private void ActionSheetButtonsTouchUpInside(object sender, EventArgs e)
        {
            UIActionSheet actionSheet = new UIActionSheet("Actions");

            actionSheet.AddButton("About");
            actionSheet.AddButton("Settings");
            actionSheet.AddButton("Log out");
            actionSheet.AddButton("Cancel");
            actionSheet.DestructiveButtonIndex = 2;
            actionSheet.CancelButtonIndex      = 3;

            actionSheet.Clicked += delegate(object a, UIButtonEventArgs but) {
                if (but.ButtonIndex == 0)
                {
                    ViewModel.About();
                }
                if (but.ButtonIndex == 1)
                {
                    ViewModel.OpenSettings();
                }
                if (but.ButtonIndex == 2)
                {
                    ViewModel.LogOutCommand.Execute(null);
                }
            };

            actionSheet.ShowInView(View);
        }