C#C
C#3y ago
Elio

❔ ResourceDisctionary With Converter

Hello, i do not understand why my converter imageResourceConverter isn't found when i start my application any idea ?
The error : Exception: Could not find resource named "imageResourceConverter". Resource names are case sensitive.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

        <Style x:Key="CircularButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="50"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Ellipse Fill="Transparent"/>
                        <Image Source="{Binding Tag, Converter={StaticResource imageResourceConverter}}"/>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>


<Application x:Class="EasyrollV5.WPF.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:EasyrollV5.WPF"
             xmlns:converter="clr-namespace:EasyrollV5.WPF.Converters" >
    
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/Styles/ButtonStyle.xaml"/>
                <ResourceDictionary Source="Resources/DesignDictonary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <converter:ImageResourceConverter x:Key="imageResourceConverter"/>
        </ResourceDictionary>
    </Application.Resources>
</Application>
Was this page helpful?