Свойство установки привязки DataTrigger не работает

Необходимо изменить видимость кнопки на основе запроса к базе данных. Я пробовал ниже, и это не делает то, что я ожидал. AlarmEnableStatus действительно меняет значение, как и ожидалось, но пользовательский интерфейс не меняется.

HomeView.xaml

<Button x:Name="AlarmButton" Content="Warning!" 
  Margin="12,0,6,0" BorderThickness="1" Width="100" Height="30" 
  Style="{StaticResource AlarmButtonStyle}"
  Foreground="#717171" FontWeight="SemiBold" FontSize="17"/>

-------

<Style x:Key="AlarmButtonStyle" TargetType="Button" BasedOn="{StaticResource CornerRadiusButtonStyle}">
   <Setter Property="Visibility" Value="Visible"/>
   <Style.Triggers>
       <DataTrigger Binding="{Binding AlarmEnableStatus}" Value="False">
            <Setter Property="Visibility" Value="Hidden"/>
       </DataTrigger>
   </Style.Triggers>
</Style>

HomeViewModel.cs

public bool AlarmEnableStatus { get; private set; }

-------

DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(60);
timer.Tick += timer_Tick;
timer.Start();

-------

private void timer_Tick(object sender, EventArgs e)
{
  int isCount = HeaderDataSet.PendingFailedCount;
    if ((!AlarmEnableStatus) & (isCount > 0))
    {
       AlarmEnableStatus = true;      
    }
    else
   {
      AlarmEnableStatus = false;
  }
}

person ITSthe1    schedule 04.02.2020    source источник
comment
Ваше свойство AlarmEnableStatus не запускает уведомление об изменении. Рассмотрите возможность реализации интерфейса INotifyPropertyChanged и активируйте его событие PropertyChanged из установщика свойств.   -  person Clemens    schedule 04.02.2020
comment
Спасибо @Clemens. Не знал о INotifyPropertyChanged   -  person ITSthe1    schedule 05.02.2020