Skip to main content
A newer version of this page is available. .
All docs
V20.2

DateNavigator.RefreshCellAppearances() Method

Refreshes cell’s appearance.

Namespace: DevExpress.Xpf.Editors.DateNavigator

Assembly: DevExpress.Xpf.Core.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core

Declaration

public void RefreshCellAppearances()

Remarks

The RefreshCellAppearances method raises the RequestCellAppearance event for each displayed cell and clears the cell’s cached appearance values.

The following code sample resets the 09.18.2020 cell’s cached appearance values when you click the RefreshButton button:

<Window ...
  xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
  <StackPanel>
    <dxe:DateNavigator x:Name="DateNav" CalendarView="Month" RequestCellAppearance="DateNav_RequestCellAppearances">
      <dxe:DateNavigator.Appearance>
        <dxe:DateNavigatorCellAppearance>
          <dxe:DateNavigatorCellAppearance.SelectedState>
            <dxe:DateNavigatorStateAppearance Background="LightCyan" Foreground="Black" BorderThickness="1" BorderBrush="Black"/>
          </dxe:DateNavigatorCellAppearance.SelectedState>
        </dxe:DateNavigatorCellAppearance>
      </dxe:DateNavigator.Appearance>
    </dxe:DateNavigator>

    <Button x:Name="RefreshButton" Click="Button_Click"/>
  </StackPanel>
</Window>
private void DateNav_RequestCellAppearances(object sender, DevExpress.Xpf.Editors.DateNavigator.DateNavigatorRequestCellAppearancesEventArgs args) {
    DateTime day = new DateTime(2020, 9, 18);
        if (args.DateTime.Date == day && args.CellState.HasFlag(DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarCellState.Selected))
        {
            args.Appearance.Background = Brushes.Blue;
            args.Appearance.Foreground = Brushes.White;
            args.CacheValue = true;
        }
}

private void Button_Click(object sender, RoutedEventArgs e)
    {
        DateNav.RefreshCellAppearances();
    }
See Also