This was reported in the Code11 and Code39 symbologies.
In the old RadBarcode39 and RadBarcode11 controls the minimum width where the barcode cannot be read any longer is around 180px in the specific scenario.
In the new RadBarcode and its Code11 and Code39 symbologies, the minimum width is different - around 270px. This reproduces when the SizingMode of the symbology is set to Stretch.
To work this around, you can set the SizingMode of the symbology to Snap. Or alternatively, you can use a bigger Width value for the barcode control, and then apply a ScaleTransform to resize it to the smaller size.
private void RadBarcode_Loaded(object sender, RoutedEventArgs e)
{
var barcode = (RadBarcode)sender;
var desiredWidth = 250;
double relativeWidthDelta = desiredWidth / barcode.ActualWidth;
barcode.LayoutTransform = new ScaleTransform() { ScaleX = relativeWidthDelta };
}
When the RadScheduleView has a recurring appointment with no end date for its recurrence in certain scenarios multiple errors can be try/catch-ed internally, which leads to a degraded performance. One such scenario is when a recurring appointment with no end date starts before the currently displayed time period, but does not have any occurrences before the displayed time period.
As a workaround, an end date can be added to the recurrence rule of recurring appointments.
ArgumentException is thrown on mouse up, after using the DrawTool or ShapeTool in RadImageEditor or RadImageEditorUI.
The exception message is: "'∞' is not a valid value for property 'Width'."
The stacktrace is:
System.ArgumentException: '8' is not a valid value for property 'Width'. at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Telerik.Windows.Media.Imaging.Commands.DrawCommand.Execute(RadBitmap source, Object context) at Telerik.Windows.Media.Imaging.History.ImageHistory.Execute(IImageCommand command, Object context) at Telerik.Windows.Controls.RadImageEditor.ExecuteCommand(IImageCommand command, Object context) at Telerik.Windows.Controls.RadImageEditor.CommitTool(Boolean executeSameToolAfterCommit) at Telerik.Windows.Media.Imaging.Tools.DrawToolBase.InvokeEndDraw(Point point) at Telerik.Windows.Media.Imaging.Tools.DrawToolBase.DrawingCanvas_MouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
To work this around, you can create a custom DrawCommand based on the code from the default one and then replace it in the ShapeTool and DrawTool.
public class CustomDrawTool : DrawTool
{
public override IImageCommand GetCommand()
{
return new CustomDrawCommand();
}
}
public class CustomShapeTool : ShapeTool
{
public override IImageCommand GetCommand()
{
return new CustomDrawCommand();
}
}
public class CustomDrawCommand : IImageCommand
{
public RadBitmap Execute(RadBitmap source, object context)
{
DrawCommandContext drawCommandContext = context as DrawCommandContext;
if (drawCommandContext == null || drawCommandContext.DrawnPath == null)
{
return source;
}
Canvas canvas = new Canvas();
canvas.ClipToBounds = true;
var dpiXFactor = source.Bitmap.DpiX / 96;
var dpiYFactor = source.Bitmap.DpiY / 96;
double imageWidth = source.Width / dpiXFactor;
if (imageWidth == double.PositiveInfinity)
{
imageWidth = source.Width;
}
double imageHeight = source.Height/ dpiYFactor;
if (imageHeight == double.PositiveInfinity)
{
imageHeight = source.Height;
}
canvas.Children.Add(new System.Windows.Controls.Image()
{
Source = source.Bitmap,
Width = imageWidth,
Height = imageHeight,
});
Panel parent = drawCommandContext.DrawnPath.Parent as Panel;
if (parent != null)
{
parent.Children.Remove(drawCommandContext.DrawnPath);
drawCommandContext.DrawnPath.RenderTransform = new ScaleTransform(1 / dpiXFactor, 1 / dpiYFactor);
canvas.Children.Add(drawCommandContext.DrawnPath);
}
RenderOptions.SetBitmapScalingMode(canvas, BitmapScalingMode.NearestNeighbor);
BitmapSource bitmapSource = this.GetBitmapSource(source.Width, source.Height, canvas, source.Bitmap.DpiX, source.Bitmap.DpiY);
return new RadBitmap(bitmapSource);
}
private BitmapSource GetBitmapSource(int width, int height, Canvas canvas, double dpiX, double dpiY)
{
Size size = new Size(width, height);
canvas.Measure(size);
canvas.Arrange(new Rect(size));
RenderTargetBitmap renderBitmap = new RenderTargetBitmap(width, height, dpiX, dpiY, PixelFormats.Pbgra32);
renderBitmap.Render(canvas);
return renderBitmap;
}
}
<telerik:ImageToolItem ImageKey="Draw" telerik:LocalizationManager.ResourceKey="ImageEditor_Draw" Command="commands:ImageEditorRoutedCommands.ExecuteTool">
<telerik:ImageToolItem.CommandParameter>
<local:CustomDrawTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
A SocketException can occur when the ImageInline source is assigned to a link pointing to a picture on a remote server (a website). For example: UriSource ="https://docs.telerik.com/devtools/wpf/knowledge-base/images/kb-chartview-categorical-and-datetime-axis-0.png"
This could happen during the fetching of the image stream. In some cases, the server may give a NetworkStream or ConnectionStream, or similar Stream implementation, which keeps an open connection between the application and the server. If the connection get severed during the stream reading, an exception is thrown.
The exception message is: "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
The stacktrace is:
Exception Info: System.Net.Sockets.SocketException
at System.Net.Sockets.NetworkStream.Read(Byte[], Int32, Int32)
Inner Exception:
Exception Info: System.IO.IOException
at System.Net.ConnectStream.Read(Byte[], Int32, Int32)
at System.IO.Stream.InternalCopyTo(System.IO.Stream, Int32)
at Telerik.Windows.Documents.Layout.ExtensionMethods.ToMemoryStream(System.IO.Stream)
at Telerik.Windows.Documents.Model.ImageInline.<SetStreamFromUriSource>b__0(System.Object, StreamReadyEventArgs)
at Telerik.Windows.Documents.Utils.ResourceStreamLocator.OnStreamReady()
at System.Net.WebClient.OnOpenReadCompleted(System.Net.OpenReadCompletedEventArgs)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
When the TitleBarVisibility is Collapsed, the backstage close button is aligned with the top of the backstage adorner. The button should have a top margin applied.
This reproduces when the BackstagePosition property of RadRibbonBackstage is set to Office2013, which is the default setting of newer Telerik themes.
To work this around, get the backstage close button and set its top margin.
private void RadRibbonBackstage_Loaded(object sender, RoutedEventArgs e)
{
var backstage = (RadRibbonBackstage)sender;
var closeButton = backstage.FindChildByType<RadRibbonButton>();
closeButton.Margin = new Thickness(closeButton.Margin.Left, 15, closeButton.Margin.Right, closeButton.Margin.Bottom);
}