This is a migrated thread and some comments may be shown as answers.
System.Windows.ResourceDictionary Warning: 9 : Resource not found;
3 Answers 31 Views
This is a migrated thread and some comments may be shown as answers.
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
Psyduck asked on 26 Apr 2021, 06:32 AM

Hello.

 

When we debug or Run the application it works fine but in output window so many lines are coming with warning 

 

 

 

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='AlternativeBrush'; ResourceKey.HashCode='18573990'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='AlternativeBrush'; ResourceKey.HashCode='18573990'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BasicBrush'; ResourceKey.HashCode='1723761'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='MarkerBrush'; ResourceKey.HashCode='35310062'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'

 

When an item is clicked on the parent grid view, the child grid view list is displayed.

Style is not used anywhere. This warning occurs at this time.

 

Implicit noxaml is in use and is version 2021.1.419.45. (Theme :Fluent)

 

 

Thanks.

Hello Kim,

Can you share the XAML showing your RadGridView setup?

- by
Martin Ivanov
Telerik team
on 28 Apr 2021, 10:07 PM

3 Answers, 1 is accepted

Sort by
0
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 29 Apr 2021, 01:25 AM

Plz Check the sources.


<local:RadGridViewRowColorConveter x:Key="RowColorConveter"/>

<telerik:RadGridView ItemsSource="{Binding Rooms}"
					 SelectedItem ="{Binding RoomItem}"
					 ShowColumnHeaders="True"
					 IsFilteringAllowed="True"
					 ShowSearchPanel="True"
					 SearchPanelCloseButtonVisibility="Collapsed"
					 RowIndicatorVisibility="Collapsed" 
					 FrozenColumnsSplitterVisibility="Collapsed"
					 ShowGroupFooters="False"
					 ShowGroupPanel="False"
					 AutoExpandGroups="False"
					 AutoGenerateColumns="False"
					 SelectionMode="Single"
					 >
	<!-- Change Background Color Row -->
	<telerik:RadGridView.RowStyle>
		<Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}">
			<Setter Property="Background" Value="{Binding RoomSegments,Converter={StaticResource RowColorConveter}}"/>
		</Style>
	</telerik:RadGridView.RowStyle>
	<!-- Open View  -->
	<telerik:EventToCommandBehavior.EventBindings>
		<telerik:EventBinding EventName="PreviewMouseDoubleClick"
								Command="{Binding OnDoubleClickViewCommand}"/>
	</telerik:EventToCommandBehavior.EventBindings>

	<telerik:RadGridView.Columns>
		<telerik:GridViewDataColumn Header="Title"	Width="200"	IsReadOnly="True"	DataMemberBinding="{Binding Title}"/>
		<telerik:GridViewColumn Header="View" Width="80" HeaderTextAlignment="Center" TextAlignment="Center">
			<telerik:GridViewColumn.CellTemplate>
				<DataTemplate>
					<telerik:RadButton	Content="View" VerticalAlignment="Center"
										Command="{Binding DataContext.OnClickElementViewCommand, RelativeSource={RelativeSource FindAncestor,AncestorType=telerik:RadGridView}}"
										CommandParameter="{Binding}"
										/>
				</DataTemplate>
			</telerik:GridViewColumn.CellTemplate>
		</telerik:GridViewColumn>
	</telerik:RadGridView.Columns>
</telerik:RadGridView>



public class RadGridViewRowColorConveter : System.Windows.Data.IValueConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if(value is List<RoomSegmentModel>segments)
            {
                foreach (var segment in segments)
                {
                    if (int.TryParse(segment.Value, out _))
                    {
                        return new SolidColorBrush(Colors.Transparent);
                    }
                }
            }

            return new SolidColorBrush(Colors.Yellow);
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }
    }

 

In addition to this, System.Windows.ResourceDictionary Warnin is displayed in other outputs.

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ActiveTabBackgroundBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ClientAreaBackgroundBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ClientAreaForegroundBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ActiveTabBackgroundBrush'

Start Occurs when my dll is loaded when the external program is executed and the button in the external program is pressed.

 

 

Thanks.

1
Martin Ivanov
Telerik team
answered on 30 Apr 2021, 12:23 PM

Hello KIM,

I've tested the setup in a clean WPF project, but I couldn't reproduce any errors. You can check the attached project and let me know if I am missing anything.

Regards,
Martin Ivanov
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/.

I also checked the source you sent, and I also checked the new project I created, but there is no error here.
When checking my original source, an error occurred when the GridView Item was changed.
With a new project I can't catch it. I just try to use Doesn't it matter?
- by
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
on 04 May 2021, 08:47 AM | edited
0
Accepted
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 07 May 2021, 07:15 AM

Hello.

For this problem, I did not set any styles, properties, etc., but I confirmed that an error appeared.

I am using an external application program and its API together.
Here, it was confirmed that this warning appeared when telerik assembly was performed together.

This external application program API also handles controllers such as ComboBox. I guess there is a conflict here.
As shown in the source below, when I execute the external program without taking any action and only assembly, a warning is output.


<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/assembly;component/Resources/NoXaml/Fluent/System.Windows.xaml" />
<ResourceDictionary Source="pack://application:,,,/assembly;component/Resources/NoXaml/Fluent/Telerik.Windows.Controls.GridView.xaml" />
<ResourceDictionary Source="pack://application:,,,/assembly;component/Resources/NoXaml/Fluent/Telerik.Windows.Controls.Input.xaml" />
<ResourceDictionary Source="pack://application:,,,/assembly;component/Resources/NoXaml/Fluent/Telerik.Windows.Controls.Navigation.xaml" />
<ResourceDictionary Source="pack://application:,,,/assembly;component/Resources/NoXaml/Fluent/Telerik.Windows.Controls.xaml" />
</ResourceDictionary.MergedDictionaries>

 

System.Reflection.Assembly.Load($"{telerikName}, Version={Common.TelerikVersion}, Culture={Common.TelerikCulture}, PublicKeyToken={Common.TelerikPublicKeyToken}"); -------------------------------------- System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ClientAreaForegroundBrush' System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ActiveTabBackgroundBrush' System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ClientAreaBackgroundBrush'

 

Is there any way to avoid it?

Thanks.

I will guess that the way the Telerik assemblies are loaded is causing some timing issues with the resources loading so the reported warnings are appearing. However, without be able to re-create this behavior I cannot tell why this happens and if there is a way to resolve it. Anyway, as I understand the Telerik components are working fine after the application is loaded, so if this is the case it sounds safe to ignore the warnings since they seem related to the loading process. 
- by
Martin Ivanov
Telerik team
on 14 May 2021, 06:31 AM
Thank you. Finally. The event is fired when the text box loses focus.
Is there anything that the FluentResourceKey is associated with a 'AlternativeBrush'?
- by
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
on 14 May 2021, 10:54 AM
The AlternativeBrush is simply a key used to access a Brush object through the  FluentResourceExtension class. This dynamic markup extension is used all over the styles and templates of the Telerik's Rad controls. You can see how the extension is used in the Fluent theme article.
- by
Martin Ivanov
Telerik team
on 17 May 2021, 11:43 AM
In "{telerik1:FluentResource ResourceKey=AlternativeBrush}", I changed everything to the static value "#FFF2F2F2" and tested it. About 140 were changed and no warning was output. If so, is there a way to change it all? Telerik Xaml has been modified a lot, but this causes a situation where you need to change it again when you update the version.
- by
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
on 18 May 2021, 08:04 AM
Do you mean you've changed it in the .xaml file with the Telerik styles and templates (like Telerik.Windows.Controls.GridView.xaml)? As you noted, modifying the default styles of Telerik controls come with the price of having extra work when upgrading to a newer version. Anyway, we cannot replace the FluentResource extension usage with a static value on our side, because this way we will loose the color variations ability of the theme.
- by
Martin Ivanov
Telerik team
on 19 May 2021, 12:29 PM
Asked by
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Psyduck
Top achievements
Rank 3
Bronze
Iron
Iron
Martin Ivanov
Telerik team
Share this question
or