totp text color changes with DynamicResource

This commit is contained in:
Kyle Spearrin 2019-04-26 12:03:29 -04:00
parent dc0f9847c6
commit a01f9c7351
3 changed files with 22 additions and 1 deletions

View file

@ -110,10 +110,12 @@
Grid.Column="0" /> Grid.Column="0" />
<Label <Label
Text="{Binding TotpSec, Mode=OneWay}" Text="{Binding TotpSec, Mode=OneWay}"
Style="{DynamicResource textTotp}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" Grid.RowSpan="2"
HorizontalOptions="End" HorizontalOptions="End"
HorizontalTextAlignment="End"
VerticalOptions="CenterAndExpand"/> VerticalOptions="CenterAndExpand"/>
<controls:FaButton StyleClass="box-row-button, box-row-button-platform" <controls:FaButton StyleClass="box-row-button, box-row-button-platform"
Text="&#xf0ea;" Text="&#xf0ea;"

View file

@ -72,7 +72,11 @@ namespace Bit.App.Pages
public bool TotpLow public bool TotpLow
{ {
get => _totpLow; get => _totpLow;
set => SetProperty(ref _totpLow, value); set
{
SetProperty(ref _totpLow, value);
Page.Resources["textTotp"] = Application.Current.Resources[value ? "text-danger" : "text-default"];
}
} }
public async Task LoadAsync() public async Task LoadAsync()

View file

@ -11,6 +11,21 @@
<Setter Property="TextColor" <Setter Property="TextColor"
Value="{StaticResource TextColor}" /> Value="{StaticResource TextColor}" />
</Style> </Style>
<Style TargetType="Label"
x:Key="text-default">
<Setter Property="TextColor"
Value="{StaticResource TextColor}" />
</Style>
<Style TargetType="Label"
x:Key="text-danger">
<Setter Property="TextColor"
Value="{StaticResource DangerColor}" />
</Style>
<Style TargetType="Label"
x:Key="text-success">
<Setter Property="TextColor"
Value="{StaticResource SuccessColor}" />
</Style>
<!-- List --> <!-- List -->
<Style TargetType="ListView" <Style TargetType="ListView"