StringToGlyphConverter not found ?

1 Answer 115 Views
General Discussions
Romain
Top achievements
Rank 2
Iron
Iron
Romain asked on 16 Nov 2022, 02:35 PM

Hi,

using the nuget Telerik.UI.for.Wpf60 (or70)  (2022.3.1109) it seems like the StringToGlyphConverter isn't found in the resources (resource not found).

The BooleanToVisibilityConverter is found correctly though... It seems that all converters listed on this page are in the resources but the StringToGlyphConverter. 


<Window x:Class="TelerikWpf.Sandbox.MainWindow"
                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"
                Title="MainWindow" Height="350" Width="525">
        <Grid>
        <telerik:RadGlyph Glyph="{Binding GlyphString, Converter={StaticResource StringToGlyphConverter}}"
                          Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>

                
        </Grid>
</Window>

 I was able to make it work by adding it to the resources but I much prefer the "Inline" declaration as other converters (also it is not consistent with the online documentation of the converter. 

<Window x:Class="TelerikWpf.Sandbox.MainWindow"
                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"
                Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <telerik:StringToGlyphConverter x:Key="StringToGlyphConverter"/>
    </Window.Resources>

    <Grid>
        <telerik:RadGlyph Glyph="{Binding GlyphString, Converter={StaticResource StringToGlyphConverter}}"
                          Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
    </Grid>
</Window>

For reference, here the App.xaml:

<Application x:Class="TelerikWpf.Sandbox.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"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
      <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Cloud.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.RichTextBox.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Diagrams.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Diagrams.Extensions.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Diagrams.Ribbon.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.ScheduleView.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.GanttView.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.FileDialogs.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.DataVisualization.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Pivot.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.PivotFieldList.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.ImageEditor.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.VirtualGrid.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Spreadsheet.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.ConversationalUI.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Media.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.SyntaxEditor.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.controls.fixeddocumentviewersui.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.documents.proofing.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.controls.spreadsheetui.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.controls.data.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.controls.chart.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.controls.expressions.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/telerik.windows.controls.fixeddocumentviewers.xaml"/>
          </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
    </Application.Resources>
</Application>

I did a test using the DLL after installation of the latest release (C:\Program Files (x86)\Progress\Telerik UI for WPF R3 2022\Binaries.NoXaml\WPF60) and same issue

I also tested using .Net7 and the correct telerik wpf nuget and same results.

Is it a bug ? 

Thank you for your help

 

1 Answer, 1 is accepted

Sort by
0
Vicky
Telerik team
answered on 17 Nov 2022, 12:02 PM

Hi Romain,

The StringToGlyphConverter is not used by default in the Telerik themes' default styles and templates for the components. It is created as a helper tool for the end users intending to use the glyph elements in MVVM scenarios. This is the reason why this converter is not part of the resources and requires defining it in your app's resources.

To be able to use all converters "inline" as you say, a possible solution is to create a separate ResourceDictionary containing the xaml declarations of the converters that you may need similar to the Example 1: Specifying converters in XAML from the Converters article.

Best Regards,
Vicky
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Romain
Top achievements
Rank 2
Iron
Iron
Answers by
Vicky
Telerik team
Share this question
or