Some shell/ themes improvements
This commit is contained in:
@@ -356,22 +356,9 @@
|
||||
<Grid
|
||||
x:Name="RootGrid"
|
||||
Padding="0"
|
||||
Background="{ThemeResource WinoApplicationBackgroundColor}"
|
||||
ColumnSpacing="0"
|
||||
RowSpacing="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="48" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid
|
||||
Grid.RowSpan="2"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="{ThemeResource WinoApplicationBackgroundColor}"
|
||||
IsHitTestVisible="False" />
|
||||
|
||||
<muxc:NavigationView
|
||||
x:Name="navigationView"
|
||||
@@ -452,21 +439,5 @@
|
||||
</Grid>
|
||||
</muxc:NavigationView>
|
||||
|
||||
<!--<coreControls:WinoAppTitleBar
|
||||
x:Name="RealAppBar"
|
||||
Grid.ColumnSpan="2"
|
||||
BackButtonClicked="BackButtonClicked"
|
||||
Canvas.ZIndex="150"
|
||||
ConnectionStatus="{x:Bind ViewModel.ActiveConnectionStatus, Mode=OneWay}"
|
||||
CoreWindowText="{x:Bind ViewModel.StatePersistenceService.CoreWindowTitle, Mode=OneWay}"
|
||||
IsBackButtonVisible="{x:Bind ViewModel.StatePersistenceService.IsBackButtonVisible, Mode=OneWay}"
|
||||
IsDragArea="True"
|
||||
IsNavigationPaneOpen="{x:Bind navigationView.IsPaneOpen, Mode=TwoWay}"
|
||||
IsReaderNarrowed="{x:Bind ViewModel.StatePersistenceService.IsReaderNarrowed, Mode=OneWay}"
|
||||
NavigationViewDisplayMode="{x:Bind navigationView.DisplayMode, Mode=OneWay}"
|
||||
OpenPaneLength="{x:Bind ViewModel.StatePersistenceService.OpenPaneLength, Mode=OneWay}"
|
||||
ReadingPaneLength="{x:Bind ViewModel.StatePersistenceService.MailListPaneLength, Mode=OneWay}"
|
||||
ReconnectCommand="{x:Bind ViewModel.ReconnectServerCommand}"
|
||||
SystemReserved="180" />-->
|
||||
</Grid>
|
||||
</abstract:AppShellAbstract>
|
||||
|
||||
@@ -130,7 +130,7 @@ public sealed partial class AppShell : AppShellAbstract,
|
||||
|
||||
public async void Receive(AccountMenuItemExtended message)
|
||||
{
|
||||
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, async () =>
|
||||
await DispatcherQueue.EnqueueAsync(async () =>
|
||||
{
|
||||
if (message.FolderId == default) return;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<winuiex:WindowEx.SystemBackdrop>
|
||||
<!-- TODO: Reach to ThemeService changes. -->
|
||||
<MicaBackdrop />
|
||||
</winuiex:WindowEx.SystemBackdrop>
|
||||
|
||||
@@ -20,8 +21,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TitleBar x:Name="ShellTitleBar" IsBackButtonVisible="True" />
|
||||
<TitleBar
|
||||
x:Name="ShellTitleBar"
|
||||
Title="{x:Bind StatePersistanceService.CoreWindowTitle, Mode=OneWay}"
|
||||
BackRequested="BackButtonClicked"
|
||||
IsBackButtonVisible="{x:Bind StatePersistanceService.IsBackButtonVisible, Mode=OneWay}"
|
||||
IsPaneToggleButtonVisible="True"
|
||||
PaneToggleRequested="PaneButtonClicked" />
|
||||
|
||||
<Frame x:Name="MainShellFrame" Grid.Row="1" />
|
||||
<Frame
|
||||
x:Name="MainShellFrame"
|
||||
Grid.Row="1"
|
||||
Navigated="MainFrameNavigated" />
|
||||
</Grid>
|
||||
</winuiex:WindowEx>
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
using System;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.WinUI;
|
||||
using Wino.Core.WinUI.Interfaces;
|
||||
using Wino.Messaging.Client.Mails;
|
||||
using Wino.Views;
|
||||
using WinUIEx;
|
||||
|
||||
@@ -8,10 +14,15 @@ namespace Wino.Mail.WinUI;
|
||||
|
||||
public sealed partial class ShellWindow : WindowEx, IWinoShellWindow
|
||||
{
|
||||
public IStatePersistanceService StatePersistanceService { get; } = WinoApplication.Current.Services.GetService<IStatePersistanceService>() ?? throw new Exception("StatePersistanceService not registered in DI container.");
|
||||
public IPreferencesService PreferencesService { get; } = WinoApplication.Current.Services.GetService<IPreferencesService>() ?? throw new Exception("PreferencesService not registered in DI container.");
|
||||
|
||||
public ShellWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
MinWidth = 420;
|
||||
MinHeight = 420;
|
||||
ConfigureTitleBar();
|
||||
}
|
||||
|
||||
@@ -30,4 +41,19 @@ public sealed partial class ShellWindow : WindowEx, IWinoShellWindow
|
||||
public Microsoft.UI.Xaml.Controls.TitleBar GetTitleBar() => ShellTitleBar;
|
||||
|
||||
public Frame GetMainFrame() => MainShellFrame;
|
||||
|
||||
public FrameworkElement GetRootContent() => Content as Grid ?? throw new Exception("RootContent is not a Grid or empty.");
|
||||
|
||||
private void BackButtonClicked(Microsoft.UI.Xaml.Controls.TitleBar sender, object args)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(new ClearMailSelectionsRequested());
|
||||
WeakReferenceMessenger.Default.Send(new DisposeRenderingFrameRequested());
|
||||
}
|
||||
|
||||
private void MainFrameNavigated(object sender, Microsoft.UI.Xaml.Navigation.NavigationEventArgs e) => ShellTitleBar.Content = (e.Content as BasePage).ShellContent;
|
||||
|
||||
private void PaneButtonClicked(Microsoft.UI.Xaml.Controls.TitleBar sender, object args)
|
||||
{
|
||||
PreferencesService.IsNavigationPaneOpened = !PreferencesService.IsNavigationPaneOpened;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user