0

As you can see from the image, there is little shadow on the right of the Pane of NavigationView. I want to know where I can find the that style and How can I remove that style? I searched through the default style of NavigationView but I didn't find it.

Thanks in advance!

enter image description here

3
  • There is a seemingly feasible way: you can find the control that generated the shadow in the style, and then remove the shadow according to this method: Control.Translation += new Vector3(0, 0, 0); but this is too complicated, so it is not recommended. In addition, you can also try to let your custom titlebar to use this method:titlebar.Translation += new Vector3(0, 0, 0); If they are both not successful, then we recommend that you can use the **ListView**(SplitView also can't) to customize a NavigationView. Commented Sep 16, 2019 at 8:37
  • @Faywang-MSFT What is your Control? And titlebar does not have that shadow. Why are you doing the same thing to the titlebar?
    – Seaky Lone
    Commented Sep 18, 2019 at 2:43
  • The control refers to the one that generates the shadow in the style of the navigationView, you can try to find it in the style. And because the titlebar will mask the shadow, so I suggested that you could try to adjust the translation . These are just suggestions. If they are not successful, it seems that you can only use the listView to customize a navigationView. Commented Sep 18, 2019 at 9:54

2 Answers 2

0

If you are using Windows 10 May update SDK there is property called "Shadow" you can modify from it

4
  • So what's the style of that shadow or how can I remove it?
    – Seaky Lone
    Commented Sep 14, 2019 at 1:45
  • I don't know what is the style of that shadow but you can go to properties menu in visual studio and modify on the shadow property of navigation view Commented Sep 14, 2019 at 22:58
  • this link give you some information about shadow that introduced with May update for windows 10 : learn.microsoft.com/en-us/windows/uwp/design/layout/… Commented Sep 14, 2019 at 23:00
  • Did you try it yourself? I have no idea how to modify it.
    – Seaky Lone
    Commented Sep 15, 2019 at 0:07
0

Lone,

I had the same issue and I'm very glad I found the solution. After many hours of research, I discovered that the default behavior is that NavigationView Pane casts shadow on the ContentGrid.

That can easily be confirmed by commenting out the content grid - shadow no longer exists, because it no longer has a receiver.

In my case, NavigationView was implemented using a SplitView. That's why Shadow was bound to SplitView.Pane.

All I did is OnLoaded & OnCollapseButtonTapped I executed the following line:

 _rootSplitVIew.Pane.Translation = new Vector3(0, 0, 0);

Shadow property works by elevating item on the Z axis, so setting it to 0 reverses the elevation and removes the shadow.

In your case you just need to find the proper element to execute it on (the element that has the Shadow).

In my case NavigationView was extended via TemplateControl. No reason this wouldn't work on a CodeBehind class too.

2
  • Thank you for sharing. Your solution looks very much like the comment in my question. Although I have given up on removing the shadow, I am glad that you figured this out!
    – Seaky Lone
    Commented Nov 22, 2020 at 6:20
  • @SeakyLone I understand and agree, but I think my comment gives much more context to the solution.
    – GeorgiG
    Commented Nov 23, 2020 at 9:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.