NavigationItem Background and IsEnabled

Hello,

How can I change Background of NavigationItem? I've tried to change it in Template, but without success.


 <syncfusion:NavigationItem
                        Margin="5,130,0,0"
                        Background="Red"
                        Command="{Binding ClickCommand}"
                        CommandParameter="New"
                        Foreground="Black"
                        Header="What's New">
<Grid                    Name="NavigationDrawerContentView"                    Grid.Row="2"                    Background="Transparent">                    <ScrollViewer Background="Transparent" VerticalScrollBarVisibility="Auto">                        <syncfusion:NavigationView                            x:Name="DrawerContent"                            HorizontalAlignment="Stretch"                            Background="Transparent"                            BorderThickness="0"                            Focusable="False"                            IsTabStop="False"                            ItemContainerStyle="{Binding ItemContainerStyle, RelativeSource={RelativeSource TemplatedParent}}"                            ItemTemplate="{Binding ItemTemplate, RelativeSource={RelativeSource TemplatedParent}}"                            ItemTemplateSelector="{Binding ItemTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"                            ItemsSource="{Binding Items, RelativeSource={RelativeSource TemplatedParent}}"                            ScrollViewer.HorizontalScrollBarVisibility="Disabled" />                    </ScrollViewer>                </Grid>                <Grid

1 Reply

SS Suganya Sethuraman Syncfusion Team October 11, 2021 10:40 AM UTC

Hi David,

Greetings from Syncfusion.

We have analyzed your query. We recommend that you use Theme in your project to change the background color of each NavigationItem. We created the sample with the MaterialLight theme and set the Background color of each NavigationItem as shown in the code snippet below.

Xaml
 
            <syncfusion:NavigationItem Header="Sample Page 1" Background="Red"> 
                <syncfusion:NavigationItem.Icon> 
                    <Path 
                        Width="10" 
                        Height="16" 
                        HorizontalAlignment="Center" 
                        VerticalAlignment="Center" 
                        Data="{StaticResource MenuItem1}" 
                        Fill="{Binding RelativeSource={RelativeSource Mode=Self}, Path=(TextBlock.Foreground)}" 
                        Stretch="Fill" /> 
                </syncfusion:NavigationItem.Icon> 
            </syncfusion:NavigationItem> 

C#
 
  public MainWindow() 
        { 
            InitializeComponent(); 
 
            SfSkinManager.SetTheme(this, new Theme("MaterialLight")); 
        } 

Please have a sample for your reference,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ThemeBackground-791509233

Please check if the sample satisfies your requirement and let us know if you have any concerns.

Regards,
Suganya Sethuraman.
 
 


Loader.
Up arrow icon