整理控件库
This commit is contained in:
@@ -9,68 +9,15 @@ using DialogsAndFlyoutsViewModel = WPFluent.Gallery.ViewModels.Pages.DialogsAndF
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class DialogsAndFlyoutsPage : INavigableView<DialogsAndFlyoutsViewModel>
|
||||
public partial class DialogsAndFlyoutsPage
|
||||
{
|
||||
private readonly INavigationService _navigationService;
|
||||
|
||||
|
||||
public DialogsAndFlyoutsViewModel ViewModel { get; }
|
||||
|
||||
public DialogsAndFlyoutsPage(DialogsAndFlyoutsViewModel viewModel, INavigationService navigationService)
|
||||
public DialogsAndFlyoutsPage()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
//INavigationViewItem? selectedItem = navigationControl?.SelectedItem;
|
||||
//if (selectedItem != null)
|
||||
//{
|
||||
// string? newTitle = selectedItem.Content?.ToString();
|
||||
// if (MainTitle.Text != newTitle)
|
||||
// {
|
||||
// MainTitle.SetCurrentValue(System.Windows.Controls.TextBlock.TextProperty, newTitle);
|
||||
// }
|
||||
|
||||
// if (selectedItem.Icon is SymbolIcon selectedIcon && MainSymbolIcon.Symbol != selectedIcon.Symbol)
|
||||
// {
|
||||
// MainSymbolIcon.SetCurrentValue(SymbolIcon.SymbolProperty, selectedIcon.Symbol);
|
||||
// }
|
||||
//}
|
||||
|
||||
//_snowflake ??= new(MainCanvas);
|
||||
//_snowflake.Start();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user