* Separation of messages. Introducing Wino.Messages library. * Wino.Server and Wino.Packaging projects. Enabling full trust for UWP and app service connection manager basics. * Remove debug code. * Enable generating assembly info to deal with unsupported os platform warnings. * Fix server-client connection. * UIMessage communication. Single instancing for server and re-connection mechanism on suspension. * Removed IWinoSynchronizerFactory from UWP project. * Removal of background task service from core. * Delegating changes to UI and triggering new background synchronization. * Fix build error. * Moved core lib messages to Messaging project. * Better client-server communication. Handling of requests in the server. New synchronizer factory in the server. * WAM broker and MSAL token caching for OutlookAuthenticator. Handling account creation for Outlook. * WinoServerResponse basics. * Delegating protocol activation for Gmail authenticator. * Adding margin to searchbox to match action bar width. * Move libraries into lib folder. * Storing base64 encoded mime on draft creation instead of MimeMessage object. Fixes serialization/deserialization issue with S.T.Json * Scrollbar adjustments * WınoExpander for thread expander layout ıssue. * Handling synchronizer state changes. * Double init on background activation. * FIxing packaging issues and new Wino Mail launcher protocol for activation from full thrust process. * Remove debug deserialization. * Remove debug code. * Making sure the server connection is established when the app is launched. * Thrust -> Trust string replacement... * Rename package to Wino Mail * Enable translated values in the server. * Fixed an issue where toast activation can't find the clicked mail after the folder is initialized. * Revert debug code. * Change server background sync to every 3 minute and Inbox only synchronization. * Revert google auth changes. * App preferences page. * Changing tray icon visibility on preference change. * Start the server with invisible tray icon if set to invisible. * Reconnect button on the title bar. * Handling of toast actions. * Enable x86 build for server during packaging. * Get rid of old background tasks and v180 migration. * Terminate client when Exit clicked in server. * Introducing SynchronizationSource to prevent notifying UI after server tick synchronization. * Remove confirmAppClose restricted capability and unused debug code in manifest. * Closing the reconnect info popup when reconnect is clicked. * Custom RetryHandler for OutlookSynchronizer and separating client/server logs. * Running server on Windows startup. * Fix startup exe. * Fix for expander list view item paddings. * Force full sync on app launch instead of Inbox. * Fix draft creation. * Fix an issue with custom folder sync logic. * Reporting back account sync progress from server. * Fix sending drafts and missing notifications for imap. * Changing imap folder sync requirements. * Retain file count is set to 3. * Disabled swipe gestures temporarily due to native crash with SwipeControl * Save all attachments implementation. * Localization for save all attachments button. * Fix logging dates for logs. * Fixing ARM64 build. * Add ARM64 build config to packaging project. * Comment out OutOfProcPDB for ARM64. * Hnadling GONE response for Outlook folder synchronization.
210 lines
9.2 KiB
C#
210 lines
9.2 KiB
C#
using System.Windows.Input;
|
|
using Windows.Foundation;
|
|
using Windows.UI.Xaml;
|
|
using Windows.UI.Xaml.Controls;
|
|
using Wino.Core.Domain.Enums;
|
|
|
|
namespace Wino.Controls.Advanced
|
|
{
|
|
public sealed partial class WinoAppTitleBar : UserControl
|
|
{
|
|
public event TypedEventHandler<WinoAppTitleBar, RoutedEventArgs> BackButtonClicked;
|
|
|
|
public static readonly DependencyProperty IsRenderingPaneVisibleProperty = DependencyProperty.Register(nameof(IsRenderingPaneVisible), typeof(bool), typeof(WinoAppTitleBar), new PropertyMetadata(false, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty IsReaderNarrowedProperty = DependencyProperty.Register(nameof(IsReaderNarrowed), typeof(bool), typeof(WinoAppTitleBar), new PropertyMetadata(false, OnIsReaderNarrowedChanged));
|
|
public static readonly DependencyProperty IsBackButtonVisibleProperty = DependencyProperty.Register(nameof(IsBackButtonVisible), typeof(bool), typeof(WinoAppTitleBar), new PropertyMetadata(false, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty OpenPaneLengthProperty = DependencyProperty.Register(nameof(OpenPaneLength), typeof(double), typeof(WinoAppTitleBar), new PropertyMetadata(0d, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty IsNavigationPaneOpenProperty = DependencyProperty.Register(nameof(IsNavigationPaneOpen), typeof(bool), typeof(WinoAppTitleBar), new PropertyMetadata(false, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty NavigationViewDisplayModeProperty = DependencyProperty.Register(nameof(NavigationViewDisplayMode), typeof(Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode), typeof(WinoAppTitleBar), new PropertyMetadata(Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode.Compact, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty ShellFrameContentProperty = DependencyProperty.Register(nameof(ShellFrameContent), typeof(UIElement), typeof(WinoAppTitleBar), new PropertyMetadata(null, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty SystemReservedProperty = DependencyProperty.Register(nameof(SystemReserved), typeof(double), typeof(WinoAppTitleBar), new PropertyMetadata(0, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty CoreWindowTextProperty = DependencyProperty.Register(nameof(CoreWindowText), typeof(string), typeof(WinoAppTitleBar), new PropertyMetadata(string.Empty, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty ReadingPaneLengthProperty = DependencyProperty.Register(nameof(ReadingPaneLength), typeof(double), typeof(WinoAppTitleBar), new PropertyMetadata(420d, OnDrawingPropertyChanged));
|
|
public static readonly DependencyProperty ConnectionStatusProperty = DependencyProperty.Register(nameof(ConnectionStatus), typeof(WinoServerConnectionStatus), typeof(WinoAppTitleBar), new PropertyMetadata(WinoServerConnectionStatus.None, new PropertyChangedCallback(OnConnectionStatusChanged)));
|
|
public static readonly DependencyProperty ReconnectCommandProperty = DependencyProperty.Register(nameof(ReconnectCommand), typeof(ICommand), typeof(WinoAppTitleBar), new PropertyMetadata(null));
|
|
|
|
public ICommand ReconnectCommand
|
|
{
|
|
get { return (ICommand)GetValue(ReconnectCommandProperty); }
|
|
set { SetValue(ReconnectCommandProperty, value); }
|
|
}
|
|
|
|
public WinoServerConnectionStatus ConnectionStatus
|
|
{
|
|
get { return (WinoServerConnectionStatus)GetValue(ConnectionStatusProperty); }
|
|
set { SetValue(ConnectionStatusProperty, value); }
|
|
}
|
|
|
|
public string CoreWindowText
|
|
{
|
|
get { return (string)GetValue(CoreWindowTextProperty); }
|
|
set { SetValue(CoreWindowTextProperty, value); }
|
|
}
|
|
|
|
public double SystemReserved
|
|
{
|
|
get { return (double)GetValue(SystemReservedProperty); }
|
|
set { SetValue(SystemReservedProperty, value); }
|
|
}
|
|
|
|
public UIElement ShellFrameContent
|
|
{
|
|
get { return (UIElement)GetValue(ShellFrameContentProperty); }
|
|
set { SetValue(ShellFrameContentProperty, value); }
|
|
}
|
|
|
|
public Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode NavigationViewDisplayMode
|
|
{
|
|
get { return (Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode)GetValue(NavigationViewDisplayModeProperty); }
|
|
set { SetValue(NavigationViewDisplayModeProperty, value); }
|
|
}
|
|
|
|
public bool IsNavigationPaneOpen
|
|
{
|
|
get { return (bool)GetValue(IsNavigationPaneOpenProperty); }
|
|
set { SetValue(IsNavigationPaneOpenProperty, value); }
|
|
}
|
|
|
|
public double OpenPaneLength
|
|
{
|
|
get { return (double)GetValue(OpenPaneLengthProperty); }
|
|
set { SetValue(OpenPaneLengthProperty, value); }
|
|
}
|
|
|
|
public bool IsBackButtonVisible
|
|
{
|
|
get { return (bool)GetValue(IsBackButtonVisibleProperty); }
|
|
set { SetValue(IsBackButtonVisibleProperty, value); }
|
|
}
|
|
|
|
public bool IsReaderNarrowed
|
|
{
|
|
get { return (bool)GetValue(IsReaderNarrowedProperty); }
|
|
set { SetValue(IsReaderNarrowedProperty, value); }
|
|
}
|
|
|
|
public bool IsRenderingPaneVisible
|
|
{
|
|
get { return (bool)GetValue(IsRenderingPaneVisibleProperty); }
|
|
set { SetValue(IsRenderingPaneVisibleProperty, value); }
|
|
}
|
|
|
|
|
|
|
|
|
|
public double ReadingPaneLength
|
|
{
|
|
get { return (double)GetValue(ReadingPaneLengthProperty); }
|
|
set { SetValue(ReadingPaneLengthProperty, value); }
|
|
}
|
|
|
|
private static void OnIsReaderNarrowedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
|
{
|
|
if (obj is WinoAppTitleBar bar)
|
|
{
|
|
bar.DrawTitleBar();
|
|
}
|
|
}
|
|
|
|
private static void OnDrawingPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
|
{
|
|
if (obj is WinoAppTitleBar bar)
|
|
{
|
|
bar.DrawTitleBar();
|
|
}
|
|
}
|
|
|
|
private static void OnConnectionStatusChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
|
{
|
|
if (obj is WinoAppTitleBar bar)
|
|
{
|
|
bar.UpdateConnectionStatus();
|
|
}
|
|
}
|
|
|
|
private void UpdateConnectionStatus()
|
|
{
|
|
|
|
}
|
|
|
|
private void DrawTitleBar()
|
|
{
|
|
UpdateLayout();
|
|
|
|
CoreWindowTitleTextBlock.Visibility = Visibility.Collapsed;
|
|
ShellContentContainer.Width = double.NaN;
|
|
ShellContentContainer.Margin = new Thickness(0, 0, 0, 0);
|
|
ShellContentContainer.HorizontalAlignment = HorizontalAlignment.Stretch;
|
|
|
|
EmptySpaceWidth.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
// Menu is not visible.
|
|
if (NavigationViewDisplayMode == Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode.Minimal)
|
|
{
|
|
|
|
}
|
|
else if (NavigationViewDisplayMode == Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode.Compact)
|
|
{
|
|
// Icons are visible.
|
|
|
|
if (!IsReaderNarrowed)
|
|
{
|
|
ShellContentContainer.HorizontalAlignment = HorizontalAlignment.Left;
|
|
ShellContentContainer.Width = ReadingPaneLength;
|
|
}
|
|
}
|
|
else if (NavigationViewDisplayMode == Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode.Expanded)
|
|
{
|
|
if (IsNavigationPaneOpen)
|
|
{
|
|
CoreWindowTitleTextBlock.Visibility = Visibility.Visible;
|
|
|
|
// LMargin = OpenPaneLength - LeftMenuStackPanel
|
|
ShellContentContainer.Margin = new Thickness(OpenPaneLength - LeftMenuStackPanel.ActualSize.X, 0, 0, 0);
|
|
|
|
if (!IsReaderNarrowed)
|
|
{
|
|
ShellContentContainer.HorizontalAlignment = HorizontalAlignment.Left;
|
|
ShellContentContainer.Width = ReadingPaneLength;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
EmptySpaceWidth.Width = new GridLength(ReadingPaneLength, GridUnitType.Pixel);
|
|
}
|
|
}
|
|
}
|
|
|
|
public WinoAppTitleBar()
|
|
{
|
|
this.InitializeComponent();
|
|
|
|
Window.Current.SetTitleBar(dragbar);
|
|
}
|
|
|
|
private void BackClicked(object sender, RoutedEventArgs e)
|
|
{
|
|
BackButtonClicked?.Invoke(this, e);
|
|
}
|
|
|
|
private void PaneClicked(object sender, RoutedEventArgs e)
|
|
{
|
|
IsNavigationPaneOpen = !IsNavigationPaneOpen;
|
|
}
|
|
|
|
private void TitlebarSizeChanged(object sender, SizeChangedEventArgs e) => DrawTitleBar();
|
|
|
|
private void ReconnectClicked(object sender, RoutedEventArgs e)
|
|
{
|
|
// Close the popup for reconnect button.
|
|
if (sender is Button senderButton && senderButton.Flyout is Flyout senderButtonFlyout)
|
|
{
|
|
senderButtonFlyout.Hide();
|
|
}
|
|
|
|
// Execute the reconnect command.
|
|
ReconnectCommand?.Execute(null);
|
|
}
|
|
}
|
|
}
|