i created an action sheet with 4 buttons and then i try to get handle the click using this code
btn.TouchUpInside += (sender, e) => { actionSheetSort = new UIActionSheet ("Filter "); actionSheetSort.AddButton ("button1"); actionSheetSort.AddButton ("button2"); actionSheetSort.AddButton ("button3"); actionSheetSort.AddButton ("button4"); actionSheetSort.CancelButtonIndex = 3;
actionSheetSort.Clicked += delegate(object a, UIButtonEventArgs b) { Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked"); }; actionSheetSort.ShowInView (View); };
when i try to write a switch statement which uses the button index to decide what action to take it doesn't work. but if i try to write a console statement , that works fine