整理控件库

This commit is contained in:
GG Z
2025-05-05 17:04:06 +08:00
parent 74532b77be
commit 3eaad7566e
283 changed files with 2156 additions and 17846 deletions

View File

@@ -1,58 +1,17 @@
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
using WPFluent.Controls;
using WPFluent.Gallery.ViewModels.Pages.Collections;
using WPFluent.Gallery.ViewModels.Pages.Collections;
namespace WPFluent.Gallery.Views.Pages.Collections;
public partial class CollectionsPage : INavigableView<CollectionsViewModel>
public partial class CollectionsPage
{
private readonly INavigationService _navigationService;
public CollectionsViewModel ViewModel { get; }
public CollectionsPage(CollectionsViewModel viewModel, INavigationService navigationService)
public CollectionsPage()
{
ViewModel = viewModel;
DataContext = this;
_navigationService = navigationService;
ViewModel = new();
DataContext = ViewModel;
InitializeComponent();
Loaded += HandleLoaded;
Unloaded += HandleUnloaded;
}
private void HandleLoaded(object sender, RoutedEventArgs e)
{
INavigationView? navigationControl = _navigationService.GetNavigationControl();
if (
navigationControl?.BreadcrumbBar != null
&& navigationControl.BreadcrumbBar.Visibility != Visibility.Collapsed
)
{
navigationControl.BreadcrumbBar.SetCurrentValue(VisibilityProperty, Visibility.Collapsed);
}
}
private void HandleUnloaded(object sender, RoutedEventArgs e)
{
INavigationView? navigationControl = _navigationService.GetNavigationControl();
if (
navigationControl?.BreadcrumbBar != null
&& navigationControl.BreadcrumbBar.Visibility != Visibility.Visible
)
{
navigationControl.BreadcrumbBar.SetCurrentValue(VisibilityProperty, Visibility.Visible);
}
Loaded -= HandleLoaded;
Unloaded -= HandleUnloaded;
}
}