2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
Handling event in SfAutoComplete: In our latest 2017 Volume 4, we have removed Delegate API and SFAutoCompleteDelegate class from SfAutoComplete control. Here we have explained how to hook the events using event handler instead of delegates.
Handling FocusChanged event in SfAutoComplete : FocusChanged event has been hooked by EventHandlers. The below codes explain how to hook the FocusChanged event using EventHandlers.
C#:namespace DelegateToEvent { public partial class ViewController : UIViewController { protected ViewController(IntPtr handle) : base(handle) { } public override void ViewDidLoad() { base.ViewDidLoad(); SFAutoComplete autocomplete = new SFAutoComplete(); autocomplete.Frame = new CoreGraphics.CGRect(10, 50, 200, 50); autocomplete.FocusChanged += (object sender, FocusEventArgs e) => { }; this.View.AddSubview(autocomplete); } public override void DidReceiveMemoryWarning() { base.DidReceiveMemoryWarning(); // Release any cached data, images, etc that aren't in use. } } }
Handling ValueChanged event in SfAutoComplete : ValueChanged event has been hooked by EventHandlers. The below codes explain how to hook the ValueChanged event using EventHandlers.
C#:namespace DelegateToEvent { public partial class ViewController : UIViewController { protected ViewController(IntPtr handle) : base(handle) { } public override void ViewDidLoad() { base.ViewDidLoad(); SFAutoComplete autocomplete = new SFAutoComplete(); autocomplete.Frame = new CoreGraphics.CGRect(10, 50, 200, 50); autocomplete.ValueChanged += (object sender, EventArgs e) => { double Value = Convert.ToDouble(e.Value.ToString()); }; this.View.AddSubview(autocomplete); } public override void DidReceiveMemoryWarning() { base.DidReceiveMemoryWarning(); // Release any cached data, images, etc that aren't in use. } } }
Handling SelectionChanged event in SfAutoComplete : SelectionChanged event has been hooked by EventHandlers. The below codes explain how to hook the SelectionChanged event using EventHandlers. C#:namespace DelegateToEvent { public partial class ViewController : UIViewController { protected ViewController(IntPtr handle) : base(handle) { } public override void ViewDidLoad() { base.ViewDidLoad(); SFAutoComplete autocomplete = new SFAutoComplete(); autocomplete.Frame = new CoreGraphics.CGRect(10, 50, 200, 50); autocomplete.SelectionChanged += (object sender, SelectionEventArgs e) => { double Value = Convert.ToDouble(e.Value.ToString()); }; this.View.AddSubview(autocomplete); } public override void DidReceiveMemoryWarning() { base.DidReceiveMemoryWarning(); // Release any cached data, images, etc that aren't in use. } } }
|
2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.