Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style (BackgroundColor) is not reflect correctly when in release mode #14266

Closed
eyeveye opened this issue Mar 29, 2023 · 4 comments
Closed

Style (BackgroundColor) is not reflect correctly when in release mode #14266

eyeveye opened this issue Mar 29, 2023 · 4 comments

Comments

@eyeveye
Copy link

eyeveye commented Mar 29, 2023

Description

Code behind applying the style for label. During debug mode is working but not in release mode.

Example of the code:

<Style x:Key="selectedTabLabel" TargetType="Label"> <Setter Property="HorizontalOptions" Value="FillAndExpand" /> <Setter Property="VerticalOptions" Value="FillAndExpand" /> <Setter Property="HorizontalTextAlignment" Value="Center" /> <Setter Property="VerticalTextAlignment" Value="Center" /> <Setter Property="TextColor" Value="{DynamicResource White}" /> <Setter Property="BackgroundColor" Value="{DynamicResource Primary}" /> </Style>

<Grid ColumnDefinitions="*,auto,*,auto,*" IsClippedToBounds="True" VerticalOptions="FillAndExpand"> <Label x:Name="lblFd" FontAutoScalingEnabled="False" Style="{DynamicResource tabLabel}" Text="A"/> <BoxView Grid.Column="1" BackgroundColor="White" Style="{StaticResource tabBoxview}" /> <Label x:Name="lblToto" Grid.Column="2" FontAutoScalingEnabled="False" Style="{DynamicResource tabLabel}" Text="B"/> <BoxView Grid.Column="3" Style="{StaticResource tabBoxview}" /> <Label x:Name="lblSweep" FontAutoScalingEnabled="False" Grid.Column="4" Style="{DynamicResource tabLabel}" Text="C"/ </Grid>

if(Application.Current.Resources.TryGetValue("selectedTabLabel" + "", out object selectedTabLabel_style) lblFd.Style = selectedTabLabel_style as Style;

Steps to Reproduce

  1. Create a style in style.xaml
  2. Apply a style in code behind

Link to public reproduction project repository

NIL

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

Android33

Did you find any workaround?

No response

Relevant log output

No response

@eyeveye eyeveye added the t/bug Something isn't working label Mar 29, 2023
@eyeveye eyeveye changed the title Style is not reflect correctly when in release mode Style (BackgroundColor) is not reflect correctly when in release mode Mar 29, 2023
@mattleibow
Copy link
Member

Duplicate of #11662

@mattleibow mattleibow marked this as a duplicate of #11662 Mar 29, 2023
@mattleibow
Copy link
Member

Probably fixed in #13836

@gabsamples6
Copy link

@mattleibow hi this is making all our app unworkable, any chance of this being merged in .net 7 next visual studio release? It has such impact if you rely on this for every page in the app

thanks for your time in advance

@ghost
Copy link

ghost commented Apr 22, 2023

Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you!

@ghost ghost locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants