public void AttachTextBox(CompletableTextBox textBox) { Debug.Assert(_textBox == null); if (Application.Current.Resources.FindName("AcTb_ListBoxStyle") == null) { var myResourceDictionary = new ResourceDictionary(); var uri = new Uri("/WPFAutoCompleteBox/Controls/Resources.xaml", UriKind.Relative); myResourceDictionary.Source = uri; Application.Current.Resources.MergedDictionaries.Add(myResourceDictionary); } // _textBox = textBox; var ownerWindow = Window.GetWindow(_textBox); if (ownerWindow.IsLoaded) { Initialize(); } else { ownerWindow.Loaded += OwnerWindow_Loaded; } ownerWindow.LocationChanged += OwnerWindow_LocationChanged; // //_dataProvider = new FileSysDataProvider(); }
public AutoCompleteManager(CompletableTextBox textBox) { AttachTextBox(textBox); }