Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DateNavigator.RefreshCellAppearances() Method

In This Article

Refreshes cell’s appearance.

Namespace: DevExpress.Xpf.Editors.DateNavigator

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

NuGet Package: 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