Telerik Forums
UI for WPF Forum
4 answers
231 views

Hi, i'm using PdfViewer and an unhandled ArgumentNullException exception appears periodically on some files.

I saw that there was a already similar error, written in this post   https://www.telerik.com/forums/argumentnullexception-after-scrolling-pdf-document   and that error has been fixed. But i'm using the new version of telerik - 2019.2.618. This error is reproduced in the examples from "xaml-sdk", on FirstLook project.

The error can be reproduced by downloading the file from this link   https://beginners.re/RE4B-EN.pdf. On the 39 page below there is a link that does not have a destination   -   "29 STMFD 30". The 30 link does not link anywhere, and when PdfViewer try to create destination, it falls with exception.
I check the Destination property in GoToActionOld object before create object Destination. It helped for me.

private static GoToAction CreateGoToAction(GoToActionOld source, PdfFormatProvider provider)
{
    Guard.ThrowExceptionIfNull(source, "source");
    if (source.Destination == null)
    {
        return null;
    }
    return new GoToAction
    {
        Destination = CreateDestination(source.Destination, provider)
    };
}

Here is a StackTrace:
System.ArgumentNullException
  HResult=0x80004003
  Сообщение = Значение не может быть неопределенным.
Имя параметра: source
  Источник = Telerik.Windows.Documents.Fixed
  Трассировка стека:
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateDestination(DestinationOld source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateGoToAction(GoToActionOld source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateLinkAnnotation(LinkOld source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateAnnotation(AnnotationOld source, PageOld page, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.CopyAnnotationsFromPageSource(PageOld source, AnnotationCollection annotations)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.LoadPageAnnotations(RadFixedPage page)
   at Telerik.Windows.Documents.Fixed.Model.RadFixedPage.LoadAnnotations()
   at Telerik.Windows.Documents.Fixed.Model.Internal.RadFixedPageInternal.Arrange()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.ThreadSafePageContentManagerOld.LoadPageContent(RadFixedPage page)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.LoadOnDemandPagesCacheManager.BeginUsingPage(RadFixedPage page)
   at Telerik.Windows.Documents.Fixed.UI.VisiblePagesCacheManager.UpdateCachedPages(IEnumerable`1 visiblePages)
   at Telerik.Windows.Documents.UI.FixedDocumentPagesPresenter.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at FirstLook.App.Main()

Please check and correct the error, because I have to keep a separate fixed library.

Martin
Telerik team
 answered on 17 Apr 2020
1 answer
264 views

Telerik version 2020.1.218.45
App.config
dpiAware set true.

ToolWindow AllowTransparency = false.

1.Create the ToolWindow with owner MainWindow on the main monitor with dpi 125.
2. Drag the window onto the second monitor with 100 DPI.
3. I remove the Owner (set null).

Result issue:
Changes the size and position (applies the setting of the monitor DPI)

If you enable the setting dpiAwareness PerMonitor, (after window owner set null) a black square flickers.

boris
Top achievements
Rank 1
 answered on 16 Apr 2020
1 answer
158 views
Hello, I set the font of the paragraph in the richbox to  FangSong(仿宋).But when I save it as docx and opened it  in Word,  it became SimSun(宋体). What do I need to set ? Help me Please,Thanks
Tanya
Telerik team
 answered on 16 Apr 2020
7 answers
336 views

Hi,

 

I am using RadScheduleView for WPF. I have a requirement where I have to set a warning icon for overlapping appointments only. I tried with AppointmentItemContentTemplate="{StaticResource AppointmentTemplate}". However the icon gets displayed in all appointments. Is there any way to set style in such a way that only slots with multiple appointments have warning icon. Please help. 

Attaching the image.

Divya
Top achievements
Rank 1
 answered on 16 Apr 2020
8 answers
556 views
I would like the RadPane to stay the same size when the users drags it to make it go from being docked to being floating, currently it resizes itself. I've seen this thread, but that does not cover how to actually keep it the same size as when it was docked. Possibly another technique would be to use the attached property RadDocking.FloatingSize and bind it to something rather than setting an absolute value, I don't know how this would work though.

thanks
Dinko | Tech Support Engineer
Telerik team
 answered on 16 Apr 2020
3 answers
192 views

Connectors don't appear when ContainerShape's template style customize.

In detail, ContainerShape style is my own Customized one. the style has setter "Template", not "ContentTemplate". 

when used Customized ContentTemplate, then appear Connectors. but used Customized Template, doesn't appear Connectors.

Though it doesn't appear Connectors, Can connect links with other shapes on behind code.

I think it that ContainerShape has connectors, but doesn't appear connector because customize using Template, not ContentTemplate.

but I must use a customized template......
Please, how can I appear Connectors, when I use style to customizing Template.

 

Always Thank you for your help.

Vladimir Stoyanov
Telerik team
 answered on 16 Apr 2020
0 answers
230 views

I am doing data virtualization using VirtualQueryableCollectionView.

I pass there IQueryable from EF.

var db = new ProductionContext();
IQueryable cards = db.Cards.OrderBy(x => x.CardId);
var view = new VirtualQueryableCollectionView(cards) { LoadSize = 50 };
cardsRadGridView.ItemsSource = view;

Its works fine. But how to make it asynchronous? (asynchronous loading, search, filtering) I searched for examples but found only examples for WCF like bellow

https://www.telerik.com/blogs/telerik-data-virtualization-wcf-ria-services-and-visual-studio-async-ctp?_ga=2.125533513.2135094116.1586865074-1480584776.1567419497

I tried to do the same for the EF

var db = new ProductionContext();
IQueryable cards = db.Cards.OrderBy(x => x.CardId);
 
Loaded += async (o, args) =>
{
    var view = new VirtualQueryableCollectionView<Card>
    {
        LoadSize = 50,
        VirtualItemCount = await TaskEx.Run(() => cards.Count())
    };
 
    view.FilterDescriptors.CollectionChanged += async (s, e) =>
    {
        view.VirtualItemCount = await
            TaskEx.Run(() => cards.Where(view.FilterDescriptors).Count());
    };
 
    view.FilterDescriptors.ItemChanged += async (s, e) =>
    {
        view.VirtualItemCount = await
            TaskEx.Run(() => cards.Where(view.FilterDescriptors).Count());
    };
 
    view.ItemsLoading += async (s, e) =>
    {
        var queryToLoad = cards
            .Sort(view.SortDescriptors)
            .Where(view.FilterDescriptors)
            .Skip(e.StartIndex)
            .Take(e.ItemCount);
 
        cardsRadGridView.IsBusy = true;
        view.Load(e.StartIndex, await TaskEx.Run(() => queryToLoad.ToIList()));
        cardsRadGridView.IsBusy = false;
    };
 
    cardsRadGridView.ItemsSource = view;
};

but it does not work(

Where can one find a good example of implementing this?

Denis
Top achievements
Rank 1
 asked on 16 Apr 2020
9 answers
1.9K+ views
Do you guys have any plans to implement a WPF status bar or is there a good way/example of using the toolbar control to imitate a status bar?

Thanks! 
Martin Ivanov
Telerik team
 answered on 15 Apr 2020
1 answer
132 views
When remove last bracket (>) in the XML with registered XmlFoldingTagger we get unhandled exception in the function GetFoldingRegionTitle because you are trying call Substring with -1 parameter.
Petar Mladenov
Telerik team
 answered on 15 Apr 2020
1 answer
599 views

I am rendering 50,000 data points per seconds one 3 charts my UI freezes at that point... I am running 3 charts updating in real time with new data points coming in every second so I add them to the collection, I am implementing data virtualization for the scrolling but when scrolled out and a large number of samples is where I see the freeze. They are scatter series and I am not using a point template I have rendering set to bitmap and "Batch" Is there any other ways to significantly improve the performance? My process is only using 20-30% CPU and 400-600mb ram I have tried it on a box with a GPU also with no better result... I am stumped on this one guys.

 

Thanks!

Dinko | Tech Support Engineer
Telerik team
 answered on 15 Apr 2020
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?