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

View file

@ -72,7 +72,11 @@ namespace Bit.App.Pages
public bool 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()

View file

@ -11,6 +11,21 @@
<Setter Property="TextColor"
Value="{StaticResource TextColor}" />
</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 -->
<Style TargetType="ListView"