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
public class ComboBoxColumn : GridViewBoundColumnBase { ######################shorted############################## public event SelectionChangedEventHandler SelectionChanged; private void OnSelectionChanged( object sender, SelectionChangedEventArgs e ) { var myEvent = this.SelectionChanged; if( myEvent != null ) { myEvent( this, e ); } } private void ComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e ) { this.OnSelectionChanged( sender,e ); } ######################shorted############################## public override FrameworkElement CreateCellEditElement( GridViewCell cell, object dataItem ) { this.BindingTarget = RadComboBox.SelectedValueProperty; var comboBox = new RadComboBox { ItemsSource = this.ItemsSource, DisplayMemberPath = this.DisplayMemberPath, SelectedValuePath = this.SelectedValuePath }; comboBox.SelectionChanged += this.ComboBoxSelectionChanged; comboBox.SetBinding( this.BindingTarget, this.CreateValueBinding( ) ); return comboBox; }