/// <summary>
        /// Returns an instance of popup
        /// </summary>
        private void PreparePopup()
        {
            //if already initialized then exit method
            if (isInitialized)
            {
                return;
            }

            //set the popup placement target
            suggestionPopup.PlacementTarget = sourceTextBox;
            //assign the width to textbox width
            suggestionListBox.Width = sourceTextBox.ActualWidth;

            //see if we have a suggestion provider
            if (suggestionProvider == null)
            {
                //try to retrieve it from the text box
                suggestionProvider = sourceTextBox.GetValue(SuggestionBoxBehavior.ProviderProperty) as ISuggestionProvider;

                //see if we get one
                if (suggestionProvider == null)
                {
                    //if not then create a basic string suggestion provider
                    suggestionProvider = new StringSuggestionProvider();
                }

                //get the number of results property and assign to provider
                suggestionProvider.NumberOfResults = (int)sourceTextBox.GetValue(SuggestionBoxBehavior.NumberOfResultsProperty);
            }

            //fetch the item template and apply to listbox
            suggestionListBox.ItemTemplate = sourceTextBox.GetValue(SuggestionBoxBehavior.ItemTemplateProperty) as DataTemplate;

            //see if we have datasource
            if (suggestionSource == null)
            {
                //if not then retrieve the masterlist of textbox
                IEnumerable assignedDataSource = (IEnumerable)sourceTextBox.GetValue(SuggestionBoxBehavior.MasterListProperty);

                //use provider to generate the suggestion view source
                suggestionSource = suggestionProvider.ProvideDataView(assignedDataSource);
            }

            //assign the sugegstion view to listbox
            suggestionListBox.SetValue(ListBox.ItemsSourceProperty, suggestionSource);

            //mark the flag
            isInitialized = true;
        }