I try to use the PdfViewer in an addin (using the .net managed addin framework), hosted in a winform host application. When I open a pdf file I get this exception:
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Utils.Helper.get_Dispatcher() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\Core\FormatProviders\Pdf\Utils\Helper.cs:line 25
at Telerik.Windows.Documents.Fixed.FixedDocumentStreamSource.<>c__DisplayClass8.<LoadDocument>b__6() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\FixedDocumentViewers\Fixed\FixedDocumentStreamSource.cs:line 180
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I suspect the helper class is using Application.Current.Dispatcher. Application.Current is null in our environment.
Is there a work around for this problem so I can use the viewer in an addin?
Thank you,
Fonger.
FrameworkElementFactory slider = new FrameworkElementFactory(typeof(RadSlider));slider.SetBinding(RadSlider.ValueProperty, new Binding(path) { Mode = BindingMode.TwoWay });slider.SetValue(RadSlider.MinimumProperty, 0);slider.SetValue(RadSlider.MaximumProperty, 100);slider.SetValue(Grid.ColumnProperty, 1);+ Thrown: "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Telerik.Windows.Controls.Docking.g.resources" was correctly embedded or linked into assembly "Telerik.Windows.Controls.Docking" at compile time, or that all the satellite assemblies required are loadable and fully signed." (System.Resources.MissingManifestResourceException) Exception Message = "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"Telerik.Windows.Controls.Docking.g.resources\" was correctly embedded or linked into assembly \"Telerik.Windows.Controls.Docking\" at compile time, or that all the satellite assemblies required are loadable and fully signed.", Exception Type = "System.Resources.MissingManifestResourceException", Exception WinRT Data = null + Thrown: "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Telerik.Windows.Controls.GridView.g.resources" was correctly embedded or linked into assembly "Telerik.Windows.Controls.GridView" at compile time, or that all the satellite assemblies required are loadable and fully signed." (System.Resources.MissingManifestResourceException) Exception Message = "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"Telerik.Windows.Controls.GridView.g.resources\" was correctly embedded or linked into assembly \"Telerik.Windows.Controls.GridView\" at compile time, or that all the satellite assemblies required are loadable and fully signed.", Exception Type = "System.Resources.MissingManifestResourceException", Exception WinRT Data = null + Thrown: "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Telerik.Windows.Controls.Data.g.resources" was correctly embedded or linked into assembly "Telerik.Windows.Controls.Data" at compile time, or that all the satellite assemblies required are loadable and fully signed." (System.Resources.MissingManifestResourceException) Exception Message = "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"Telerik.Windows.Controls.Data.g.resources\" was correctly embedded or linked into assembly \"Telerik.Windows.Controls.Data\" at compile time, or that all the satellite assemblies required are loadable and fully signed.", Exception Type = "System.Resources.MissingManifestResourceException", Exception WinRT Data = null public partial class App { static App() { DispatcherHelper.Initialize(); Thread.CurrentThread.CurrentCulture = new CultureInfo("en"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); LocalizationManager.Manager = new CustomLocalizationManager(); } }I looking for an event to handle before RadDataForm.CurrentItemChanged happens.
At CurrentItemChanged, the CurrentItem is already the new item, but I need to carry out some operations on the old item.
So I'm looking for something like "BeforeCurrentItemChanged" or "PreviewCurrentItemChanged" or "CurrentItemChanging" etc.
var grid = TableGrid; List<string> headers = new List<string>(from h in grid.ColumnHeaders.AsQueryable() select h.FriendlyName); int idColumn = headers.FindIndex(x => x == "Id") + 1; int productTypeColumn = headers.FindIndex(x => x == "Product Type") + 1; int titleColumn = headers.FindIndex(x => x == "Title") + 1; Collection<Collection<string>> contents = new Collection<Collection<string>>(); foreach(var row in grid.Rows) { var cells = row.GetChildren(); contents.Add(new Collection<string>() { cells[idColumn].FriendlyName, cells[productTypeColumn].FriendlyName, cells[titleColumn].FriendlyName }); } return contents;