Hi Team,
We are using RadNavigation view for our menu control. We are using it in submenu configuration way. We are able to create and navigate to different views. We are using .Net Core with No Xaml configuration. We wanted to have theme option for our entire application. For this we have referred and followed CRM application and created the Theme part same as CRM application. We are able to apply theme and change theme as per choice of user for entire application but we are facing some issues with RadNavigationView control. Below are the challenges that we are facing and something that we want to achieve in our application.
1. We are able to apply the theme but on submenus theme does not get applied also it does not get applied for hover and selected state of the menu. We have tried few approaches and still no success?
2. We want user to select theme once and once they have selected the theme we will save their choice and will open the app in the previously saved theme. We are not able to implement it currently.
We are using NoXAML approach hence we have added necessary files .XAML file in the resource dictionary in App.XAML.
Kindly help us design our application with above 2 points as we are struck in this from few days.
Things we have tried to apply theme colors on hover, for selected menu and for dropdown icon in case of submenu.
<Style x:Key="ItemPreviewStyle" TargetType="telerik:RadNavigationViewItem" BasedOn="{StaticResource RadNavigationViewItemStyle }">
<Setter Property="IconTemplate">
<Setter.Value>
<DataTemplate>
<telerik:RadGlyph Glyph="{Binding Converter={StaticResource StringToGlyphConverter}}"
Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=telerik:RadNavigationViewItem}}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ItemBaseStyle" TargetType="telerik:RadNavigationViewItem" BasedOn="{StaticResource ItemPreviewStyle}">
<Setter Property="Content" Value="{Binding Title}"/>
<Setter Property="ItemsSource" Value="{Binding SubItems}"/>
<Setter Property="Foreground" Value="{theme:VoyagerThemeResource Resource=Foreground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="FocusVisualStyle" Value="{theme:VoyagerThemeResource Resource=AccentBrush}" />
<Setter Property="Icon" Value="{Binding Icon}" />
<Setter Property="IconVisibility" Value="{Binding Icon, Converter={StaticResource NullToVisibilityConverter}}"/>
</Style>
Because of this changes submenus text get the background color but still no affect on hover, selected state and proper theme color of menu. let us know if we are doing anything wrong. Also help us achieving the second case.