-
Notifications
You must be signed in to change notification settings - Fork 136
Description
Is your feature request related to a specific issue? Please describe it.
I don't understand: what are the available ways to change the icon size in a NavigationViewItem?
Describe your desired solution
I would like to be able to control IconSource parameters (especially size).
Describe the alternatives you considered
I tried:
- Changing the FontSize in the source data
- Creating my own Item content (this broke the layout of the elements, especially when expanding the panel)
- Applying styles (ViewBox IconBox Height, when changed in DevTools, produces the desired result, but the style setter doesn't change it for some reason)
Additional Context
NavigationPage:
public abstract class NavigationPage : NavigationPageBase
{
public string Name { get; set; } = string.Empty;
public IconSource Icon { get; set; }
public string ToolTip { get; set; } = string.Empty;
public bool IsFooter { get; set; } = false;
public abstract Type ViewModelType { get; }
}
ViewModel:
Pages =
[
new Common.Separator(),
new NavigationPage { Name = "Product", Icon = new SymbolIconSource { Symbol = Symbol.CalculatorFilled, Foreground=Brushes.ForestGreen, FontSize=32}, ToolTip = "Test tooltip"},
];
View:
<ui:NavigationView x:Name="nvMain"
PaneDisplayMode="LeftCompact"
MenuItemsSource="{Binding Pages}"
SelectedItem="{Binding SelectedPage}"
CompactPaneLength="64">
ui:NavigationView.MenuItemTemplateSelector
vmc:MenuItemTemplateSelector
<ui:NavigationViewItem IconSource="{Binding Icon}" Height="48" ToolTip.Tip="{Binding ToolTip}" Cursor="Hand" >
</ui:NavigationViewItem>
vmc:MenuItemTemplateSelector.SeparatorTemplate
<ui:NavigationViewItemSeparator />
</vmc:MenuItemTemplateSelector.SeparatorTemplate>
</vmc:MenuItemTemplateSelector>
</ui:NavigationView.MenuItemTemplateSelector>
ui:NavigationView.Content
</ui:NavigationView.Content>
</ui:NavigationView>
Thanks in advance for any replies (ideally with links to the information I need to research)