本文整理汇总了C#中UIActionSheet.ShowFromTabBar方法的典型用法代码示例。如果您正苦于以下问题:C# UIActionSheet.ShowFromTabBar方法的具体用法?C# UIActionSheet.ShowFromTabBar怎么用?C# UIActionSheet.ShowFromTabBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIActionSheet
的用法示例。
在下文中一共展示了UIActionSheet.ShowFromTabBar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RightBarButtonClicked
private void RightBarButtonClicked(object sender, EventArgs args)
{
var actionSheet = new UIActionSheet("") {Utils.Translate("email.sendbymail"), Utils.Translate("cancel")};
actionSheet.Title = Utils.Translate("actionsheet.reportheader");
//actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 2;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs e)
{
switch (e.ButtonIndex)
{
case 0:
//Enkel rapport
var reportScreen = new ReportJakt(jakt);
this.NavigationController.PushViewController(reportScreen, true);
break;
/*case 1:
//Jaktbok
var uploadScreen = new UploadScreen(jakt);
this.NavigationController.PushViewController(uploadScreen, true);
break;
case 2:
//Del på face
MessageBox.Show("Ennå ikke implementert...", "");
break;
*/default:
//Avbryt
break;
}
};
}
示例2: HandleButtonTrashClicked
void HandleButtonTrashClicked (object sender, EventArgs e)
{
string filepath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.Personal), _filename);
if(File.Exists(filepath))
{
var actionSheet = new UIActionSheet("") {Utils.Translate("delete"), Utils.Translate("cancel")};
actionSheet.Title = Utils.Translate("confirmdeleteimage");
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt) {
switch (evt.ButtonIndex)
{
case 0:
//Slett
File.Delete(filepath);
_filename = string.Empty;
imageView.Image = null;
_callback(this);
NavigationController.PopViewControllerAnimated(true);
break;
case 1:
//Avbryt
break;
}
};
}
}
示例3: HandleBtPageCurlClicked
void HandleBtPageCurlClicked (object sender, EventArgs e)
{
var actionSheet = new UIActionSheet("") {"Treff", "Bom", "Observasjoner", "Alle loggføringer"};
actionSheet.Title = "Vis bare:";
actionSheet.CancelButtonIndex = 3;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt) {
switch (evt.ButtonIndex)
{
case 0:
Filter = "Treff";
break;
case 1:
Filter = "Bom";
break;
case 2:
Filter = "Obs";
break;
case 3:
default:
Filter = "";
break;
}
RefreshMap();
};
}
示例4: RightBarButtonClicked
private void RightBarButtonClicked(object sender, EventArgs args)
{
var actionSheet = new UIActionSheet("") {"Send på e-post", "Avbryt"};
actionSheet.Title = "Lag rapporter fra jakta";
//actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 2;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs e)
{
switch (e.ButtonIndex)
{
case 0:
//Enkel rapport
var reportScreen = new ReportJakt(jakt);
this.NavigationController.PushViewController(reportScreen, true);
break;
/*case 1:
//Jaktbok
var uploadScreen = new UploadScreen(jakt);
this.NavigationController.PushViewController(uploadScreen, true);
break;
case 2:
//Del på face
MessageBox.Show("Ennå ikke implementert...", "");
break;
*/default:
//Avbryt
break;
}
};
//var reportScreen = new ReportJakt(jakt);
//reportScreen.ModalTransitionStyle = UIModalTransitionStyle.CoverVertical;
}
示例5: HandleDeleteButtonTouchUpInside
void HandleDeleteButtonTouchUpInside ()
{
var actionSheet = new UIActionSheet("") {"Slett", "Avbryt"};
actionSheet.Title = "Jeger blir slettet permanent, og fjernet fra alle logger";
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
Console.WriteLine(e.ButtonIndex);
switch (e.ButtonIndex)
{
case 0:
//Slett
_controller.Delete(_controller.jeger);
break;
case 1:
//Avbryt
break;
}
};
}
示例6: HandleDeleteButtonTouchUpInside
void HandleDeleteButtonTouchUpInside ()
{
var actionSheet = new UIActionSheet("") {Utils.Translate("delete"), Utils.Translate("cancel")};
actionSheet.Title = Utils.Translate("specie.deletewarning");
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
Console.WriteLine(e.ButtonIndex);
switch (e.ButtonIndex)
{
case 0:
//Slett
_controller.Delete(_controller.art);
break;
case 1:
//Avbryt
break;
}
};
}
示例7: CommitEditingStyle
public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
var jeger = JegerList.ElementAt(indexPath.Row);
var actionSheet = new UIActionSheet("") {"Slett jeger", Utils.Translate("cancel")};
actionSheet.Title = jeger.Navn + " vil bli slettet og fjernet fra alle logger.";
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
Console.WriteLine(e.ButtonIndex);
switch (e.ButtonIndex)
{
case 0:
//Slett
JaktLoggApp.instance.DeleteJeger(jeger);
_controller.Refresh();
break;
case 1:
//Avbryt
break;
}
};
}
示例8: HandleMoveButtonCellTapped
void HandleMoveButtonCellTapped(UITableView tableView)
{
if (selectedVerses != null && selectedVerses.Count != 0)
{
var actionSheetDelegate = new MoveActionSheetDelegate(tableViewController, data, selectedVerses);
var actionSheet = new UIActionSheet
{
CancelButtonIndex = 9,
Delegate = actionSheetDelegate,
Title = "Move"
};
actionSheet.Add("Sunday");
actionSheet.Add("Monday");
actionSheet.Add("Tuesday");
actionSheet.Add("Wednesday");
actionSheet.Add("Thursday");
actionSheet.Add("Friday");
actionSheet.Add("Saturday");
actionSheet.Add("Queue");
actionSheet.Add("Review");
actionSheet.Add("Cancel");
actionSheet.ShowFromTabBar(AppDelegate.TabBarController.TabBar);
selected = new bool[data.Count];
}
else
{
new UIAlertView("No Selected Verses", "Whoops! Select the verses you wish to move first!", null, "Okay", null).Show();
}
}
示例9: CommitEditingStyle
public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
var actionSheet = new UIActionSheet("") {"Slett", "Avbryt"};
actionSheet.Title = "Alle logger under denne jakten blir også slettet.";
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
Console.WriteLine(e.ButtonIndex);
switch (e.ButtonIndex)
{
case 0:
//Slett
var row = indexPath.Row;
var section = indexPath.Section;
var datelist = (from item in JaktList
select item.DatoFra.Year).Distinct().ToList();
var currentItems = JaktList.Where(l => l.DatoFra.Year == datelist.ElementAt(section));
var jakt = currentItems.ElementAt(row);
JaktLoggApp.instance.DeleteJakt(jakt);
_controller.Refresh();
break;
case 1:
//Avbryt
break;
}
};
}
示例10: PickImage
public void PickImage(){
loadView.StartAnimating();
picker = new UIImagePickerController();
picker.Delegate = new pickerDelegate(this);
picker.AllowsEditing = true;
var actionSheet = new UIActionSheet("")
{
Utils.Translate("choosefromlibrary"),
Utils.Translate("takepicture"),
Utils.Translate("cancel")
};
actionSheet.Style = UIActionSheetStyle.Default;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
switch (e.ButtonIndex)
{
case 0:
//choose photo
picker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
this.PresentModalViewController(picker, true);
break;
case 1:
//take photo
picker.SourceType = UIImagePickerControllerSourceType.Camera;
this.PresentModalViewController(picker, true);
break;
case 2:
//cancel
NavigationController.PopViewControllerAnimated(true);
break;
}
};
}
示例11: RowSelected
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
if (indexPath.Row == 0)
{
_sheet = new UIActionSheet("Change Torrent Status", null, "Cancel", "Remove Torrent + Data", "Remove");
_sheet.Dismissed += OnDimissed;
_sheet.ShowFromTabBar(_tabBar);
}
}
示例12: CommitEditingStyle
public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
var actionSheet = new UIActionSheet("") {"Slett", "Avbryt"};
actionSheet.Title = "Loggføringen blir slettet permanent.";
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
Console.WriteLine(e.ButtonIndex);
switch (e.ButtonIndex)
{
case 0:
//Slett
var loggItem = _logger.ElementAt(indexPath.Row);
JaktLoggApp.instance.DeleteLogg(loggItem);
_controller.Refresh();
break;
case 1:
//Avbryt
break;
}
};
}
示例13: HandleEditButtonTapped
private void HandleEditButtonTapped(object sender, EventArgs args)
{
var actionSheetDelegate = new VerseEditActionSheetDelegate (this, verse);
var actionSheet = new UIActionSheet {
CancelButtonIndex = 2,
DestructiveButtonIndex = 0,
Delegate = actionSheetDelegate,
};
actionSheet.Add ("Delete");
actionSheet.Add ("Edit");
actionSheet.Add ("Cancel");
actionSheet.ShowFromTabBar (AppDelegate.TabBarController.TabBar);
}
示例14: PickImage
public void PickImage(){
picker = new UIImagePickerController();
picker.Delegate = new pickerDelegate(this);
picker.AllowsEditing = true;
var actionSheet = new UIActionSheet("") {"Velg fra bibliotek", "Ta bilde", "Avbryt"};
actionSheet.Style = UIActionSheetStyle.Default;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
switch (e.ButtonIndex)
{
case 0:
//choose photo
picker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
this.PresentModalViewController(picker, true);
break;
case 1:
//take photo
picker.SourceType = UIImagePickerControllerSourceType.Camera;
this.PresentModalViewController(picker, true);
break;
case 2:
//cancel
NavigationController.PopViewControllerAnimated(true);
break;
}
};
}
示例15: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
// Create an image picker controller.
var imagePicker = new UIImagePickerController();
// Handle an image selected.
imagePicker.FinishedPickingImage += (sender, e) => {
this.InvokeOnMainThread(() => {
this.imgSnapshot.Image = e.Image;
});
DismissViewController(true, null);
//DismissModalViewControllerAnimated(true);
};
// Handle media selected.
imagePicker.FinishedPickingMedia += (sender, e) => {
// After many crashes and debugging the image was found to be
// part of a key/value collection with the key name of
// "UIImagePickerControllerOriginalImage" (typically index 0).
// Go figure.
UIImage image = (UIImage)e.Info.ObjectForKey(
new NSString("UIImagePickerControllerOriginalImage"));
if (image != null)
{
this.InvokeOnMainThread(() => {
this.imgSnapshot.Image = image;
});
}
DismissViewController(true, null);
//DismissModalViewControllerAnimated(true);
};
// Handle cancellation of picker.
imagePicker.Canceled += (sender, e) => {
DismissModalViewControllerAnimated(true);
};
// Handle customer asking for a photo.
this.btnTakePicture.TouchUpInside += (sender, e) => {
// Create an action sheet.
var actionSheet = new UIActionSheet("Image Source") { "Photo Library", "Camera", "Cancel" };
actionSheet.Style = UIActionSheetStyle.BlackTranslucent;
//actionSheet.ShowInView(this.View );
actionSheet.ShowFromTabBar(this.TabBarController.TabBar);
// Action sheet navigation handling.
actionSheet.Clicked += (actionSender, actionEvent) => {
Console.WriteLine("dismiss buttonIndex: " + actionEvent.ButtonIndex);
switch (actionEvent.ButtonIndex)
{
case 0:
// Photo library.
imagePicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
imagePicker.AllowsEditing = false;
this.PresentViewController(imagePicker, true, null);
break;
case 1:
// Camera.
bool isAvailable = UIImagePickerController.IsCameraDeviceAvailable (UIImagePickerControllerCameraDevice.Rear)
|| UIImagePickerController.IsCameraDeviceAvailable (UIImagePickerControllerCameraDevice.Front) ;
if (isAvailable)
{
imagePicker.SourceType = UIImagePickerControllerSourceType.Camera;
imagePicker.AllowsEditing = false;
this.PresentViewController(imagePicker, true, null);
}
else
{
using(var alert = new UIAlertView("Sorry", "this device has No Camera", null, "OK", null))
{
alert.Show();
}
}
break;
default:
break;
}
};
};
}