Posted 18 September 2023, 2:40 am EST
Hi Jeff,
Unfortunately, there is no direct way to apply styling to the flexviewer’s toolbar. However, you can consider a workaround of modifying the template of the flexviewer toolbar when the control is loaded. Kindly refer to the following code snippet for implementation:
private void fv_Loaded(object sender, RoutedEventArgs e)
{
var flexViewer = sender as FlexViewer;
var mainToolBar = flexViewer.Template.FindName("mainToolbar", flexViewer) as MainToolbar;
var toolStrip = mainToolBar.Template.FindName("toolBarStack", mainToolBar) as C1ToolStrip;
mainToolBar.Foreground = Brushes.White;
toolStrip.Background = Brushes.DarkBlue;
(mainToolBar.Template.FindName("menuLayout", mainToolBar) as C1MenuTool).Background = Brushes.DarkBlue;
(mainToolBar.Template.FindName("pageNumberTextBox", mainToolBar) as C1TextBox).Foreground = Brushes.DarkBlue;
(mainToolBar.Template.FindName("pageNumberTextBox", mainToolBar) as C1TextBox).CaretBrush = Brushes.DarkBlue;
}
You can further modify the template to achieve the desired behavior. Please refer to the attached sample for full implementation. (See FlexviewerStyle.zip)
Thanks & Regards,
Aastha