NavigationView cant set BackButtonVisible in defual xaml when PaneDisplayMode is LeftFluent
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start by reproducing the issue with the provided NavigationView XAML in MainWindow on Windows 11 using .NET 8 and WPF-UI 3.0.5, comparing LeftFluent with the C# IsBackButtonVisible workaround. Trace the NavigationView back-button initialization and verify that the button is shown automatically without setting the property in code.
Written by the indexing model from the issue text.
Description
Describe the bug
when I design a new applicaton in LeftFluent PaneDisplayMode ,I found title bar 's icon & title show in wrong way.
But then I thinks MenuItems the bad guys.And then in Debug Mode,I set my NavigationView's Xaml property in
IsBackButtonVisible="Visible"
then The UI show Great!
So I keep coding ... However ,the next time I start my application in Debug mode the BackButton dont show!
I have too manul set xaml code to bring it back.Seems not about the property of IsBackButtonVisible what I set because I try Auto/Visible no one can automatically show BackButton when app start.Only one way is manually change the property of IsBackButtonVisible
And finally my way to solve this probelm by manul set property in C# code to show the BackButton
public MainWindow()
{
InitializeComponent();
DataContext = ViewModel;
NavigationView.IsBackButtonVisible = NavigationViewBackButtonVisible.Visible;
}
To Reproduce
My NavigationView Xaml Code as follow:
<Grid Background="#1e272e">
<ui:NavigationView
x:Name="NavigationView"
Margin="0,0,5,5"
FooterMenuItemsSource="{Binding FooterMenuItems, Mode=OneWay}"
IsBackButtonVisible="Visible"
MenuItemsSource="{Binding MenuItems, Mode=OneWay}"
PaneDisplayMode="LeftFluent"
TitleBar="{Binding ElementName=TitleBar, Mode=OneWay}"
Transition="FadeInWithSlide">
<ui:NavigationView.ContentOverlay>
<Grid>
<ui:SnackbarPresenter x:Name="SnackbarPresenter" />
</Grid>
</ui:NavigationView.ContentOverlay>
</ui:NavigationView>
<ContentPresenter x:Name="RootContentDialog" Grid.Row="0" />
<ui:TitleBar
x:Name="TitleBar"
Title="SwiftKit"
Grid.Row="0"
CloseWindowByDoubleClickOnIcon="False">
<ui:TitleBar.Icon>
<ui:ImageIcon Margin="0,0,0,0" Source="pack://application:,,,/Assets/Windows_icon.png" />
</ui:TitleBar.Icon>
</ui:TitleBar>
</Grid>
And my C# Window Code
public partial class MainWindow : Window
{
private readonly MainWindowViewModel ViewModel = new();
public MainWindow()
{
InitializeComponent();
DataContext = ViewModel;
//NavigationView.IsBackButtonVisible = NavigationViewBackButtonVisible.Visible; //Set as u need
}
}
Expected behavior
Fix the BackButton Auto Show in LeftFluent
Screenshots
No response
OS version
Windows 11
.NET version
.Net 8
WPF-UI NuGet version
3.0.5
Additional context
No response
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lepoco/wpfui
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100