When Windows11Theme is applied before the PdfViewer is initialized the CurrentPageTextBox is not loaded successfully.
Workaround: Set the ApplicationTheme after the InitializeComponent method:
public MainWindow()
{
InitializeComponent();
StyleManager.ApplicationTheme = new Windows11Theme();
}