Esempio n. 1
0
        private void ShowHideListbox(bool show)
        {
            if (show)
            {
                SuggestedItemsRepeaterView.ItemsSource = _availableSuggestions;

                if (!SuggestedItemsContainerTop.IsVisible && !SuggestedItemsContainerBottom.IsVisible)
                {
                    OnSuggestionOpen?.Invoke(this, new EventArgs());
                }
            }
            else
            {
                if (SuggestedItemsContainerTop.IsVisible || SuggestedItemsContainerBottom.IsVisible)
                {
                    MainEntry.Unfocus();
                    Unfocus();

                    OnSuggestionClose?.Invoke(this, new EventArgs());
                }
            }

            if (SuggestionPlacement == SuggestionPlacement.Top)
            {
                SuggestedItemsContainerTop.IsVisible = show;
            }
            else
            {
                SuggestedItemsContainerBottom.IsVisible = show;
            }
        }
Esempio n. 2
0
        private void ShowHideListbox(bool show)
        {
            if (show)
            {
                SuggestedItemsRepeaterView.ItemsSource = _availableSuggestions;

                if (!SuggestedItemsContainerBottom.IsVisible)
                {
                    OnSuggestionOpen?.Invoke(this, new EventArgs());
                    SuggestedItemsRepeaterView.IsVisible = true;
                }

                SuggestedItemsOuterContainer.IsVisible  = show;
                SuggestedItemsContainerBottom.IsVisible = show;
            }
            else
            {
                if (SuggestedItemsContainerBottom.IsVisible)
                {
                    MainEntry.Unfocus();
                    Unfocus();
                    OnSuggestionClose?.Invoke(this, new EventArgs());
                }

                if (SuggestedItemsRepeaterView.IsVisible)
                {
                    SuggestedItemsRepeaterView.IsVisible = false;
                }

                if (SuggestedItemsOuterContainer.IsVisible)
                {
                    SuggestedItemsOuterContainer.IsVisible = false;
                }

                SuggestedItemsContainerBottom.IsVisible = false;
            }
        }