Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Wpf.Ui.Demo/Views/Windows/ExperimentalWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<ui:NavigationCompact
<ui:NavigationFluent
x:Name="RootNavigation"
Grid.Column="0"
Frame="{Binding ElementName=RootFrame}"
IsExpandButtonVisible="True"
IsExpanded="False"
Precache="True">
<ui:NavigationCompact.Footer>
<ui:NavigationFluent.Footer>
<ui:NavigationItem
Click="NavigationButtonTheme_OnClick"
Content="Theme"
Icon="DarkTheme24" />
</ui:NavigationCompact.Footer>
</ui:NavigationCompact>
</ui:NavigationFluent.Footer>
</ui:NavigationFluent>

<ui:TitleBar
Title="WPF UI - Experimental Page"
Expand Down
59 changes: 16 additions & 43 deletions src/Wpf.Ui.Demo/Views/Windows/TaskManagerWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
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:local="clr-namespace:Wpf.Ui.Demo.Views.Windows"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="clr-namespace:Wpf.Ui.Demo.Views.Pages"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:viewModels="clr-namespace:Wpf.Ui.Demo.ViewModels"
Title="WPF UI - MS Store Window"
Width="1200"
Height="654"
d:DataContext="{d:DesignInstance local:TaskManagerWindow,
d:DataContext="{d:DesignInstance viewModels:TaskManagerViewModel,
IsDesignTimeCreatable=True}"
d:DesignHeight="650"
d:DesignWidth="900"
Expand All @@ -21,50 +20,24 @@
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<ui:NavigationCompact
x:Name="RootNavigation"
Grid.Column="0"
Footer="{Binding ViewModel.NavigationFooter, Mode=OneWay}"
Frame="{Binding ElementName=RootFrame, Mode=OneWay}"
Items="{Binding ViewModel.NavigationItems, Mode=OneWay}" />
<ui:NavigationView
FrameBorderMargin="0, 46, 0, 0"
FramePadding="20, 0"
IsBackButtonVisible="True"
IsBreadcrumbVisible="True">
<ui:NavigationView.Navigation>
<ui:NavigationFluent
Grid.Column="0"
Footer="{Binding NavigationFooter, Mode=OneTime}"
IsExpandButtonVisible="True"
IsExpanded="False"
Items="{Binding NavigationItems, Mode=OneTime}" />
</ui:NavigationView.Navigation>
</ui:NavigationView>

<ui:TitleBar
Title="WPF UI - Compact navigation"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="42,0,0,0"
Icon="pack://application:,,,/Resources/wpfui.png" />

<Grid Grid.Column="1">
<Border
Margin="0,46,0,0"
Background="{DynamicResource ControlFillColorDefaultBrush}"
CornerRadius="8,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:Breadcrumb
Grid.Row="0"
Margin="38"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="26"
FontWeight="Bold"
Navigation="{Binding ElementName=RootNavigation, Mode=OneWay}" />
<Frame
x:Name="RootFrame"
Grid.Row="1"
Margin="38,0" />
</Grid>
</Border>
</Grid>
</Grid>
</ui:UiWindow>
8 changes: 1 addition & 7 deletions src/Wpf.Ui.Demo/Views/Windows/TaskManagerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ namespace Wpf.Ui.Demo.Views.Windows;
/// </summary>
public partial class TaskManagerWindow
{
public TaskManagerViewModel ViewModel
{
get;
}

public TaskManagerWindow(TaskManagerViewModel viewModel)
{
ViewModel = viewModel;
DataContext = this;
DataContext = viewModel;

InitializeComponent();
}
Expand Down
68 changes: 0 additions & 68 deletions src/Wpf.Ui/Controls/NavigationCompact.cs

This file was deleted.

Binary file removed src/Wpf.Ui/Controls/NavigationFluent.bmp
Binary file not shown.
68 changes: 67 additions & 1 deletion src/Wpf.Ui/Controls/NavigationFluent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows;

namespace Wpf.Ui.Controls;

Expand All @@ -15,5 +17,69 @@ namespace Wpf.Ui.Controls;
[ToolboxBitmap(typeof(NavigationFluent), "NavigationFluent.bmp")]
public class NavigationFluent : Wpf.Ui.Controls.Navigation.NavigationBase
{
// XAML
/// <summary>
/// Property for <see cref="IsExpanded"/>.
/// </summary>
public static readonly DependencyProperty IsExpandedProperty = DependencyProperty.Register(
nameof(IsExpanded),
typeof(bool), typeof(NavigationFluent),
new PropertyMetadata(true));

/// <summary>
/// Property for <see cref="IsExpandButtonVisible"/>.
/// </summary>
public static readonly DependencyProperty IsExpandButtonVisibleProperty = DependencyProperty.Register(
nameof(IsExpandButtonVisible),
typeof(bool), typeof(NavigationFluent),
new PropertyMetadata(false));

/// <summary>
/// Property for <see cref="TemplateButtonCommand"/>.
/// </summary>
public static readonly DependencyProperty TemplateButtonCommandProperty =
DependencyProperty.Register(nameof(TemplateButtonCommand),
typeof(Common.IRelayCommand), typeof(NavigationFluent), new PropertyMetadata(null));

/// <summary>
/// Gets or sets a value indicating whether the menu is expanded.
/// </summary>
public bool IsExpanded
{
get => (bool)GetValue(IsExpandedProperty);
set => SetValue(IsExpandedProperty, value);
}

/// <summary>
/// TODO
/// </summary>
public bool IsExpandButtonVisible
{
get => (bool)GetValue(IsExpandButtonVisibleProperty);
set => SetValue(IsExpandButtonVisibleProperty, value);
}

/// <summary>
/// Command triggered after clicking the button.
/// </summary>
public Common.IRelayCommand TemplateButtonCommand => (Common.IRelayCommand)GetValue(TemplateButtonCommandProperty);

/// <summary>
/// Creates new instance and sets default <see cref="TemplateButtonCommandProperty"/>.
/// </summary>
public NavigationFluent() : base() =>
SetValue(TemplateButtonCommandProperty, new Common.RelayCommand(o => Button_OnClick(this, o)));

private void Button_OnClick(object sender, object parameter)
{
if (parameter == null)
return;

string param = parameter as string ?? String.Empty;

#if DEBUG
System.Diagnostics.Debug.WriteLine($"INFO: {typeof(NavigationFluent)} button clicked with param: {param}", "Wpf.Ui.NavigationFluent");
#endif
if (param == "hamburger")
IsExpanded = !IsExpanded;
}
}
Loading