示例#1
0
 private void SearchTextBox_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         SearchResultsListBox.Focus();
     }
 }
示例#2
0
 private void ClearSearchButton_Click(object sender, EventArgs e)
 {
     SearchResultsListBox.ResetText();
     SearchInputTextBox.Visible   = false;
     SearchButton.Visible         = false;
     SearchResultsListBox.Visible = false;
     ClearSearchButton.Visible    = false;
 }
        private void SetSearchResultsListBoxEnabled(bool enabled)
        {
            MethodInvoker mi = new MethodInvoker(() =>
            {
                SearchResultsListBox.Enabled = enabled;
            });

            if (SearchResultsListBox.InvokeRequired)
            {
                SearchResultsListBox.Invoke(mi);
            }
            else
            {
                mi.Invoke();
            }
        }
示例#4
0
        protected override AnimatorHelperBase GetAnimation(AnimationType animationType, Uri toOrFrom)
        {
            if (toOrFrom != null && toOrFrom.OriginalString.StartsWith("/Pages/Browse/"))
            {
                if (animationType == AnimationType.NavigateForwardOut || animationType == AnimationType.NavigateBackwardIn)
                {
                    if (_lastTappedItem != null)
                    {
                        var contentPresenter = SearchResultsListBox.GetContentPresenterForItem(_lastTappedItem);
                        if (contentPresenter != null)
                        {
                            return(GetContinuumAnimation(contentPresenter, animationType));
                        }
                    }
                }
            }

            return(base.GetAnimation(animationType, toOrFrom));
        }
        private void SearchResultsListAppend(String[] titles)
        {
            MethodInvoker mi = new MethodInvoker(() =>
            {
                lock (_ListBoxLock)
                {
                    SearchResultsListBox.Items.AddRange(titles);
                }
            });

            if (SearchResultsListBox.InvokeRequired)
            {
                SearchResultsListBox.Invoke(mi);
            }
            else
            {
                mi.Invoke();
            }
        }
        private void SearchResultsListClear()
        {
            MethodInvoker mi = new MethodInvoker(() =>
            {
                lock (_ListBoxLock)
                {
                    SearchResultsListBox.Items.Clear();
                }
            });

            if (SearchResultsListBox.InvokeRequired)
            {
                SearchResultsListBox.Invoke(mi);
            }
            else
            {
                mi.Invoke();
            }
        }