<Window x:Class="WpfApplication1.TestAutoComplete" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="TestAutoComplete" Height="100" Width="100" DataContext="{Binding TestAutoCompleteBinding, Source={StaticResource Locator}}"> <Grid> <StackPanel Orientation="Vertical"> <telerik:RadAutoCompleteBox ItemsSource="{Binding Source,Mode=TwoWay}" AutoCompleteMode="Suggest" SelectionMode="Single" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" DisplayMemberPath="FirstName"/> <Button Command="{Binding TestCommand}" Content="test"/> </StackPanel> </Grid></Window>public class TestAutoCompleteViewModel : ViewModelBase { public ObservableCollection<Customer> _source; public ObservableCollection<Customer> Source { get { return this._source; } set { this._source = value; this.RaisePropertyChanged(() => this.Source); } } private ICommand _testCommand; public ICommand TestCommand { get { return this._testCommand; } } private Customer _selectedItem; public Customer SelectedItem { get { return this._selectedItem; } set { this._selectedItem = value; this.RaisePropertyChanged(() => this.SelectedItem); } } /// <summary> /// Initializes a new instance of the <see cref="TestAutoCompleteViewModel" /> class. /// </summary> public TestAutoCompleteViewModel() { var customers = new List<Customer>(); customers.Add(new Customer("testLast1", "testFirst1")); customers.Add(new Customer("testLast2", "testFirst2")); customers.Add(new Customer("testLast3", "testFirst3")); customers.Add(new Customer("testLast4", "testFirst4")); customers.Add(new Customer("testLast5", "testFirst5")); customers.Add(new Customer("testLast6", "testFirst6")); this.Source = new ObservableCollection<Customer>(customers); this._testCommand = new RelayCommand(() => { }, () => { return this.SelectedItem != null; }); } }public void OnNavigatedTo(NavigationContext navigationContext){ // Called to initialize views during navigation. // Is this for AgentView? if (navigationContext.Uri.ToString().Contains("AgentsView")) { // The ID of the item to be displayed is passed as a navigation parameter. // ToInt32 can throw FormatException or OverflowException. try { int id = Convert.ToInt32(navigationContext.Parameters["PersonID"]); if (id == 0) return; // Retrieve the specified item using the data service. var agent = new DAL.Agent(); _agentsDataService.GetSelectedAgent(id, GetAgentsCallback); } catch (FormatException e) { //Console.WriteLine("Input string is not a sequence of digits."); //return CurrentItem == null ? false : CurrentItem.Id.Equals(id); } }}private void GetAgentsCallback(DAL.Agent agent){ _navigatedToAgent = agent; if (_navigatedToAgent != null) { SelectedAgent = _navigatedToAgent; }}public DAL.Agent SelectedAgent{ get { return _selectedAgent; } set { if (_selectedAgent == value) return; _selectedAgent = value; RaisePropertyChanged(() => SelectedAgent); _eventAggregator.GetEvent<AgentSelectedEvent>().Publish(_selectedAgent); }}SelectedItem="{Binding SelectedAgent, Mode=TwoWay}"DataMemberBinding="{Binding Path=Values[0]}"public override bool TryGetMember(GetMemberBinder binder, out object result){ if (!this.AllFields.Contains(binder.Name)) { return base.TryGetMember(binder, out result); } result = this.Values[this.AllFields.IndexOf(binder.Name)]; return true;}> Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.CheckNotNull(System.Windows.DependencyObject element, System.Delegate handler) Line 1168 C# Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.RemoveDragOverHandler(System.Windows.DependencyObject element, Telerik.Windows.DragDrop.DragEventHandler handler) Line 789 C# Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FrozenColumnsSplitter.UnSubscribeFromMouseEvents() Line 255 C# Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FrozenColumnsSplitter.FrozenColumnsSplitter_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e) Line 136 C# [External Code] Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(System.Windows.Size availableSize) Line 197 + 0x25 bytes C# Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(System.Windows.Size availableSize) Line 215 + 0x2c bytes C# [External Code] Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(System.Windows.Size constraint) Line 173 + 0x25 bytes C# [External Code] Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(System.Windows.Size availableSize) Line 6587 + 0x2b bytes C# [External Code] Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.WindowHostWindow.MeasureOverride(System.Windows.Size availableSize) Line 341 + 0x28 bytes C# [External Code] Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(bool isModal) Line 40 C# Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.WindowBase.ShowWindow(bool isModal) Line 864 C# Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadWindow.Show() Line 386 C# IZTMediaLibrary.dll!IZTMediaLibrary.Starter.Run() Line 27 C# IZT Signal Suite Database.exe!wWinMain(HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance, wchar_t* lpCmdLine, int nCmdShow) Line 75 C++ IZT Signal Suite Database.exe!__tmainCRTStartup() Line 547 + 0x1c bytes C [External Code] mscoreei.dll!70d655ab() [Frames below may be incorrect and/or missing, no symbols loaded for mscoreei.dll] mscoree.dll!70dd7f16() mscoree.dll!70dd4de3() kernel32.dll!764033aa() ntdll.dll!77829ef2() ntdll.dll!77829ec5() 
public Editor2(int _userID){ InitializeComponent(); //Set Language this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag); //Make RadWindow a normal window (to show taskbar icon etc) RadWindowHelper2 windowHelper = new RadWindowHelper2(); windowHelper.TaskBarDisplayed += new EventHandler(windowHelper_TaskBarDisplayed); windowHelper.ShowWindowInTaskBar(); //Set Document Styles RadDocumentStyles.AddStylesToDocumentRepository(this.radRichTextBox1.Document); //Set dictionary to English GB Stream stream = Application.GetResourceStream(new Uri("en-GB.tdf", UriKind.RelativeOrAbsolute)).Stream; this.LoadDictionary(stream);}public class RadWindowHelper2{ public event EventHandler TaskBarDisplayed; public void ShowWindowInTaskBar() { if (this.TaskBarDisplayed != null) { this.TaskBarDisplayed(this, new EventArgs()); } }}void windowHelper_TaskBarDisplayed(object sender, EventArgs e){ this.Show(); //this.WindowState = WindowState.Maximized; this.BringToFront(); var window = this.ParentOfType<Window>(); window.ShowInTaskbar = true; window.Title = "Template Editor (Printing)";}private void LoadDictionary(Stream tdfFileStream){ RadDictionary dictionary = new RadDictionary(); dictionary.Load(tdfFileStream); ((DocumentSpellChecker)this.radRichTextBox1.SpellChecker).AddDictionary(dictionary, CultureInfo.CurrentUICulture);}For some reason I cannot get both of the above methods to load together.
Here's the exception and stack trace when I try to show a taskbar icon and change the dictionary to en-GB:
Exception:
NullReferenceException was unhandled
Object reference not set to an instance of an object.
stack trace:
call stack:
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.Layers.DecorationUILayerBase.UpdateViewPort(Telerik.Windows.Documents.UI.Layers.UILayerUpdateContext context = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.Layers.TextDecorationLayers.ProofingErrorsDecorationUILayer.ForceUpdateUIViewPort()
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentPagePresenter.UpdateProofingTextDecoration()
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.UpdateProofingTextDecoration()
Telerik.Windows.Documents.dll!Telerik.Windows.Controls.RadRichTextBox.InvalidateProofingErrors(bool invalidateIncorrectWordsOnly = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Controls.RadRichTextBox.spellChecker_DataChanged(object sender = {unknown}, System.EventArgs e = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.OnDataChanged()
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.AddCustomDictionary(Telerik.Windows.Documents.Proofing.ICustomWordDictionary customDictionary = {unknown}, System.Globalization.CultureInfo culture = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.AddDictionary(System.Lazy<Telerik.Windows.Documents.Proofing.IWordDictionary> lazyDictionary = {unknown}, System.Globalization.CultureInfo culture = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.AddDictionary(Telerik.Windows.Documents.Proofing.IWordDictionary dictionary = {unknown}, System.Globalization.CultureInfo culture = {unknown})
> TemplateEditor.exe!TemplateEditor.Editor2.LoadDictionary(System.IO.Stream tdfFileStream = {unknown})
TemplateEditor.exe!TemplateEditor.Editor2..ctor(int _userID = {unknown})
TAS2.exe!TAS2.SpecEditor.btnTemplateEditor_Click(object sender = {unknown}, System.Windows.RoutedEventArgs e = {unknown})
[External Code]
Any advice would be greatly appreciated.
Thanks,
Rob