UI.WPF.Modern icon indicating copy to clipboard operation
UI.WPF.Modern copied to clipboard

A bug in NavigationView

Open cjhdevact opened this issue 11 months ago • 1 comments

Describe the bug

如图所示,图一为刚创建的窗口 Image 如图所示,图二为点击了展开按钮后再收起的窗口 Image 可以看到,第一张图在创建窗口时被错误显示的”M“在第二张图消失了 https://github.com/user-attachments/assets/05d086e2-c9b4-42d8-b302-9a7d10d60688

Reproduction

使用这段xml创建一个窗口

<Window x:Class="LockTimeSettingWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
        WindowStartupLocation="CenterScreen"
        Topmost="True"
        Icon="appicon.ico"
        ui:WindowHelper.UseModernWindowStyle="True"
        ui:WindowHelper.SystemBackdropType="Mica"
        ui:TitleBar.IsBackButtonVisible="False"
        ui:TitleBar.IsBackEnabled="False"
        ui:WindowHelper.FixMaximizedWindow="True"
        ui:TitleBar.Height="30"
        xmlns:local="clr-namespace:LockTime"
        mc:Ignorable="d"
        Title="设置" Height="600" Width="800" >
    <ui:NavigationView x:Name="nvSample5" Header="设置" IsTabStop="False" PaneDisplayMode="Auto">
        <ui:NavigationView.MenuItems>
            <ui:NavigationViewItem Content="Menu Item1" Tag="LockTimeAboutPage">
            <ui:NavigationViewItem.Icon>
                <ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="&#xe946;" />
            </ui:NavigationViewItem.Icon>
        </ui:NavigationViewItem>
       </ui:NavigationView.MenuItems>
             <ui:Frame x:Name="contentFrame5" Margin="0,0,0,0" />
    </ui:NavigationView>
</Window>

Suggested Solution

那个”M“无论什么时候如果没有被展开都不应该被显示

Library Version

0.10.0

Operating System

Windows 11

Framework

.NET Framework

Framework Version

4.5.2

Source of Package

NuGet.org (Package)

Additional Notes

Validations

  • [x] Check that there isn't already an issue that reports the same or similar problem.
  • [x] Check that this is a bug in the library that should be fixed, not a feature, also this is not about the documentation. (Or please choose the right repo and template.)
  • [x] This is one single problem, or a few problems with the same cause. (If you want to report multiple problems, please create one issue for every single problem.)
  • [x] You've checked that this problem still exists in the latest version. (Keep in mind that we don't provide any support for old versions.)
  • [x] You know that we can't guarantee that we will satisfy your request. This is not really our duty to do everything anyone asks for. Also, you will treat our staff, contributors, and other users with respect and kindness.
  • [x] You're sure there's something wrong with the library itself, not how you're using it. (If you are having issues using it and need help, please go to discussion.)

cjhdevact avatar Jan 23 '25 14:01 cjhdevact

这个问题很久以前就有了,目前可以通过手动设置 IsPaneOpen 为 false 来修补这个问题。我过几天看能不能修一下代码。

https://github.com/iNKORE-NET/Documentation/blob/main/data%2Fdocs%2Fui-wpf-modern%2F03.%20components%2F08.%20navigation%2F%23%20navigation-view%2Findex.en-US.mdx#L49-L55

NotYoojun avatar Jan 23 '25 15:01 NotYoojun

Seems like the bug still appears on the latest 0.10.1, Efecting the NavigationView Page API in actions Image

 <ui:NavigationView.PaneFooter>
                    <StackPanel
                        x:Name="FooterStackPanel"
                        Orientation="Vertical"
                        Visibility="Collapsed">
                        <ui:NavigationViewItem AutomationProperties.Name="download">
                            <ui:NavigationViewItem.Icon>
                                <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Download}"/>
                            </ui:NavigationViewItem.Icon>
                        </ui:NavigationViewItem>
                        <ui:NavigationViewItem AutomationProperties.Name="favorite">
                            <ui:NavigationViewItem.Icon>
                                <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.FavoriteStar}"/>
                            </ui:NavigationViewItem.Icon>
                        </ui:NavigationViewItem>
                    </StackPanel>
                </ui:NavigationView.PaneFooter>

GID0317 avatar Jun 23 '25 02:06 GID0317