How to make NavigationItem Icon Fill space (no margin?)

My nav drawer is working fine. But I can't figure out how to remove what appears to be a margin around each icon. I want the icons to fill a square space and sit against each other.

  • How is the size of the icon set area set?
  • How do I make it fill the space?
In this screen shot, see the space between the sides of the icons? I want that removed. And the icons should fill the area. 

If I change the height and width of the first  icon, I get something like this:

It just doesn't work the way I'd expect.
<syncfusion:NavigationItem Header="Search" Name="mySearchNavButton" 
                                       ToolTip="Set the search criteria.">
                <syncfusion:NavigationItem.Icon >
                    <Image Source="/Resources/User-Find.png" Width="100" Height="100" />
                </syncfusion:NavigationItem.Icon>
            </syncfusion:NavigationItem>
            <syncfusion:NavigationItem Header="Names" Name="myNamesNavButton" 
                                       ToolTip="See the names from your search." >
                <syncfusion:NavigationItem.Icon>
                    <Image Source="/Resources/Student-Read-04.png" />
                </syncfusion:NavigationItem.Icon>
            </syncfusion:NavigationItem>


5 Replies 1 reply marked as answer

SS Suganya Sethuraman Syncfusion Team April 23, 2021 07:30 AM UTC

Hi Bob,

Greetings from Syncfusion.

We have analyzed your requirement. We achieved your requirement by editing the NavigationItem style and removing the margin of Icon.

Please have a sample for your reference.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/NavigationWPF23508685

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

Regards,
Suganya Sethuraman.
 


Marked as answer

PE Peter April 26, 2021 10:25 PM UTC

I look at the sample and I again see some binary data, why is there no sample with embedded resources
This image does not show, I can't say why

        <syncfusion:SfNavigationDrawer DisplayMode="Expanded">
            <syncfusion:NavigationItem Header="Dashboard" IsExpanded="True" IsSelected="True"> 
             <syncfusion:NavigationItem.Icon> 
                <Image Source="/Resources/control_panel.png" Width="32" Height="32"/> 
            </syncfusion:NavigationItem.Icon>
            </syncfusion:NavigationItem>
            <syncfusion:SfNavigationDrawer.ContentView>
                <StackPanel prism:RegionManager.RegionName="{x:Static core:RegionNames.ContentRegion}" />
            </syncfusion:SfNavigationDrawer.ContentView>
        </syncfusion:SfNavigationDrawer>


BP Bob Puckett April 27, 2021 12:45 AM UTC

Thank you very much! I'll try it soon. I appreciate the quick response!


SS Suganya Sethuraman Syncfusion Team April 27, 2021 06:49 AM UTC

Hi Bob,

Thanks for the update.

We will wait until hear from you.

Regards,
Suganya Sethuraman.
 



SS Suganya Sethuraman Syncfusion Team April 27, 2021 07:31 AM UTC

Hi Peter,

Greetings from Syncfusion.

We have analyzed the reported issue but were unable to replicate it. Please have a sample for your reference,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/NavigationWPF1818741107

Please let us know if you have any concerns.

Regards,
Suganya Sethuraman.
 


Loader.
Up arrow icon