Telerik Forums
UI for WPF Forum
0 answers
140 views

As of 2024 Q2, we will deprecate .NET Framework 4.0, .NET Framework 4.5, and .NET Core 3.1 distributions. This decision is rooted in our dedication to align with Microsoft’s recommended framework versions so that our products leverage the latest advancements in technology, security, and performance.

We are aligning our product with Microsoft’s lowest-supported framework versions for .NET Framework and .NET, respectively. Please refer to the following blog post:

Product Update for Enhanced Performance and Security (telerik.com)

For more information about how to upgrade your project's .NET Framework version, you can check the following MSDN article:

Migration Guide to .NET Framework 4.8, 4.7, and 4.6.2 - .NET Framework | Microsoft Learn


Stenly
Top achievements
Rank 1
 asked on 30 Jan 2024
0 answers
23 views

In my code I have a implemented method which in some cases can append new text for existing archive entry. But when I tried this code it gives me a System.ArgumentException: 'An item with the same key has already been added. Key: dir/file.csv'. This exception occurs in situations when given entryName will be something like this 'dir//file.csv''.  This small difference does not allow archive.GetEntry(entryName) return something else then null.

public void Insert(Stream stream, string entryName, bool append = false)
{
    using var baseStream = FileSystem.FileStream.New(ArchivePath, FileMode.Open, FileAccess.ReadWrite);
    using var archive = new ZipArchive(baseStream, ZipArchiveMode.Update, false, null, compressionSettings, encryptionSettings);

    var entry = archive.GetEntry(entryName); // null
    var entryStream = append
        ? entry?.Open() ?? archive.CreateEntry(entryName).Open() //exception cause already exists
        : archive.CreateEntry(entryName).Open(); 
    stream.Position = 0;
    if (append) entryStream.Seek(0, SeekOrigin.End);
    stream.CopyTo(entryStream);
    entryStream.Flush();
}

 

 

Kostiantyn
Top achievements
Rank 1
Iron
 asked on 06 Feb 2024
0 answers
47 views
I have an application where it contains a RadPane. When the user hover overs the pane, it opens up a RadGridView which contains a list. When the pane is pinned, user can click on the GridView and work with it. However when the pane is unpinned, Pane closes on clicking the RadGridView. The expectation is that, it should work exactly like the pinned RadPane.



Tried adding a CustomFlyoutBehavior which implements IFlyoutBehavior and tried working with OnPaneDeactivated, but the event is not getting hit when the RadPane closes on clicking the GridView. 

Thanks in advance.
Nikhil
Top achievements
Rank 1
 updated question on 30 Oct 2023
0 answers
72 views

Good day. I have functionality in my WPF application that allows the user to change the font size, font style, and theme variations at runtime, see code below. This functions perfectly when it works. 

 

The issue I am having is that when making changes to these values at runtime, the changes intermittently stop being applied. The way I understand theming is that I should be able to make these changes at runtime and they are automatically applied. Something is getting borked up causing the changes to stop being applied during runtime.

 

C#, WPF .NET 6

Theme: Office 2019

Telerik Version: 2023.1.117

I'm using the package Telerik.UI.Wpf.NetCore.Xaml for all controls. Theme packages come from No XAML.

 

// Theme Color Variation// High Contrast
Office2019Palette.LoadPreset(Office2019Palette.ColorVariation.HighContrast);

// Dark/Light Mode
if (RegistryHelper.IsWindowsDarkMode())
    Office2019Palette.LoadPreset(Office2019Palette.ColorVariation.Dark);
else
    Office2019Palette.LoadPreset(Office2019Palette.ColorVariation.Light);


// Change Font Family
Office2019Palette.Palette.FontFamily = new FontFamily(Settings.Default.FontFamily);


// Font Size
Telerik.Windows.Controls.Office2019Palette.Palette.FontSizeS = 10;
Telerik.Windows.Controls.Office2019Palette.Palette.FontSize = 12;
Telerik.Windows.Controls.Office2019Palette.Palette.FontSizeL = 14;

 

App.xaml for Telerik:

<prism:PrismApplication x:Class="Wpf.App"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                        xmlns:prism="http://prismlibrary.com/">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>

                <!-- Telerik -->
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />

            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</prism:PrismApplication>

 

Justin
Top achievements
Rank 2
Iron
 updated question on 20 Sep 2023
0 answers
32 views

Sometimes when I paste a test intro en empty RadMaskedTextInput, the application crushes and the following error occurs:

 

FATAL Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

                at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteNoMask(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteOverride(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedInputBase.HandlePaste()

   at Telerik.Windows.Controls.RadMaskedInputBase.OnApplicationPaste(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)

   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)

   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)

   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.InputManager.ProcessStagingArea()

   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

   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)


0 answers
73 views

I think that this is a general question: I have a RadDocking with document host. Generally I can load many tab inside the panel, every tab has his viewmodel that it is an instance of the same class.
When I binding a control property to a viewmodel property I need to bind it to the correct instance.
Now I use binding in code behind using a variable index such as 

pane.SetBinding(RadPane.HeaderProperty, new Binding()
{
    Path = new($"MainVM.Partitions[{_vm.MainVM.PartitionAttiva.Partition.Id}])
});
Is not important the meaning of pieces, the important is the dynamic index that stand for the tab index.

My question is if is there a more standard method to achieve this goal
Thank you 
Luigi
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 28 Jun 2023
0 answers
171 views

I get the following error when I try to add a Telerik WPF Form

Project template

Adding a WFP forms triggers this and nothing added?

So I tried a WPF .NET Core template and got prompted for this"

 

No idea how to proceed ... just trying to create a new project?

Rob.

Rob
Top achievements
Rank 2
Iron
Iron
 asked on 22 Feb 2023
0 answers
59 views

I have documents that when saved as a .docx file and opened in Word, they display correctly.

The same document when viewed in the TK Viewer distorts (moves) the position of the elements of the document.

It is adding space where it should not be and wrapping words where they should be on a single line.

I'm attaching a short screenshot of the document in TK View as well as in Word to show difference. It is happening everywhere in the document, but just this screenshot for brevity.

Is there a setting to force it to render exactly as the display in word? Some way to resolve this?

billy
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 22 Apr 2022
0 answers
108 views

Hi,

I just upgrade my solution from telerik wpf 2021.1.325.310  to 2021.3.914.45. I performed the wizard upgrade but after restart vs2019, and rebuild of solution I get runtime exceptions like this: 
'The invocation of the constructor on type 'Telerik.Windows.Controls.RadBusyIndicator' that matches the specified binding constraints threw an exception.' Line number '50' and line position '3'.
If I delete RadBusyIndicator:

''The invocation of the constructor on type 'Telerik.Windows.Controls.RadNotifyIcon' that matches the specified binding constraints threw an exception.' Line number '56' and line position '5'.'

And so on...
I restored old version and I'm waiting for help.
Thank you

Luigi

 

Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 09 Nov 2021
0 answers
61 views

Hello,

we have an application running in Silverlight an WPF (we ported it from Silverlight to WPF some time ago, and it can run in both frameworks).

In Silverlight we had no memory problems, everything ist cleared an disposed by us (looping the visual/logical tree,..).

In WPf we have some weird meomry leaks and I´m not able to track them down further.

Some of them root just to Telerik controls and I see not why...

I attached some JustTrace screenshots...

 

 

 

 

 

 

Dominic
Top achievements
Rank 1
 asked on 02 Nov 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?