Warning, Resource not found FluentResourceKey. Other program conflicts

1 Answer 237 Views
GridView Styling
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Psyduck asked on 08 Jun 2021, 01:37 AM | edited on 08 Jun 2021, 01:43 AM

Hello.

I've written a similar post before

At that time, there was not much warning output, so I didn't care.
But if I get a lot of Resource not found output, I've seen the design load slowly.

Also, the warning didn't come up when I made a general sample project.
When I use it as a module in another program, it happens.

I used [Row Number] of GridView for Telerik Demo.
I used an implicit style and found this in CellStyle.

 

The GirdViewCell implicit style is as follows, and all warnings are printed for the ResourceKey of telerik1.

    <Style x:Key="GridViewCellStyle" TargetType="grid:GridViewCell">
        <Setter Property="Template" Value="{StaticResource GridViewCellTemplate}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik1:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="SelectedBackground" Value="{telerik1:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="CurrentBorderBrush" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="MouseOverBackground" Value="{telerik1:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualStyle}"/>
    </Style>

 

 

If this is used, the above warning of the image is output.

<behaviour:GridViewRowNumber.CellStyle>
    <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
	<Setter Property="Background" Value="LightGray"/>
	<Setter Property="TextBlock.TextAlignment" Value="Center"/>
    </Style>
</behaviour:GridViewRowNumber.CellStyle>

 

However, if you find a property in an implicit style for this warning output and wrap it in style, it does not appear.

<behaviour:GridViewRowNumber.CellStyle>
    <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
	<Setter Property="Background" Value="LightGray"/>
	<Setter Property="TextBlock.TextAlignment" Value="Center"/>
	<Setter Property="FontSize" Value="12"/>
	<Setter Property="FontFamily" Value="Segoe UI"/>
	<Setter Property="BorderBrush" Value="Transparent"/>
	<Setter Property="SelectedBackground" Value="Transparent"/>
	<Setter Property="CurrentBorderBrush" Value="Transparent"/>
	<Setter Property="MouseOverBackground" Value="Transparent"/>
    </Style>
</behaviour:GridViewRowNumber.CellStyle>


The explanation was a bit long.

Here I want to know two things.

first. When the program crashes and opens a window, is there a way to find and apply the implicit style again?
When loading the program, all styles are read, but when the window is opened, it is assumed that the warning will not occur if read again.

second. If there is no solution, please tell me where to set ValidationBrush, PrimaryBackgroundBrush, and FocusThickness.

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 25 Jun 2021, 01:13 AM | edited on 25 Jun 2021, 10:15 AM

hello.

why is there no answer If it is a situation that cannot be resolved, please tell me that it should not be done.
I still haven't been able to solve it.

<Style x:Key="GridViewCellStyle" TargetType="grid:GridViewCell">
        <Setter Property="Template" Value="{StaticResource GridViewCellTemplate}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik1:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="SelectedBackground" Value="{telerik1:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="CurrentBorderBrush" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="MouseOverBackground" Value="{telerik1:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualStyle}"/>
    </Style>

 

The above warnings correspond to template(pink line) resource keys here.

<ControlTemplate x:Key="GridViewCellTemplate" TargetType="grid:GridViewCell">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="HighlightStates">
                    <VisualState x:Name="NotHighlighted"/>
                    <VisualState x:Name="Highlighted">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <SolidColorBrush Color="#2B00BFE8"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="PART_CellBorder"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding VerticalGridLinesBrush}"
                    BorderThickness="{Binding VerticalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Right}"
                    Margin="0 0 0 1"/>
            <Border x:Name="Background_Over"
                    Background="{TemplateBinding MouseOverBackground}"
                    BorderBrush="{TemplateBinding VerticalGridLinesBrush}"
                    BorderThickness="{Binding VerticalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Right}"
                    Visibility="Collapsed"/>
            <Border x:Name="Background_Invalid_Unfocused" Visibility="Collapsed" Background="{telerik1:FluentResource ResourceKey=ValidationBrush}" Opacity="0.3"/>
            <Border x:Name="Background_Selected"
                    Background="{TemplateBinding SelectedBackground}"
                    BorderBrush="{TemplateBinding VerticalGridLinesBrush}"
                    BorderThickness="{Binding VerticalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Right}"
                    Margin="0 0 0 1"
                    Visibility="Collapsed"/>
            <Border x:Name="Background_Current"
                    BorderThickness="{telerik1:FluentResource ResourceKey=FocusThickness}"
                    Background="{x:Null}"
                    Opacity=".8"
                    BorderBrush="{TemplateBinding CurrentBorderBrush}"
                    Visibility="Collapsed"
                    Margin="0 0 1 1"/>
            <Border x:Name="Background_Invalid"
                    BorderBrush="{telerik1:FluentResource ResourceKey=ValidationBrush}"
                    Background="{telerik1:FluentResource ResourceKey=PrimaryBackgroundBrush}"
                    BorderThickness="1"
                    Visibility="Collapsed">
                <ToolTipService.ToolTip>
                    <ToolTip x:Name="validationTooltip" Placement="Right" Content="{TemplateBinding Errors}" Template="{StaticResource GridViewValidationToolTipTemplate}"/>
                </ToolTipService.ToolTip>
                <Grid Background="Transparent" HorizontalAlignment="Right" Height="18" VerticalAlignment="Top" Width="18">
                    <Path
                            Data="{StaticResource ArrowTopRight8x8}"
                            Fill="{telerik1:FluentResource ResourceKey=ValidationBrush}"
                            Width="8"
                            Height="8"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Top"
                            Margin="0 -1 -1 0"/>
                </Grid>
            </Border>
            <ContentControl x:Name="PART_ContentPresenter"
                    Margin="{TemplateBinding Padding}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    VerticalContentAlignment="Stretch"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalContentAlignment="Stretch"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    TextBlock.FontSize="{TemplateBinding FontSize}"
                    TextBlock.FontFamily="{TemplateBinding FontFamily}"
                    IsTabStop="{TemplateBinding IsTabStop}"/>
        </Grid>
......
</>

 

A warning is output even if the template in the style is written out.

Even if you set xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" and write the contents in the template, a warning appears as it is.


Is there a way to redefine
Please let me know if there is a way to directly add a resource dictionary with templates to the window.

 

I'll wait for your reply.

Thanks.

 

Martin Ivanov
Telerik team
commented on 29 Jun 2021, 10:59 AM

We are not aware of the reported errors. Probably something is up with the specific setup (the separate module you mentioned earlier). I would suggest you to attach a small example here in the forum (or in a new support ticket) along with description of the concrete setup. This way we can take a look and see if we can help.

 
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
commented on 29 Jun 2021, 12:33 PM | edited

Thank you for answer.
This is not possible to implement in the usual way.
It is a problem that can be known only by installing and running other programs.
Because I am developing in 'Class Library' format.

I wonder if I can get technical support (?) on this rather than a forum.
If possible, what should I do?
Martin Ivanov
Telerik team
commented on 30 Jun 2021, 11:44 AM

You can check the How To Submit a Support Ticket blog post.
Tags
GridView Styling
Asked by
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Share this question
or