private void MenuItem_OnClicked(object sender, EventArgs e) { if (!_entryVisible) { _entryVisible = true; SearchEntry.Focus(); } else { _entryVisible = false; } }
/// <summary> /// Invoked when search button is clicked. /// </summary> /// <param name="sender">The Sender</param> /// <param name="e">Event Args</param> private void SearchButton_Clicked(object sender, EventArgs e) { this.SearchBox.IsVisible = true; this.ProfileView.IsVisible = false; if (this.TitleBar != null) { double opacity; // Animating Width of the search box, from 0 to full width when it added to the view. var expandAnimation = new Animation(property => { SearchBox.WidthRequest = property; opacity = property / TitleBar.Width; SearchBox.Opacity = opacity; }, 0, TitleBar.Width, Easing.Linear); expandAnimation.Commit(SearchBox, "Expand", 16, 250, Easing.Linear); } SearchEntry.Focus(); }
private void SearchButtonClicked(object sender, EventArgs e) { ViewModel.IsSearchVisible = !ViewModel.IsSearchVisible; SearchEntry.Focus(); }