当前,如果使用可见性绑定,则无法在Android和Wasm中正确显示NavigationView。
据我所知,NavigationView处于不稳定状态,但也许有人知道该问题的解决方法,例如使用当前的绑定/可见性值强制执行UI重新计算。
使用代码示例更新:
<NavigationView ItemInvoked="NavigationView_ItemInvoked" PaneDisplayMode="LeftMinimal" PaneOpened="NavigationView_PaneOpened" IsSettingsVisible="False" IsBackEnabled="False" IsBackButtonVisible="Collapsed">
<NavigationView.MenuItems>
<NavigationViewItem x:Uid="ButtonNew" Tag="createnew" Content="CREATENEW" />
<NavigationViewItem x:Uid="ButtonNewDrillZ2" Tag="createnewdrillz2" Content="DRILLZ2" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonNewDrillZ3" Tag="createnewdrillz3" Content="DRILLZ3" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonNewDrillStepZ2" Tag="createnewdrillstepz2" Content="DRILLSTEPZ2" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonNewCutterZ2" Tag="createnewcutterz2" Content="CUTTERZ2" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonNewCutterZ3R" Tag="createnewcutterz3r" Content="CUTTERZ3R" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonNewCutterZ4B" Tag="createnewcutterz4b" Content="CUTTERZ4B" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonNewCutterFormZ3" Tag="createnewcutterformz3" Content="CUTTERFORMZ3" Visibility="{Binding IsChooseNew, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItemSeparator Visibility="{Binding CanOpenShared, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonOpenShared" Tag="openshared" Content="OPENSHARED" Visibility="{Binding CanOpenShared, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItemSeparator Visibility="{Binding IsEditingTool, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonEdit" Tag="edit" Content="EDIT" Visibility="{Binding IsEditingTool, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonView2D" Tag="view2d" Content="VIEW2D" Visibility="{Binding IsEditingTool, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonView3D" Tag="view3d" Content="VIEW3D" Visibility="{Binding IsEditingTool, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItem x:Uid="ButtonShare" Tag="share" Content="SHARE" Visibility="{Binding IsEditingTool, Converter={StaticResource BooleanToVisibilityConverter}}" />
<NavigationViewItemSeparator />
<NavigationViewItem x:Uid="ButtonSettings" Tag="settings" Content="SETTINGS" />
<NavigationViewItem x:Uid="ButtonAbout" Tag="about" Content="ABOUT" />
</NavigationView.MenuItems>
<Frame Name="RootFrame"/>
</NavigationView>