public void ShowAlert(Object sender, EventArgs e) { dataForm.Commit(); TKAlert alert = new TKAlert(); alert.Title = settings.Title; alert.Message = settings.Message; alert.AllowParallaxEffect = settings.AllowParallaxEffect; alert.Style.BackgroundStyle = settings.BackgroundStyle; alert.ActionsLayout = settings.ActionsLayout; alert.DismissMode = settings.DismissMode; alert.SwipeDismissDirection = settings.DismissDirection; alert.AnimationDuration = (float)settings.AnimationDuration; alert.Style.BackgroundDimAlpha = (float)settings.BackgroundDim; alert.AddActionWithTitle("Shake", (TKAlert al, TKAlertAction action) => { alert.Shake(); return(false); }); alert.AddActionWithTitle("Touch", (TKAlert al, TKAlertAction action) => false); alert.AddActionWithTitle("Close", (TKAlert al, TKAlertAction action) => { Console.WriteLine("Close"); return(true); }); alert.Show(true); }
public void Show(Object sender, EventArgs e) { // >> alert-custom-content-cs TKAlert alert = new TKAlert(); alert.Style.HeaderHeight = 0; alert.TintColor = new UIColor(0.5f, 0.7f, 0.2f, 1f); alert.CustomFrame = new CGRect((this.View.Frame.Size.Width - 300) / 2, 100, 300, 250); AlertCustomContentView view = new AlertCustomContentView(new CGRect(0, 0, 300, 210)); alert.ContentView.AddSubview(view); // << alert-custom-content-cs alert.AllowParallaxEffect = true; alert.Style.CenterFrame = true; // >> alert-animation-cs alert.Style.ShowAnimation = TKAlertAnimation.Scale; alert.Style.DismissAnimation = TKAlertAnimation.Scale; // << alert-animation-cs // >> alert-tint-dim-cs alert.Style.BackgroundDimAlpha = 0.5f; alert.Style.BackgroundTintColor = UIColor.LightGray; // << alert-tint-dim-cs // >> alert-anim-duration-cs alert.AnimationDuration = 0.5f; // << alert-anim-duration-cs alert.AddActionWithTitle("Done", (TKAlert al, TKAlertAction action) => true); alert.Show(true); }
public override void ViewDidLoad() { base.ViewDidLoad (); var button = new UIButton (UIButtonType.System); button.Frame = new CGRect(20, this.View.Center.Y - 22, this.View.Frame.Width-40, 44); button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin; button.SetTitle ("Load 10000 items", UIControlState.Normal); button.AddTarget ((object sender, EventArgs e) => { int systemVersion = int.Parse(UIDevice.CurrentDevice.SystemVersion.Split('.')[0]); if (systemVersion < 9) { var alert = new TKAlert(); alert.Title = "Telerik UI"; alert.Message = "TKListView is optimized for performance when using dynamic item sizing only when running on iOS 9 and upper!"; alert.AddAction(new TKAlertAction("OK", (TKAlert arg1, TKAlertAction arg2) => { this.CreateListView(); return true; })); alert.Show(true); } else { this.CreateListView(); } ((UIView)sender).RemoveFromSuperview(); }, UIControlEvent.TouchUpInside); this.View.AddSubview(button); }
public void ShowAlert(Object sender, EventArgs e) { dataForm.Commit (); TKAlert alert = new TKAlert (); alert.Title = settings.Title; alert.Message = settings.Message; alert.AllowParallaxEffect = settings.AllowParallaxEffect; alert.Style.BackgroundStyle = settings.BackgroundStyle; alert.ActionsLayout = settings.ActionsLayout; alert.DismissMode = settings.DismissMode; alert.SwipeDismissDirection = settings.DismissDirection; alert.AnimationDuration = (float)settings.AnimationDuration; alert.Style.BackgroundDimAlpha = (float)settings.BackgroundDim; alert.AddActionWithTitle("Shake", (TKAlert al, TKAlertAction action) => { alert.Shake(); return false; }); alert.AddActionWithTitle("Touch", (TKAlert al, TKAlertAction action) => false); alert.AddActionWithTitle("Close", (TKAlert al, TKAlertAction action) => { Console.WriteLine("Close"); return true; }); alert.Show (true); }
public void Show(Object sender, EventArgs e) { // >> getting-started-alert-cs TKAlert alert = new TKAlert(); alert.Title = "Chicken or the egg"; alert.Message = "Which came first, the chicken or the egg?"; // << getting-started-alert-cs alert.Style.MaxWidth = 210; // >> getting-started-alert-action-cs alert.AddActionWithTitle("Egg", (TKAlert al, TKAlertAction action) => { TextLabel.Text = "It was the egg!"; return(true); }); alert.AddActionWithTitle("Chicken", (TKAlert al, TKAlertAction action) => { TextLabel.Text = "It was the chicken!"; return(true); }); // << getting-started-alert-action-cs // >> getting-started-alert-show-cs alert.Show(true); // << getting-started-alert-show-cs }
public override void ViewDidLoad() { base.ViewDidLoad(); this.listViewDelegate = new NotificationsListViewDelegate(this); NSMutableArray types = new NSMutableArray(); types.Add(new NSString("Error")); types.Add(new NSString("Warning")); types.Add(new NSString("Success")); types.Add(new NSString("Info")); dataSource = new TKDataSource(types); listView = new TKListView(); listView.Frame = this.View.Bounds; listView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; listView.Delegate = listViewDelegate; listView.WeakDataSource = dataSource; this.View.AddSubview(listView); titles = new NSMutableArray(); titles.Add(new NSString("Oh no!")); titles.Add(new NSString("Warning!")); titles.Add(new NSString("Well done!")); titles.Add(new NSString("Info.")); messages = new NSMutableArray(); messages.Add(new NSString("Change this and try again!")); messages.Add(new NSString("e careful next time")); messages.Add(new NSString("You successfully read this message")); messages.Add(new NSString("This is TKAlert dialog")); colors = new NSMutableArray(); colors.Add(new UIColor(1f, 0f, 0.282f, 1f)); colors.Add(new UIColor(1f, 0.733f, 0f, 1f)); colors.Add(new UIColor(0.478f, 0.988f, 0.157f, 1f)); colors.Add(new UIColor(0.231f, 0.678f, 1f, 1f)); alert = new TKAlert(); alert.Style.ContentSeparatorWidth = 0; alert.Style.TitleColor = new UIColor(1f, 1f, 1f, 1f); alert.Style.MessageColor = new UIColor(1f, 1f, 1f, 1f); alert.Style.CornerRadius = 0; alert.Style.ShowAnimation = TKAlertAnimation.SlideFromTop; alert.Style.DismissAnimation = TKAlertAnimation.SlideFromTop; // >> alert-bg-cs alert.Style.BackgroundStyle = TKAlertBackgroundStyle.None; // << alert-bg-cs // >> alert-dismiss-cs alert.DismissMode = TKAlertDismissMode.Tap; // << alert-dismiss-cs // >> alert-layout-cs alert.ActionsLayout = TKAlertActionsLayout.Vertical; // << alert-layout-cs }
public override void ViewDidLoad() { base.ViewDidLoad(); var button = new UIButton(UIButtonType.System); button.Frame = new CGRect(20, this.View.Center.Y - 22, this.View.Frame.Width - 40, 44); button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin; button.SetTitle("Load 10000 items", UIControlState.Normal); button.AddTarget((object sender, EventArgs e) => { int systemVersion = int.Parse(UIDevice.CurrentDevice.SystemVersion.Split('.')[0]); if (systemVersion < 9) { var alert = new TKAlert(); alert.Title = "Telerik UI"; alert.Message = "TKListView is optimized for performance when using dynamic item sizing only when running on iOS 9 and upper!"; alert.AddAction(new TKAlertAction("OK", (TKAlert arg1, TKAlertAction arg2) => { this.CreateListView(); return(true); })); alert.Show(true); } else { this.CreateListView(); } ((UIView)sender).RemoveFromSuperview(); }, UIControlEvent.TouchUpInside); this.View.AddSubview(button); }
void CommitDataForm() { this.DataForm.Commit (); this.alert = new TKAlert (); this.alert.Title = "Saved"; this.alert.Message = this.DataSource.WriteJSONToString (); this.alert.AddActionWithTitle("OK", (TKAlert al, TKAlertAction action) => { return true; }); this.alert.Show (true); }
void CommitDataForm() { this.DataForm.Commit(); this.alert = new TKAlert(); this.alert.Title = "Saved"; this.alert.Message = this.DataSource.WriteJSONToString(); this.alert.AddActionWithTitle("OK", (TKAlert al, TKAlertAction action) => { return(true); }); this.alert.Show(true); }
void CancelReservation() { TKAlert alert = new TKAlert(); alert.Style.CornerRadius = 3; alert.Title = "Cancel Reservation"; alert.Message = "Reservation Canceled!"; alert.AddActionWithTitle("OK", (TKAlert a, TKAlertAction action) => { return(true); }); alert.Show(true); }
public void DisplayAlert(string title, string msg, string btn = "OK") { TKAlert alert = new TKAlert(); alert.Style.CornerRadius = 3; alert.Title = title; alert.Message = msg; alert.AddActionWithTitle (btn, (TKAlert a, TKAlertAction action) => { return true; }); alert.Show(true); }
public override void ViewDidLoad () { base.ViewDidLoad (); this.listViewDelegate = new NotificationsListViewDelegate(this); NSMutableArray types = new NSMutableArray (); types.Add (new NSString ("Error")); types.Add (new NSString ("Warning")); types.Add (new NSString ("Success")); types.Add (new NSString("Info")); dataSource = new TKDataSource(types); listView = new TKListView (); listView.Frame = this.View.Bounds; listView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; listView.Delegate = listViewDelegate; listView.WeakDataSource = dataSource; this.View.AddSubview (listView); titles = new NSMutableArray (); titles.Add (new NSString ("Oh no!")); titles.Add (new NSString ("Warning!")); titles.Add (new NSString ("Well done!")); titles.Add (new NSString ("Info.")); messages = new NSMutableArray (); messages.Add (new NSString ("Change this and try again!")); messages.Add (new NSString ("e careful next time")); messages.Add (new NSString ("You successfully read this message")); messages.Add (new NSString ("This is TKAlert dialog")); colors = new NSMutableArray (); colors.Add(new UIColor(1f, 0f, 0.282f, 1f)); colors.Add(new UIColor(1f, 0.733f, 0f, 1f)); colors.Add(new UIColor(0.478f, 0.988f, 0.157f, 1f)); colors.Add(new UIColor(0.231f, 0.678f, 1f, 1f)); alert = new TKAlert (); alert.Style.ContentSeparatorWidth = 0; alert.Style.TitleColor = new UIColor (1f, 1f, 1f, 1f); alert.Style.MessageColor = new UIColor (1f, 1f, 1f, 1f); alert.Style.CornerRadius = 0; alert.Style.ShowAnimation = TKAlertAnimation.SlideFromTop; alert.Style.DismissAnimation = TKAlertAnimation.SlideFromTop; alert.Style.BackgroundStyle = TKAlertBackgroundStyle.None; alert.DismissMode = TKAlertDismissMode.Tap; }
public override void DidShow(TKAlert alert) { TKView view = new TKView (); view.Frame = new CGRect (20, -30, 60, 60); view.Shape = new TKPredefinedShape (TKShapeType.Circle, new CGSize (0, 0)); view.Fill = new TKSolidFill(new UIColor(0.961f, 0.369f, 0.306f, 1f)); view.Stroke = new TKStroke (new UIColor (1f, 1f, 1f, 1f), 3.0f); view.Transform = CGAffineTransform.MakeScale (0.1f, 0.1f); alert.AlertView.AddSubview (view); UIView.AnimateNotify (0.7f, 0.0f, 0.3f, 0.2f, UIViewAnimationOptions.CurveEaseInOut, () => { view.Transform = CGAffineTransform.MakeScale(1f, 1f); }, (bool finished) => { }); }
public void Show(Object sender, EventArgs e) { TKAlert alert = new TKAlert (); alert.Style.HeaderHeight = 0; alert.TintColor = new UIColor (0.5f, 0.7f, 0.2f, 1f); alert.CustomFrame = new CGRect ((this.View.Frame.Size.Width - 300) / 2, 100, 300, 250); alert.AllowParallaxEffect = true; alert.Style.CenterFrame = true; AlertCustomContentView view = new AlertCustomContentView (new CGRect(0, 0, 300, 210)); alert.ContentView.AddSubview (view); alert.AddActionWithTitle("Done", (TKAlert al, TKAlertAction action) => true) ; alert.Show (true); }
public override void DidShow(TKAlert alert) { TKView view = new TKView(); view.Frame = new CGRect(20, -30, 60, 60); view.Shape = new TKPredefinedShape(TKShapeType.Circle, new CGSize(0, 0)); view.Fill = new TKSolidFill(new UIColor(0.961f, 0.369f, 0.306f, 1f)); view.Stroke = new TKStroke(new UIColor(1f, 1f, 1f, 1f), 3.0f); view.Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); alert.AlertView.AddSubview(view); UIView.AnimateNotify(0.7f, 0.0f, 0.3f, 0.2f, UIViewAnimationOptions.CurveEaseInOut, () => { view.Transform = CGAffineTransform.MakeScale(1f, 1f); }, (bool finished) => { }); }
public void Show(Object sender, EventArgs e) { TKAlert alert = new TKAlert(); alert.Style.HeaderHeight = 0; alert.TintColor = new UIColor(0.5f, 0.7f, 0.2f, 1f); alert.CustomFrame = new CGRect((this.View.Frame.Size.Width - 300) / 2, 100, 300, 250); alert.AllowParallaxEffect = true; alert.Style.CenterFrame = true; AlertCustomContentView view = new AlertCustomContentView(new CGRect(0, 0, 300, 210)); alert.ContentView.AddSubview(view); alert.AddActionWithTitle("Done", (TKAlert al, TKAlertAction action) => true); alert.Show(true); }
public void Show(Object sender, EventArgs e) { TKAlert alert = new TKAlert(); alert.Delegate = alertDelegate; alert.Style.CornerRadius = 3; // >> alert-parallax-cs alert.AllowParallaxEffect = true; // << alert-parallax-cs alert.Title = "Warning"; alert.Message = "Are you ready for TKAlert?"; alert.Style.ButtonSpacing = 10; alert.Style.ButtonsInset = new UIEdgeInsets(5, 5, 5, 5); alert.Style.ContentSeparatorWidth = 0; alert.Style.MessageColor = new UIColor(0.349f, 0.349f, 0.349f, 1.00f); alert.Style.TitleSeparatorWidth = -0.5f; alert.Style.ContentSeparatorWidth = 0; alert.AlertView.Layer.ShadowOpacity = 0.6f; alert.AlertView.Layer.ShadowRadius = 3; alert.AlertView.Layer.ShadowOffset = new CGSize(0, 0); alert.AlertView.Layer.MasksToBounds = false; alert.Style.BackgroundColor = UIColor.White; alert.ButtonsView.BackgroundColor = UIColor.White; alert.Style.ShowAnimation = TKAlertAnimation.SlideFromTop; TKAlertAction action = alert.AddActionWithTitle("Yes", (TKAlert al, TKAlertAction act) => { return(true); }); action.BackgroundColor = new UIColor(0.882f, 0.882f, 0.882f, 1.00f); action.TitleColor = new UIColor(0.302f, 0.302f, 0.302f, 1.00f); action.CornerRadius = 3; action = alert.AddActionWithTitle("No", (TKAlert al, TKAlertAction act) => { return(true); }); action.BackgroundColor = new UIColor(0.961f, 0.369f, 0.306f, 1.00f); action.TitleColor = new UIColor(1f, 1f, 1f, 1f); action.CornerRadius = 3; alert.Show(true); }
public void Show(Object sender, EventArgs e) { TKAlert alert = new TKAlert (); alert.Title = "Chicken or the egg"; alert.Message = "Which came first, the chicken or the egg?"; alert.Style.MaxWidth = 210; alert.AddActionWithTitle("Egg", (TKAlert al, TKAlertAction action) => { TextLabel.Text = "It was the egg!"; return true; }); alert.AddActionWithTitle("Chicken", (TKAlert al, TKAlertAction action) => { TextLabel.Text = "It was the chicken!"; return true; }); alert.Show (true); }
public void Show(Object sender, EventArgs e) { TKAlert alert = new TKAlert (); alert.Delegate = alertDelegate; alert.Style.CornerRadius = 3; alert.Title = "Warning"; alert.Message = "Are you ready for TKAlert?"; alert.Style.ButtonSpacing = 10; alert.Style.ButtonsInset = new UIEdgeInsets (5, 5, 5, 5); alert.Style.ContentSeparatorWidth = 0; alert.Style.MessageColor = new UIColor(0.349f, 0.349f, 0.349f, 1.00f); alert.Style.TitleSeparatorWidth = -0.5f; alert.Style.ContentSeparatorWidth = 0; alert.AlertView.Layer.ShadowOpacity = 0.6f; alert.AlertView.Layer.ShadowRadius = 3; alert.AlertView.Layer.ShadowOffset = new CGSize(0, 0); alert.AlertView.Layer.MasksToBounds = false; alert.Style.BackgroundColor = UIColor.White; alert.ButtonsView.BackgroundColor = UIColor.White; alert.Style.ShowAnimation = TKAlertAnimation.SlideFromTop; TKAlertAction action = alert.AddActionWithTitle ("Yes", (TKAlert al, TKAlertAction act) => { return true; }); action.BackgroundColor = new UIColor(0.882f, 0.882f, 0.882f, 1.00f); action.TitleColor = new UIColor(0.302f, 0.302f, 0.302f, 1.00f); action.CornerRadius = 3; action = alert.AddActionWithTitle ("No", (TKAlert al, TKAlertAction act) => { return true; }); action.BackgroundColor = new UIColor(0.961f, 0.369f, 0.306f, 1.00f); action.TitleColor = new UIColor(1f, 1f, 1f, 1f); action.CornerRadius = 3; alert.Show(true); }
public override void ViewDidLoad () { AddOption ("Show Alert", Show); base.ViewDidLoad (); this.listViewDelegate = new ListViewDelegate (this); alert = new TKAlert (); alert.Title = "Animations"; alert.Style.BackgroundStyle = TKAlertBackgroundStyle.Blur; alert.AddActionWithTitle("Close", (TKAlert al, TKAlertAction action) => true); showAnimations = new NSMutableArray (); showAnimations.Add (new NSString ("Scale in")); showAnimations.Add (new NSString ("Fade in")); showAnimations.Add (new NSString ("Slide from left")); showAnimations.Add (new NSString ("Slide from top")); showAnimations.Add (new NSString ("Slide from right")); showAnimations.Add (new NSString ("Slide from bottom")); dismissAnimations = new NSMutableArray (); dismissAnimations.Add (new NSString ("Scale out")); dismissAnimations.Add (new NSString ("Fade out")); dismissAnimations.Add (new NSString ("Slide to left")); dismissAnimations.Add (new NSString ("Slide to top")); dismissAnimations.Add (new NSString ("Slide to right")); dismissAnimations.Add (new NSString ("Slide to bottom")); appearAnimations = new TKDataSource (showAnimations); hideAnimations = new TKDataSource (dismissAnimations); appearAnimationsList = new TKListView (); appearAnimationsList.WeakDataSource = appearAnimations; appearAnimationsList.Delegate = listViewDelegate; appearAnimationsList.Tag = 0; appearAnimationsList.AutoresizingMask = UIViewAutoresizing.None; this.View.AddSubview (appearAnimationsList); NSIndexPath selected = NSIndexPath.FromItemSection (3, 0); appearAnimationsList.SelectItem (selected, true, UICollectionViewScrollPosition.None); hideAnimationsList = new TKListView (); hideAnimationsList.WeakDataSource = hideAnimations; hideAnimationsList.Tag = 1; hideAnimationsList.Delegate = listViewDelegate; hideAnimationsList.AutoresizingMask = UIViewAutoresizing.None; this.View.AddSubview (hideAnimationsList); selected = NSIndexPath.FromItemSection (5, 0); hideAnimationsList.SelectItem (selected, true, UICollectionViewScrollPosition.None); appearLabel = new UILabel (); appearLabel.Text = "Show animation:"; appearLabel.TextColor = new UIColor (0f, 0f, 0f, 1f); appearLabel.Font = UIFont.SystemFontOfSize (12); appearLabel.TextAlignment = UITextAlignment.Center; this.View.AddSubview (appearLabel); hideLabel = new UILabel (); hideLabel.Text = "Hide animation:"; hideLabel.TextColor = new UIColor (0f, 0f, 0f, 1f); hideLabel.Font = UIFont.SystemFontOfSize (12); hideLabel.TextAlignment = UITextAlignment.Center; this.View.AddSubview (hideLabel); }
void CancelReservation() { TKAlert alert = new TKAlert(); alert.Style.CornerRadius = 3; alert.Title = "Cancel Reservation"; alert.Message = "Reservation Canceled!"; alert.AddActionWithTitle ("OK", (TKAlert a, TKAlertAction action) => { return true; }); alert.Show(true); }
public override void ViewDidLoad() { AddOption("Show Alert", Show); base.ViewDidLoad(); this.listViewDelegate = new ListViewDelegate(this); alert = new TKAlert(); alert.Title = "Animations"; alert.Style.BackgroundStyle = TKAlertBackgroundStyle.Blur; alert.AddActionWithTitle("Close", (TKAlert al, TKAlertAction action) => true); showAnimations = new NSMutableArray(); showAnimations.Add(new NSString("Scale in")); showAnimations.Add(new NSString("Fade in")); showAnimations.Add(new NSString("Slide from left")); showAnimations.Add(new NSString("Slide from top")); showAnimations.Add(new NSString("Slide from right")); showAnimations.Add(new NSString("Slide from bottom")); dismissAnimations = new NSMutableArray(); dismissAnimations.Add(new NSString("Scale out")); dismissAnimations.Add(new NSString("Fade out")); dismissAnimations.Add(new NSString("Slide to left")); dismissAnimations.Add(new NSString("Slide to top")); dismissAnimations.Add(new NSString("Slide to right")); dismissAnimations.Add(new NSString("Slide to bottom")); appearAnimations = new TKDataSource(showAnimations); hideAnimations = new TKDataSource(dismissAnimations); appearAnimationsList = new TKListView(); appearAnimationsList.WeakDataSource = appearAnimations; appearAnimationsList.Delegate = listViewDelegate; appearAnimationsList.Tag = 0; appearAnimationsList.AutoresizingMask = UIViewAutoresizing.None; this.View.AddSubview(appearAnimationsList); NSIndexPath selected = NSIndexPath.FromItemSection(3, 0); appearAnimationsList.SelectItem(selected, true, UICollectionViewScrollPosition.None); hideAnimationsList = new TKListView(); hideAnimationsList.WeakDataSource = hideAnimations; hideAnimationsList.Tag = 1; hideAnimationsList.Delegate = listViewDelegate; hideAnimationsList.AutoresizingMask = UIViewAutoresizing.None; this.View.AddSubview(hideAnimationsList); selected = NSIndexPath.FromItemSection(5, 0); hideAnimationsList.SelectItem(selected, true, UICollectionViewScrollPosition.None); appearLabel = new UILabel(); appearLabel.Text = "Show animation:"; appearLabel.TextColor = new UIColor(0f, 0f, 0f, 1f); appearLabel.Font = UIFont.SystemFontOfSize(12); appearLabel.TextAlignment = UITextAlignment.Center; this.View.AddSubview(appearLabel); hideLabel = new UILabel(); hideLabel.Text = "Hide animation:"; hideLabel.TextColor = new UIColor(0f, 0f, 0f, 1f); hideLabel.Font = UIFont.SystemFontOfSize(12); hideLabel.TextAlignment = UITextAlignment.Center; this.View.AddSubview(hideLabel); }