void ReleaseDesignerOutlets() { if (NewNoteOutlet != null) { NewNoteOutlet.Dispose(); NewNoteOutlet = null; } if (MyTextField != null) { MyTextField.Dispose(); MyTextField = null; } if (tblNotes != null) { tblNotes.Dispose(); tblNotes = null; } if (tblColmnNoteTitle != null) { tblColmnNoteTitle.Dispose(); tblColmnNoteTitle = null; } if (noteWebView != null) { noteWebView.Dispose(); noteWebView = null; } if (searchField != null) { searchField.Dispose(); searchField = null; } if (mainWindow != null) { mainWindow.Dispose(); mainWindow = null; } if (notesScrollView != null) { notesScrollView.Dispose(); notesScrollView = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); var nextButton = new UIBarButtonItem( "Next", UIBarButtonItemStyle.Plain, (s, e) => { Nav.NavigateTo(AppDelegate.CommandsPage3Key); }); NavigationItem.SetRightBarButtonItem(nextButton, false); View.AddGestureRecognizer( new UITapGestureRecognizer( () => { if (MyTextField.CanResignFirstResponder) { MyTextField.ResignFirstResponder(); } })); // Command and custom event ----------------------------- MyTextField.SetCommand( "EditingDidEnd", Vm.ShowMessageCommand, MyTextField.Text); // Subscribing to events to avoid linker issues in release mode --------------------------------- // This "fools" the linker into believing that the events are used. // In fact we don't even subscribe to them. // See https://developer.xamarin.com/guides/android/advanced_topics/linking/ if (_falseFlag) { MyTextField.EditingDidEnd += (s, e) => { }; } }
public override void ViewDidLoad() { base.ViewDidLoad(); View.AddGestureRecognizer( new UITapGestureRecognizer( () => { if (MyTextField.CanResignFirstResponder) { MyTextField.ResignFirstResponder(); } })); // Command and dynamic parameter ---------------------------- var parameterBinding = this.SetBinding(() => MyTextField.Text); DynamicParameterButton.SetCommand(Vm.ShowMessageCommand, parameterBinding); // Subscribing to events to avoid linker issues in release mode --------------------------------- // This "fools" the linker into believing that the events are used. // In fact we don't even subscribe to them. // See https://developer.xamarin.com/guides/android/advanced_topics/linking/ if (_falseFlag) { DynamicParameterButton.TouchUpInside += (s, e) => { }; MyTextField.EditingChanged += (s, e) => { }; } }