Better shell
This commit is contained in:
@@ -16,6 +16,7 @@ using Wino.Core.Domain.Collections;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Extensions;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.MenuItems;
|
||||
using Wino.Core.Domain.Models.Calendar;
|
||||
using Wino.Core.Domain.Models;
|
||||
using Wino.Core.Domain.Models.Navigation;
|
||||
@@ -40,6 +41,9 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
public IAccountCalendarStateService AccountCalendarStateService { get; }
|
||||
public INavigationService NavigationService { get; }
|
||||
|
||||
public MenuItemCollection MenuItems { get; private set; }
|
||||
public MenuItemCollection FooterItems { get; private set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int _selectedMenuItemIndex = -1;
|
||||
|
||||
@@ -71,6 +75,11 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
[ObservableProperty]
|
||||
private bool isStoreUpdateItemVisible;
|
||||
|
||||
private readonly ManageAccountsMenuItem _manageAccountsMenuItem = new();
|
||||
private readonly SettingsItem _settingsItem = new();
|
||||
private readonly StoreUpdateMenuItem _storeUpdateMenuItem = new();
|
||||
private readonly NewMailMenuItem _newEventMenuItem = new();
|
||||
|
||||
// For updating account calendars asynchronously.
|
||||
private SemaphoreSlim _accountCalendarUpdateSemaphoreSlim = new(1);
|
||||
|
||||
@@ -106,6 +115,9 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
base.OnDispatcherAssigned();
|
||||
|
||||
AccountCalendarStateService.Dispatcher = Dispatcher;
|
||||
MenuItems = new MenuItemCollection(Dispatcher);
|
||||
FooterItems = new MenuItemCollection(Dispatcher);
|
||||
MenuItems.Add(_newEventMenuItem);
|
||||
_ = RefreshFooterItemsAsync(false);
|
||||
}
|
||||
|
||||
@@ -183,11 +195,9 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
|
||||
private async Task RefreshFooterItemsAsync(bool showNotification)
|
||||
{
|
||||
await _storeUpdateService.RefreshAvailabilityAsync(showNotification).ConfigureAwait(false);
|
||||
|
||||
await ExecuteUIThread(() =>
|
||||
{
|
||||
IsStoreUpdateItemVisible = _storeUpdateService.HasAvailableUpdate && PreferencesService.IsStoreUpdateNotificationsEnabled;
|
||||
FooterItems.Clear();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -263,26 +273,7 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
_navigationDate = null;
|
||||
}
|
||||
|
||||
partial void OnSelectedMenuItemIndexChanged(int oldValue, int newValue)
|
||||
{
|
||||
if (newValue < 0)
|
||||
return;
|
||||
|
||||
if (newValue == 0)
|
||||
{
|
||||
NavigationService.Navigate(WinoPage.ManageAccountsPage);
|
||||
}
|
||||
else if (newValue == 1)
|
||||
{
|
||||
NavigationService.Navigate(WinoPage.SettingsPage);
|
||||
}
|
||||
else if (IsStoreUpdateItemVisible && newValue == 2)
|
||||
{
|
||||
_ = StartStoreUpdateAsync();
|
||||
}
|
||||
|
||||
SelectedMenuItemIndex = -1;
|
||||
}
|
||||
partial void OnSelectedMenuItemIndexChanged(int oldValue, int newValue) { }
|
||||
|
||||
[RelayCommand]
|
||||
private async Task Sync()
|
||||
@@ -353,6 +344,25 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
[RelayCommand]
|
||||
public void ManageAccounts() => NavigationService.Navigate(WinoPage.AccountManagementPage);
|
||||
|
||||
public async Task HandleNavigationItemInvokedAsync(IMenuItem menuItem)
|
||||
{
|
||||
switch (menuItem)
|
||||
{
|
||||
case NewMailMenuItem:
|
||||
await NewEventAsync().ConfigureAwait(false);
|
||||
break;
|
||||
case ManageAccountsMenuItem:
|
||||
NavigationService.Navigate(WinoPage.ManageAccountsPage);
|
||||
break;
|
||||
case SettingsItem:
|
||||
NavigationService.Navigate(WinoPage.SettingsPage);
|
||||
break;
|
||||
case StoreUpdateMenuItem:
|
||||
await StartStoreUpdateAsync().ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task NewEventAsync()
|
||||
{
|
||||
@@ -521,12 +531,15 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
|
||||
return new DateTime(dominantKey.Year, dominantKey.Month, 1).ToString("Y", cultureInfo);
|
||||
}
|
||||
|
||||
partial void OnHighlightedDateRangeChanged(DateRange value) => UpdateDateNavigationHeaderItems();
|
||||
partial void OnHighlightedDateRangeChanged(DateRange value)
|
||||
{
|
||||
UpdateDateNavigationHeaderItems();
|
||||
}
|
||||
|
||||
public async void Receive(CalendarEnableStatusChangedMessage message)
|
||||
=> await ExecuteUIThread(() => IsCalendarEnabled = message.IsEnabled);
|
||||
|
||||
public void Receive(NavigateManageAccountsRequested message) => SelectedMenuItemIndex = 0;
|
||||
public void Receive(NavigateManageAccountsRequested message) => NavigationService.Navigate(WinoPage.ManageAccountsPage);
|
||||
|
||||
public void Receive(CalendarDisplayTypeChangedMessage message)
|
||||
{
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
public enum WinoApplicationMode
|
||||
{
|
||||
Mail,
|
||||
Calendar
|
||||
Calendar,
|
||||
Contacts
|
||||
}
|
||||
|
||||
@@ -952,6 +952,7 @@
|
||||
"SystemFolderConfigSetupSuccess_Title": "System Folders Setup",
|
||||
"SystemTrayMenu_ShowWino": "Open Wino Mail",
|
||||
"SystemTrayMenu_ShowWinoCalendar": "Open Wino Calendar",
|
||||
"SystemTrayMenu_ShowWinoContacts": "Open Wino Contacts",
|
||||
"SystemTrayMenu_ExitWino": "Exit",
|
||||
"TestingImapConnectionMessage": "Testing server connection...",
|
||||
"TitleBarServerDisconnectedButton_Description": "Wino is disconnected from the network. Click reconnect to restore connection.",
|
||||
|
||||
@@ -43,6 +43,7 @@ public partial class KeyboardShortcutViewModel : ObservableObject
|
||||
{
|
||||
WinoApplicationMode.Mail => Translator.KeyboardShortcuts_ModeMail,
|
||||
WinoApplicationMode.Calendar => Translator.KeyboardShortcuts_ModeCalendar,
|
||||
WinoApplicationMode.Contacts => Translator.ContactsPage_Title,
|
||||
_ => Mode.ToString()
|
||||
};
|
||||
|
||||
|
||||
@@ -83,7 +83,8 @@ public partial class AppPreferencesPageViewModel : MailBaseViewModel
|
||||
ApplicationModes =
|
||||
[
|
||||
Translator.SettingsAppPreferences_ApplicationMode_Mail,
|
||||
Translator.SettingsAppPreferences_ApplicationMode_Calendar
|
||||
Translator.SettingsAppPreferences_ApplicationMode_Calendar,
|
||||
Translator.ContactsPage_Title
|
||||
];
|
||||
|
||||
SelectedDefaultSearchMode = SearchModes[(int)PreferencesService.DefaultSearchMode];
|
||||
|
||||
@@ -149,30 +149,9 @@ public partial class MailAppShellViewModel : MailBaseViewModel,
|
||||
|
||||
private async Task CreateFooterItemsAsync(bool showNotification = false)
|
||||
{
|
||||
await _storeUpdateService.RefreshAvailabilityAsync(showNotification).ConfigureAwait(false);
|
||||
|
||||
await ExecuteUIThread(() =>
|
||||
{
|
||||
// TODO: Selected footer item container still remains selected after re-creation.
|
||||
// To reproduce, go settings and change the language.
|
||||
|
||||
foreach (var item in FooterItems)
|
||||
{
|
||||
item.IsExpanded = false;
|
||||
item.IsSelected = false;
|
||||
}
|
||||
|
||||
FooterItems.Clear();
|
||||
|
||||
FooterItems.Add(ContactsMenuItem);
|
||||
FooterItems.Add(ManageAccountsMenuItem);
|
||||
|
||||
if (_storeUpdateService.HasAvailableUpdate && PreferencesService.IsStoreUpdateNotificationsEnabled)
|
||||
{
|
||||
FooterItems.Add(StoreUpdateMenuItem);
|
||||
}
|
||||
|
||||
FooterItems.Add(SettingsItem);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -669,26 +648,6 @@ public partial class MailAppShellViewModel : MailBaseViewModel,
|
||||
// Don't navigate to merged account if it's already selected. Preserve user's already selected folder.
|
||||
await ChangeLoadedAccountAsync(clickedMergedAccountMenuItem, true);
|
||||
}
|
||||
else if (clickedMenuItem is StoreUpdateMenuItem)
|
||||
{
|
||||
await _storeUpdateService.StartUpdateAsync().ConfigureAwait(false);
|
||||
await CreateFooterItemsAsync().ConfigureAwait(false);
|
||||
}
|
||||
else if (clickedMenuItem is SettingsItem)
|
||||
{
|
||||
NavigationService.Navigate(WinoPage.SettingsPage, parameter, NavigationReferenceFrame.InnerShellFrame, NavigationTransitionType.None);
|
||||
UpdateWindowTitle(Translator.MenuSettings);
|
||||
}
|
||||
else if (clickedMenuItem is ManageAccountsMenuItem)
|
||||
{
|
||||
NavigationService.Navigate(WinoPage.ManageAccountsPage, parameter, NavigationReferenceFrame.InnerShellFrame, NavigationTransitionType.None);
|
||||
UpdateWindowTitle(Translator.MenuManageAccounts);
|
||||
}
|
||||
else if (clickedMenuItem is ContactsMenuItem)
|
||||
{
|
||||
NavigationService.Navigate(WinoPage.ContactsPage, parameter, NavigationReferenceFrame.InnerShellFrame, NavigationTransitionType.None);
|
||||
UpdateWindowTitle(Translator.ContactsPage_Title);
|
||||
}
|
||||
else if (clickedMenuItem is IAccountMenuItem clickedAccountMenuItem)
|
||||
{
|
||||
// Changing loaded account.
|
||||
|
||||
@@ -43,6 +43,16 @@ internal static class AppModeActivationResolver
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Contains(value, "wino-contacts") ||
|
||||
Contains(value, "--mode=contacts") ||
|
||||
Contains(value, "mode=contacts") ||
|
||||
Contains(value, "contactsapp") ||
|
||||
EqualsToken(value, "contacts"))
|
||||
{
|
||||
mode = WinoApplicationMode.Contacts;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Contains(value, "wino-mail") ||
|
||||
Contains(value, "--mode=mail") ||
|
||||
Contains(value, "mode=mail") ||
|
||||
@@ -63,7 +73,10 @@ internal static class AppModeActivationResolver
|
||||
=> string.Equals(source.Trim(), token, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
private static WinoApplicationMode GetOpposite(WinoApplicationMode defaultMode)
|
||||
=> defaultMode == WinoApplicationMode.Mail
|
||||
? WinoApplicationMode.Calendar
|
||||
: WinoApplicationMode.Mail;
|
||||
=> defaultMode switch
|
||||
{
|
||||
WinoApplicationMode.Mail => WinoApplicationMode.Calendar,
|
||||
WinoApplicationMode.Calendar => WinoApplicationMode.Mail,
|
||||
_ => WinoApplicationMode.Mail
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
<styles:WinoExpanderStyle />
|
||||
<styles:WinoCalendarResources />
|
||||
<ResourceDictionary Source="Styles/CalendarShellNavigationViewStyle.xaml" />
|
||||
<ResourceDictionary Source="AppThemes/Default.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -954,7 +954,12 @@ public partial class App : WinoApplication,
|
||||
}
|
||||
|
||||
private static string GetModeLaunchArgument(WinoApplicationMode mode)
|
||||
=> mode == WinoApplicationMode.Calendar ? "--mode=calendar" : "--mode=mail";
|
||||
=> mode switch
|
||||
{
|
||||
WinoApplicationMode.Calendar => "--mode=calendar",
|
||||
WinoApplicationMode.Contacts => "--mode=contacts",
|
||||
_ => "--mode=mail"
|
||||
};
|
||||
|
||||
private static string AppendLaunchArgument(string? launchArguments, string launchArgument)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<UserControl
|
||||
x:Class="Wino.Mail.WinUI.Controls.AppModeFooterSwitcherControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:domain="using:Wino.Core.Domain">
|
||||
|
||||
<Grid>
|
||||
<controls:Segmented
|
||||
x:Name="ModeSegmentedControl"
|
||||
HorizontalAlignment="Stretch"
|
||||
SelectionChanged="ModeSegmentedControlSelectionChanged">
|
||||
<controls:SegmentedItem ToolTipService.ToolTip="{x:Bind domain:Translator.KeyboardShortcuts_ModeMail, Mode=OneWay}">
|
||||
<controls:SegmentedItem.Icon>
|
||||
<SymbolIcon Symbol="Mail" />
|
||||
</controls:SegmentedItem.Icon>
|
||||
</controls:SegmentedItem>
|
||||
<controls:SegmentedItem ToolTipService.ToolTip="{x:Bind domain:Translator.KeyboardShortcuts_ModeCalendar, Mode=OneWay}">
|
||||
<controls:SegmentedItem.Icon>
|
||||
<SymbolIcon Symbol="Calendar" />
|
||||
</controls:SegmentedItem.Icon>
|
||||
</controls:SegmentedItem>
|
||||
<controls:SegmentedItem ToolTipService.ToolTip="{x:Bind domain:Translator.ContactsPage_Title, Mode=OneWay}">
|
||||
<controls:SegmentedItem.Icon>
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
||||
</controls:SegmentedItem.Icon>
|
||||
</controls:SegmentedItem>
|
||||
</controls:Segmented>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Mail.WinUI.Controls;
|
||||
|
||||
public sealed partial class AppModeFooterSwitcherControl : UserControl
|
||||
{
|
||||
private readonly IStatePersistanceService _statePersistenceService;
|
||||
private readonly INavigationService _navigationService;
|
||||
private bool _isUpdatingSelection;
|
||||
|
||||
public AppModeFooterSwitcherControl()
|
||||
{
|
||||
_statePersistenceService = WinoApplication.Current.Services.GetRequiredService<IStatePersistanceService>();
|
||||
_navigationService = WinoApplication.Current.Services.GetRequiredService<INavigationService>();
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Loaded += ControlLoaded;
|
||||
Unloaded += ControlUnloaded;
|
||||
}
|
||||
|
||||
private void ControlLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_statePersistenceService.StatePropertyChanged += StatePropertyChanged;
|
||||
UpdateSelection(_statePersistenceService.ApplicationMode);
|
||||
}
|
||||
|
||||
private void ControlUnloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_statePersistenceService.StatePropertyChanged -= StatePropertyChanged;
|
||||
}
|
||||
|
||||
private void StatePropertyChanged(object? sender, string propertyName)
|
||||
{
|
||||
if (propertyName != nameof(IStatePersistanceService.ApplicationMode))
|
||||
return;
|
||||
|
||||
DispatcherQueue.TryEnqueue(() => UpdateSelection(_statePersistenceService.ApplicationMode));
|
||||
}
|
||||
|
||||
private void ModeSegmentedControlSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (_isUpdatingSelection)
|
||||
return;
|
||||
|
||||
var selectedMode = ModeSegmentedControl.SelectedIndex switch
|
||||
{
|
||||
1 => WinoApplicationMode.Calendar,
|
||||
2 => WinoApplicationMode.Contacts,
|
||||
_ => WinoApplicationMode.Mail
|
||||
};
|
||||
|
||||
if (selectedMode == _statePersistenceService.ApplicationMode)
|
||||
return;
|
||||
|
||||
_navigationService.ChangeApplicationMode(selectedMode);
|
||||
}
|
||||
|
||||
private void UpdateSelection(WinoApplicationMode mode)
|
||||
{
|
||||
_isUpdatingSelection = true;
|
||||
ModeSegmentedControl.SelectedIndex = mode switch
|
||||
{
|
||||
WinoApplicationMode.Calendar => 1,
|
||||
WinoApplicationMode.Contacts => 2,
|
||||
_ => 0
|
||||
};
|
||||
_isUpdatingSelection = false;
|
||||
}
|
||||
}
|
||||
@@ -80,9 +80,9 @@
|
||||
|
||||
<muxc:ProgressRing
|
||||
x:Name="BusyRing"
|
||||
Grid.Column="2"
|
||||
Width="14"
|
||||
Height="14"
|
||||
Grid.Column="2"
|
||||
Margin="0,2,2,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
|
||||
@@ -22,18 +22,14 @@
|
||||
<DataTemplate x:DataType="models:UpdateNoteSection">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Padding="8" Spacing="12">
|
||||
<controls:MarkdownTextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{x:Bind Title, Mode=OneTime}" />
|
||||
<controls:MarkdownTextBlock HorizontalAlignment="Center" Text="{x:Bind Title, Mode=OneTime}" />
|
||||
<Image
|
||||
Width="{x:Bind ActualImageWidth, Mode=OneTime}"
|
||||
Height="{x:Bind ActualImageHeight, Mode=OneTime}"
|
||||
HorizontalAlignment="Center"
|
||||
Source="{x:Bind ImageUrl, Mode=OneTime}"
|
||||
Stretch="Uniform" />
|
||||
<controls:MarkdownTextBlock
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{x:Bind Description, Mode=OneTime}" />
|
||||
<controls:MarkdownTextBlock HorizontalAlignment="Stretch" Text="{x:Bind Description, Mode=OneTime}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
@@ -44,7 +40,7 @@
|
||||
x:Name="FlipViewPager"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
SelectedPageIndex="0"
|
||||
SelectedIndexChanged="OnPipsPagerSelectedIndexChanged" />
|
||||
SelectedIndexChanged="OnPipsPagerSelectedIndexChanged"
|
||||
SelectedPageIndex="0" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -30,9 +30,7 @@
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="shared:MailAccount">
|
||||
<TextBlock
|
||||
Style="{ThemeResource BodyTextBlockStyle}"
|
||||
Text="{x:Bind Address}" />
|
||||
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind Address}" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
@@ -49,9 +49,7 @@
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="2">
|
||||
<TextBlock
|
||||
Style="{ThemeResource BodyStrongTextBlockStyle}"
|
||||
Text="{x:Bind StartupEntityTitle}" />
|
||||
<TextBlock Style="{ThemeResource BodyStrongTextBlockStyle}" Text="{x:Bind StartupEntityTitle}" />
|
||||
<TextBlock
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Style="{ThemeResource CaptionTextBlockStyle}"
|
||||
@@ -86,9 +84,7 @@
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="2">
|
||||
<TextBlock
|
||||
Style="{ThemeResource BodyStrongTextBlockStyle}"
|
||||
Text="{x:Bind StartupEntityTitle}" />
|
||||
<TextBlock Style="{ThemeResource BodyStrongTextBlockStyle}" Text="{x:Bind StartupEntityTitle}" />
|
||||
<TextBlock
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Style="{ThemeResource CaptionTextBlockStyle}"
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
Style="{ThemeResource BodyStrongTextBlockStyle}"
|
||||
Text="{x:Bind domain:Translator.ContactEditDialog_PhotoSection, Mode=OneTime}" />
|
||||
<Border
|
||||
Padding="16"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
Padding="16">
|
||||
CornerRadius="6">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Style="{ThemeResource BodyTextBlockStyle}"
|
||||
Text="{x:Bind domain:Translator.CreateAccountAliasDialog_Description}" />
|
||||
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind domain:Translator.CreateAccountAliasDialog_Description}" />
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
x:Name="PreviewAccentColorGrid"
|
||||
Width="20"
|
||||
Height="20"
|
||||
CornerRadius="4"
|
||||
Background="{ThemeResource SystemAccentColor}" />
|
||||
Background="{ThemeResource SystemAccentColor}"
|
||||
CornerRadius="4" />
|
||||
</StackPanel>
|
||||
</Button.Content>
|
||||
<Button.Flyout>
|
||||
|
||||
@@ -46,15 +46,13 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border
|
||||
x:Name="InvalidFolderBorder"
|
||||
Margin="0,0,0,6"
|
||||
Padding="12,8"
|
||||
Background="{ThemeResource SystemFillColorCautionBackgroundBrush}"
|
||||
CornerRadius="4"
|
||||
Padding="12,8"
|
||||
Visibility="Collapsed"
|
||||
x:Name="InvalidFolderBorder">
|
||||
<TextBlock
|
||||
x:Name="InvalidFolderText"
|
||||
Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}" />
|
||||
Visibility="Collapsed">
|
||||
<TextBlock x:Name="InvalidFolderText" Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}" />
|
||||
</Border>
|
||||
|
||||
<TreeView
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
Style="{ThemeResource BodyStrongTextBlockStyle}"
|
||||
Text="Options" />
|
||||
<Border
|
||||
Padding="16,12"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
Padding="16,12">
|
||||
CornerRadius="6">
|
||||
<StackPanel Spacing="8">
|
||||
<CheckBox Content="Print backgrounds" IsChecked="{x:Bind PrintSettings.ShouldPrintBackgrounds, Mode=TwoWay}" />
|
||||
<CheckBox Content="Print headers and footers" IsChecked="{x:Bind PrintSettings.ShouldPrintHeaderAndFooter, Mode=TwoWay}" />
|
||||
|
||||
@@ -94,9 +94,9 @@
|
||||
|
||||
<Border
|
||||
x:Name="ValidationErrorBorder"
|
||||
Padding="12,8"
|
||||
Background="{ThemeResource SystemFillColorCriticalBackgroundBrush}"
|
||||
CornerRadius="4"
|
||||
Padding="12,8"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock x:Name="ValidationErrorTextBlock" Foreground="{StaticResource SystemErrorTextColor}" />
|
||||
</Border>
|
||||
|
||||
@@ -375,9 +375,7 @@
|
||||
|
||||
<coreSelectors:NavigationMenuTemplateSelector
|
||||
x:Key="NavigationMenuTemplateSelector"
|
||||
AccountManagementTemplate="{StaticResource ManageAccountsTemplate}"
|
||||
ClickableAccountMenuTemplate="{StaticResource ClickableAccountMenuTemplate}"
|
||||
ContactsMenuItemTemplate="{StaticResource ContactsTemplate}"
|
||||
FixAuthenticationIssueTemplate="{StaticResource FixAuthenticationIssueTemplate}"
|
||||
FixMissingFolderConfigTemplate="{StaticResource FixMissingFolderConfig}"
|
||||
FolderMenuTemplate="{StaticResource FolderMenuTemplate}"
|
||||
@@ -387,7 +385,6 @@
|
||||
NewMailTemplate="{StaticResource CreateNewMailTemplate}"
|
||||
RatingItemTemplate="{StaticResource RatingItemTemplate}"
|
||||
SeperatorTemplate="{StaticResource SeperatorTemplate}"
|
||||
SettingsItemTemplate="{StaticResource SettingsItemTemplate}"
|
||||
StoreUpdateItemTemplate="{StaticResource StoreUpdateItemTemplate}" />
|
||||
</Page.Resources>
|
||||
|
||||
@@ -402,11 +399,11 @@
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="3"
|
||||
Margin="-1,-1,0,0"
|
||||
Style="{StaticResource CalendarShellNavigationViewStyle}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AlwaysShowHeader="True"
|
||||
DisplayModeChanged="NavigationViewDisplayModeChanged"
|
||||
FooterMenuItemsSource="{x:Bind ViewModel.FooterItems, Mode=OneWay}"
|
||||
IsBackButtonVisible="Collapsed"
|
||||
IsPaneOpen="{x:Bind ViewModel.PreferencesService.IsNavigationPaneOpened, Mode=TwoWay}"
|
||||
IsPaneToggleButtonVisible="False"
|
||||
|
||||
@@ -19,10 +19,12 @@ using Wino.Mail.WinUI.Views.Calendar;
|
||||
using Wino.Messaging.Client.Calendar;
|
||||
using Wino.Messaging.Client.Mails;
|
||||
using Wino.Messaging.Client.Navigation;
|
||||
using Wino.Mail.WinUI.Views.Contacts;
|
||||
using Wino.Views;
|
||||
using Wino.Views.Account;
|
||||
using Wino.Views.Mail;
|
||||
using Wino.Views.Settings;
|
||||
using Microsoft.UI.Xaml.Media.Animation;
|
||||
|
||||
namespace Wino.Services;
|
||||
|
||||
@@ -58,6 +60,11 @@ public class NavigationService : NavigationServiceBase, INavigationService
|
||||
WinoPage.CalendarEventComposePage
|
||||
];
|
||||
|
||||
private static readonly WinoPage[] ContactsOnlyPages =
|
||||
[
|
||||
WinoPage.ContactsPage
|
||||
];
|
||||
|
||||
public NavigationService(IStatePersistanceService statePersistanceService, IDispatcher dispatcher, IWinoWindowManager windowManager)
|
||||
{
|
||||
_statePersistanceService = statePersistanceService;
|
||||
@@ -184,15 +191,20 @@ public class NavigationService : NavigationServiceBase, INavigationService
|
||||
|
||||
if (coreFrame == null) return false;
|
||||
|
||||
var currentMode = _statePersistanceService.ApplicationMode;
|
||||
|
||||
// Update the application mode in state persistence service
|
||||
_statePersistanceService.ApplicationMode = mode;
|
||||
_statePersistanceService.AppModeTitle = mode == WinoApplicationMode.Calendar
|
||||
? "Wino Calendar"
|
||||
: "Wino Mail";
|
||||
_statePersistanceService.AppModeTitle = GetApplicationModeTitle(mode);
|
||||
|
||||
var targetPageType = mode == WinoApplicationMode.Mail ? typeof(MailAppShell) : typeof(CalendarAppShell);
|
||||
var targetPageType = mode switch
|
||||
{
|
||||
WinoApplicationMode.Calendar => typeof(CalendarAppShell),
|
||||
WinoApplicationMode.Contacts => typeof(ContactsAppShell),
|
||||
_ => typeof(MailAppShell)
|
||||
};
|
||||
var currentPageType = coreFrame.Content?.GetType();
|
||||
var transitionInfo = GetNavigationTransitionInfo(NavigationTransitionType.DrillIn);
|
||||
var transitionInfo = GetApplicationModeTransitionInfo(currentMode, mode);
|
||||
|
||||
// If already on the target page, do nothing
|
||||
if (currentPageType == targetPageType)
|
||||
@@ -241,12 +253,7 @@ public class NavigationService : NavigationServiceBase, INavigationService
|
||||
|
||||
var currentApplicationMode = _statePersistanceService.ApplicationMode;
|
||||
|
||||
if (currentApplicationMode == WinoApplicationMode.Calendar && IsMailOnlyPage(page))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (currentApplicationMode == WinoApplicationMode.Mail && IsCalendarOnlyPage(page))
|
||||
if (!IsPageAllowedInMode(currentApplicationMode, page))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -368,6 +375,47 @@ public class NavigationService : NavigationServiceBase, INavigationService
|
||||
private static bool IsCalendarOnlyPage(WinoPage page)
|
||||
=> CalendarOnlyPages.Contains(page);
|
||||
|
||||
private static bool IsContactsOnlyPage(WinoPage page)
|
||||
=> ContactsOnlyPages.Contains(page);
|
||||
|
||||
private static bool IsPageAllowedInMode(WinoApplicationMode mode, WinoPage page)
|
||||
=> mode switch
|
||||
{
|
||||
WinoApplicationMode.Mail => !IsCalendarOnlyPage(page) && !IsContactsOnlyPage(page),
|
||||
WinoApplicationMode.Calendar => !IsMailOnlyPage(page) && !IsContactsOnlyPage(page),
|
||||
WinoApplicationMode.Contacts => !IsMailOnlyPage(page) && !IsCalendarOnlyPage(page),
|
||||
_ => true
|
||||
};
|
||||
|
||||
private static string GetApplicationModeTitle(WinoApplicationMode mode)
|
||||
=> mode switch
|
||||
{
|
||||
WinoApplicationMode.Calendar => "Wino Calendar",
|
||||
WinoApplicationMode.Contacts => "Wino Contacts",
|
||||
_ => "Wino Mail"
|
||||
};
|
||||
|
||||
private static NavigationTransitionInfo GetApplicationModeTransitionInfo(WinoApplicationMode currentMode, WinoApplicationMode targetMode)
|
||||
{
|
||||
var slideEffect = IsNextMode(currentMode, targetMode)
|
||||
? SlideNavigationTransitionEffect.FromRight
|
||||
: SlideNavigationTransitionEffect.FromLeft;
|
||||
|
||||
return new SlideNavigationTransitionInfo
|
||||
{
|
||||
Effect = slideEffect
|
||||
};
|
||||
}
|
||||
|
||||
private static bool IsNextMode(WinoApplicationMode currentMode, WinoApplicationMode targetMode)
|
||||
=> currentMode switch
|
||||
{
|
||||
WinoApplicationMode.Mail => targetMode == WinoApplicationMode.Calendar,
|
||||
WinoApplicationMode.Calendar => targetMode == WinoApplicationMode.Contacts,
|
||||
WinoApplicationMode.Contacts => targetMode == WinoApplicationMode.Mail,
|
||||
_ => false
|
||||
};
|
||||
|
||||
private static LoadCalendarMessage CreateLoadCalendarMessage(CalendarPageNavigationArgs args)
|
||||
{
|
||||
var targetDate = args.RequestDefaultNavigation
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CommunityToolkit.WinUI.Controls;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
@@ -37,12 +36,12 @@ public sealed partial class ShellWindow : WindowEx, IWinoShellWindow,
|
||||
|
||||
public ICommand ShowWinoCommand { get; set; }
|
||||
public ICommand ShowWinoCalendarCommand { get; set; }
|
||||
public ICommand ShowWinoContactsCommand { get; set; }
|
||||
public ICommand RestoreCurrentModeCommand { get; set; }
|
||||
public ICommand ExitWinoCommand { get; set; }
|
||||
|
||||
public ObservableCollection<SynchronizationActionItem> SyncActionItems { get; } = new();
|
||||
private bool _calendarReminderServerStartAttempted;
|
||||
private bool _isApplyingActivationMode;
|
||||
private WinoApplicationMode _currentMode = WinoApplicationMode.Mail;
|
||||
|
||||
public ShellWindow()
|
||||
{
|
||||
@@ -65,6 +64,8 @@ public sealed partial class ShellWindow : WindowEx, IWinoShellWindow,
|
||||
|
||||
ShowWinoCommand = new RelayCommand(() => RestoreAndSwitchMode(WinoApplicationMode.Mail));
|
||||
ShowWinoCalendarCommand = new RelayCommand(() => RestoreAndSwitchMode(WinoApplicationMode.Calendar));
|
||||
ShowWinoContactsCommand = new RelayCommand(() => RestoreAndSwitchMode(WinoApplicationMode.Contacts));
|
||||
RestoreCurrentModeCommand = new RelayCommand(() => RestoreAndSwitchMode(StatePersistanceService.ApplicationMode));
|
||||
ExitWinoCommand = new RelayCommand(ForceClose);
|
||||
|
||||
this.SetIcon("Assets/Wino_Icon.ico");
|
||||
@@ -116,13 +117,6 @@ public sealed partial class ShellWindow : WindowEx, IWinoShellWindow,
|
||||
public void HandleAppActivation(string? launchArguments, string? tileId = null, string? appId = null)
|
||||
{
|
||||
var targetMode = AppModeActivationResolver.Resolve(launchArguments, tileId, appId, PreferencesService.DefaultApplicationMode);
|
||||
_currentMode = targetMode;
|
||||
|
||||
_isApplyingActivationMode = true;
|
||||
AppModeSegmentedControl.SelectedIndex = targetMode == WinoApplicationMode.Mail ? 0 : 1;
|
||||
_isApplyingActivationMode = false;
|
||||
|
||||
StatePersistanceService.AppModeTitle = GetAppModeTitle(targetMode);
|
||||
NavigationService.ChangeApplicationMode(targetMode);
|
||||
}
|
||||
|
||||
@@ -312,13 +306,6 @@ public sealed partial class ShellWindow : WindowEx, IWinoShellWindow,
|
||||
|
||||
private void RestoreAndSwitchMode(WinoApplicationMode mode)
|
||||
{
|
||||
_currentMode = mode;
|
||||
|
||||
_isApplyingActivationMode = true;
|
||||
AppModeSegmentedControl.SelectedIndex = mode == WinoApplicationMode.Mail ? 0 : 1;
|
||||
_isApplyingActivationMode = false;
|
||||
|
||||
StatePersistanceService.AppModeTitle = GetAppModeTitle(mode);
|
||||
NavigationService.ChangeApplicationMode(mode);
|
||||
RestoreFromTray();
|
||||
}
|
||||
@@ -358,24 +345,4 @@ public sealed partial class ShellWindow : WindowEx, IWinoShellWindow,
|
||||
WeakReferenceMessenger.Default.Unregister<SynchronizationActionsCompleted>(this);
|
||||
}
|
||||
|
||||
private void SegmentedChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (_isApplyingActivationMode || sender is not Segmented segmentedControl)
|
||||
return;
|
||||
|
||||
var selectedMode = segmentedControl.SelectedIndex == 1
|
||||
? WinoApplicationMode.Calendar
|
||||
: WinoApplicationMode.Mail;
|
||||
|
||||
if (selectedMode == _currentMode)
|
||||
return;
|
||||
|
||||
_currentMode = selectedMode;
|
||||
NavigationService.ChangeApplicationMode(selectedMode);
|
||||
}
|
||||
|
||||
private static string GetAppModeTitle(WinoApplicationMode mode)
|
||||
=> mode == WinoApplicationMode.Calendar
|
||||
? "Wino Calendar"
|
||||
: "Wino Mail";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,890 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:local="using:Wino.Mail.WinUI.Styles"
|
||||
xmlns:winoControls="using:Wino.Mail.WinUI.Controls"
|
||||
xmlns:primitives="using:Microsoft.UI.Xaml.Controls.Primitives">
|
||||
|
||||
<Style x:Key="CalendarShellNavigationViewStyle" TargetType="controls:NavigationView">
|
||||
<Setter Property="PaneToggleButtonStyle" Value="{StaticResource PaneToggleButtonStyle}" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="CompactPaneLength" Value="{ThemeResource NavigationViewCompactPaneLength}" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:NavigationView">
|
||||
<Grid x:Name="RootGrid">
|
||||
<!-- Button grid -->
|
||||
<Grid
|
||||
x:Name="PaneToggleButtonGrid"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Canvas.ZIndex="100">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="TogglePaneTopPadding" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}" />
|
||||
<Grid
|
||||
x:Name="ButtonHolderGrid"
|
||||
Grid.Row="1"
|
||||
Margin="{ThemeResource NavigationViewButtonHolderGridMargin}">
|
||||
<Button
|
||||
x:Name="NavigationViewBackButton"
|
||||
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}"
|
||||
VerticalAlignment="Top"
|
||||
IsEnabled="{TemplateBinding IsBackEnabled}"
|
||||
Style="{StaticResource NavigationBackButtonNormalStyle}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.BackButtonVisibility}">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip x:Name="NavigationViewBackButtonToolTip" />
|
||||
</ToolTipService.ToolTip>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="NavigationViewCloseButton"
|
||||
VerticalAlignment="Top"
|
||||
Style="{StaticResource NavigationBackButtonNormalStyle}">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip x:Name="NavigationViewCloseButtonToolTip" />
|
||||
</ToolTipService.ToolTip>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="TogglePaneButton"
|
||||
MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
AutomationProperties.LandmarkType="Navigation"
|
||||
FocusVisualMargin="0"
|
||||
Style="{TemplateBinding PaneToggleButtonStyle}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneToggleButtonVisibility}">
|
||||
<TextBlock
|
||||
x:Name="PaneTitleTextBlock"
|
||||
Grid.Column="0"
|
||||
Margin="0,-2,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource NavigationViewItemHeaderTextStyle}"
|
||||
Text="{TemplateBinding PaneTitle}" />
|
||||
</Button>
|
||||
<Grid
|
||||
x:Name="PaneTitleHolder"
|
||||
Height="40"
|
||||
Visibility="Collapsed">
|
||||
<ContentControl
|
||||
x:Name="PaneTitlePresenter"
|
||||
Margin="{ThemeResource NavigationViewPaneTitlePresenterMargin}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<!-- Content layouts -->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- DisplayMode top -->
|
||||
<StackPanel
|
||||
x:Name="TopNavArea"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Background="{ThemeResource NavigationViewTopPaneBackground}"
|
||||
Canvas.ZIndex="1"
|
||||
XYFocusKeyboardNavigation="Enabled">
|
||||
<Grid
|
||||
x:Name="TopNavTopPadding"
|
||||
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}" />
|
||||
<Grid
|
||||
x:Name="TopNavGrid"
|
||||
Height="{ThemeResource NavigationViewTopPaneHeight}"
|
||||
Margin="{ThemeResource TopNavigationViewTopNavGridMargin}"
|
||||
BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="BackButtonPlaceholderOnTopNav" Width="{ThemeResource NavigationBackButtonWidth}" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" MinWidth="{ThemeResource TopNavigationViewPaneCustomContentMinWidth}" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
x:Name="TopNavLeftPadding"
|
||||
Grid.Column="1"
|
||||
Width="0" />
|
||||
<ContentControl
|
||||
x:Name="PaneHeaderOnTopPane"
|
||||
Grid.Column="2"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<ContentControl
|
||||
x:Name="PaneTitleOnTopPane"
|
||||
Grid.Column="2"
|
||||
Margin="{ThemeResource NavigationViewItemInnerHeaderMargin}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<!-- Top nav ItemsRepeater -->
|
||||
<controls:ItemsRepeaterScrollHost Grid.Column="3">
|
||||
<ScrollViewer
|
||||
HorizontalScrollBarVisibility="Hidden"
|
||||
HorizontalScrollMode="Disabled"
|
||||
VerticalScrollBarVisibility="Hidden"
|
||||
VerticalScrollMode="Disabled">
|
||||
<controls:ItemsRepeater
|
||||
x:Name="TopNavMenuItemsHost"
|
||||
AutomationProperties.AccessibilityView="Content"
|
||||
AutomationProperties.LandmarkType="Navigation"
|
||||
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}">
|
||||
<controls:ItemsRepeater.Layout>
|
||||
<controls:StackLayout Orientation="Horizontal" />
|
||||
</controls:ItemsRepeater.Layout>
|
||||
</controls:ItemsRepeater>
|
||||
</ScrollViewer>
|
||||
</controls:ItemsRepeaterScrollHost>
|
||||
<Button
|
||||
x:Name="TopNavOverflowButton"
|
||||
Grid.Column="4"
|
||||
Margin="{ThemeResource TopNavigationViewOverflowButtonMargin}"
|
||||
Content="More"
|
||||
Style="{StaticResource NavigationViewOverflowButtonStyleWhenPaneOnTop}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OverflowButtonVisibility}">
|
||||
<Button.Flyout>
|
||||
<Flyout ElementSoundMode="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ElementSoundMode}" Placement="BottomEdgeAlignedRight">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style TargetType="FlyoutPresenter">
|
||||
<Setter Property="Padding" Value="{ThemeResource TopNavigationViewOverflowMenuPadding}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="FlyoutPresenter">
|
||||
<ScrollViewer
|
||||
x:Name="ScrollViewer"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Flyout.FlyoutPresenterStyle>
|
||||
<controls:ItemsRepeaterScrollHost>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<controls:ItemsRepeater x:Name="TopNavMenuItemsOverflowHost" AutomationProperties.AccessibilityView="Content">
|
||||
<controls:ItemsRepeater.Layout>
|
||||
<controls:StackLayout />
|
||||
</controls:ItemsRepeater.Layout>
|
||||
</controls:ItemsRepeater>
|
||||
</ScrollViewer>
|
||||
</controls:ItemsRepeaterScrollHost>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
<ContentControl
|
||||
x:Name="PaneCustomContentOnTopPane"
|
||||
Grid.Column="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<Grid
|
||||
x:Name="TopPaneAutoSuggestArea"
|
||||
Grid.Column="6"
|
||||
Height="{ThemeResource NavigationViewTopPaneHeight}">
|
||||
<ContentControl
|
||||
x:Name="TopPaneAutoSuggestBoxPresenter"
|
||||
MinWidth="216"
|
||||
Margin="{ThemeResource TopNavigationViewAutoSuggestBoxMargin}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
IsTabStop="False" />
|
||||
</Grid>
|
||||
<ContentControl
|
||||
x:Name="PaneFooterOnTopPane"
|
||||
Grid.Column="7"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<!-- Top footer menu ItemsRepeater -->
|
||||
<controls:ItemsRepeater
|
||||
x:Name="TopFooterMenuItemsHost"
|
||||
Grid.Column="8"
|
||||
AutomationProperties.AccessibilityView="Content"
|
||||
AutomationProperties.LandmarkType="Navigation">
|
||||
<controls:ItemsRepeater.Layout>
|
||||
<controls:StackLayout Orientation="Horizontal" />
|
||||
</controls:ItemsRepeater.Layout>
|
||||
</controls:ItemsRepeater>
|
||||
</Grid>
|
||||
<Border x:Name="TopNavContentOverlayAreaGrid" Child="{TemplateBinding ContentOverlay}" />
|
||||
</StackPanel>
|
||||
<!-- Displaymode (compact/minimal/normal) left -->
|
||||
<SplitView
|
||||
x:Name="RootSplitView"
|
||||
Grid.Row="1"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}"
|
||||
BorderThickness="{ThemeResource NavigationViewBorderThickness}"
|
||||
CompactPaneLength="{TemplateBinding CompactPaneLength}"
|
||||
CornerRadius="{Binding Source={ThemeResource OverlayCornerRadius}, Converter={StaticResource RightCornerRadiusFilterConverter}}"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPaneOpen, Mode=TwoWay}"
|
||||
IsTabStop="False"
|
||||
OpenPaneLength="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OpenPaneLength}"
|
||||
PaneBackground="{ThemeResource NavigationViewDefaultPaneBackground}">
|
||||
<SplitView.Pane>
|
||||
<Grid
|
||||
x:Name="PaneContentGrid"
|
||||
Margin="{ThemeResource NavigationViewPaneContentGridMargin}"
|
||||
BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="0" />
|
||||
<!-- above button margin + back button space -->
|
||||
<RowDefinition x:Name="PaneContentGridToggleButtonRow" Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="0" />
|
||||
<!-- above list margin -->
|
||||
<RowDefinition x:Name="ItemsContainerRow" Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="ContentPaneTopPadding" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}" />
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition x:Name="PaneHeaderContentBorderRow" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="PaneHeaderCloseButtonColumn" />
|
||||
<ColumnDefinition x:Name="PaneHeaderToggleButtonColumn" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentControl
|
||||
x:Name="PaneHeaderContentBorder"
|
||||
Grid.Column="2"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="AutoSuggestArea"
|
||||
Grid.Row="3"
|
||||
MinHeight="{ThemeResource NavigationViewAutoSuggestAreaHeight}"
|
||||
Margin="0,0,0,8"
|
||||
VerticalAlignment="Center">
|
||||
<ContentControl
|
||||
x:Name="PaneAutoSuggestBoxPresenter"
|
||||
Margin="{ThemeResource NavigationViewAutoSuggestBoxMargin}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
IsTabStop="False" />
|
||||
<Button
|
||||
x:Name="PaneAutoSuggestButton"
|
||||
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}"
|
||||
Style="{ThemeResource NavigationViewPaneSearchButtonStyle}"
|
||||
Visibility="Collapsed">
|
||||
<Button.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Default">
|
||||
<StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="NavigationViewItemBackgroundPointerOver" />
|
||||
<StaticResource x:Key="ButtonBackgroundPressed" ResourceKey="NavigationViewItemBackgroundPressed" />
|
||||
<StaticResource x:Key="ButtonBackgroundDisabled" ResourceKey="NavigationViewItemBackgroundDisabled" />
|
||||
<StaticResource x:Key="ButtonForegroundPointerOver" ResourceKey="NavigationViewItemForegroundPointerOver" />
|
||||
<StaticResource x:Key="ButtonForegroundPressed" ResourceKey="NavigationViewItemForegroundPressed" />
|
||||
<StaticResource x:Key="ButtonForegroundDisabled" ResourceKey="NavigationViewItemForegroundDisabled" />
|
||||
<StaticResource x:Key="ButtonBorderBrushPointerOver" ResourceKey="NavigationViewItemBorderBrushPointerOver" />
|
||||
<StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="NavigationViewItemBorderBrushPressed" />
|
||||
<StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="NavigationViewItemBorderBrushDisabled" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="NavigationViewItemBackgroundPointerOver" />
|
||||
<StaticResource x:Key="ButtonBackgroundPressed" ResourceKey="NavigationViewItemBackgroundPressed" />
|
||||
<StaticResource x:Key="ButtonBackgroundDisabled" ResourceKey="NavigationViewItemBackgroundDisabled" />
|
||||
<StaticResource x:Key="ButtonForegroundPointerOver" ResourceKey="NavigationViewItemForegroundPointerOver" />
|
||||
<StaticResource x:Key="ButtonForegroundPressed" ResourceKey="NavigationViewItemForegroundPressed" />
|
||||
<StaticResource x:Key="ButtonForegroundDisabled" ResourceKey="NavigationViewItemForegroundDisabled" />
|
||||
<StaticResource x:Key="ButtonBorderBrushPointerOver" ResourceKey="NavigationViewItemBorderBrushPointerOver" />
|
||||
<StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="NavigationViewItemBorderBrushPressed" />
|
||||
<StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="NavigationViewItemBorderBrushDisabled" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<!-- "Non header" content -->
|
||||
<Grid x:Name="ItemsContainerGrid" Grid.Row="6">
|
||||
<Grid.RowDefinitions>
|
||||
<!-- Custom pane custom content -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- MenuItems -->
|
||||
<RowDefinition Height="*" />
|
||||
<!-- Separator if overflow -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- PaneFooter -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- FooterItems -->
|
||||
</Grid.RowDefinitions>
|
||||
<!-- MenuItems -->
|
||||
<controls:ItemsRepeaterScrollHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<ScrollViewer
|
||||
x:Name="MenuItemsScrollViewer"
|
||||
TabNavigation="Local"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<!-- Left nav ItemsRepeater -->
|
||||
<controls:ItemsRepeater
|
||||
x:Name="MenuItemsHost"
|
||||
AutomationProperties.AccessibilityView="Content"
|
||||
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}">
|
||||
<controls:ItemsRepeater.Layout>
|
||||
<controls:StackLayout />
|
||||
</controls:ItemsRepeater.Layout>
|
||||
</controls:ItemsRepeater>
|
||||
</ScrollViewer>
|
||||
</controls:ItemsRepeaterScrollHost>
|
||||
<controls:NavigationViewItemSeparator
|
||||
x:Name="VisualItemsSeparator"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="Collapsed" />
|
||||
<ContentControl
|
||||
x:Name="PaneCustomContentBorder"
|
||||
Grid.Row="1"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<!-- PaneFooter -->
|
||||
<ContentControl
|
||||
x:Name="FooterContentBorder"
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,4"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<Border
|
||||
Grid.Row="3"
|
||||
Margin="8,8,8,12"
|
||||
Padding="8"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
CornerRadius="{ThemeResource OverlayCornerRadius}">
|
||||
<winoControls:AppModeFooterSwitcherControl />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<Grid
|
||||
x:Name="ContentGrid"
|
||||
Margin="{ThemeResource NavigationViewContentMargin}"
|
||||
Background="{ThemeResource NavigationViewContentBackground}"
|
||||
BorderBrush="{ThemeResource NavigationViewContentGridBorderBrush}"
|
||||
BorderThickness="{ThemeResource NavigationViewContentGridBorderThickness}"
|
||||
CornerRadius="{ThemeResource NavigationViewContentGridCornerRadius}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
x:Name="ContentTopPadding"
|
||||
Grid.ColumnSpan="2"
|
||||
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}" />
|
||||
<Grid x:Name="ContentLeftPadding" Grid.Row="1" />
|
||||
<ContentControl
|
||||
x:Name="HeaderContent"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
MinHeight="{StaticResource PaneToggleButtonHeight}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
IsTabStop="False"
|
||||
Style="{StaticResource NavigationViewTitleHeaderContentControlTextStyle}" />
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="{ThemeResource NavigationViewContentPresenterMargin}"
|
||||
AutomationProperties.LandmarkType="Main"
|
||||
Content="{TemplateBinding Content}" />
|
||||
</Grid>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
<Grid
|
||||
x:Name="ShadowCaster"
|
||||
Grid.RowSpan="2"
|
||||
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OpenPaneLength}"
|
||||
HorizontalAlignment="Left">
|
||||
<Grid.RenderTransform>
|
||||
<CompositeTransform x:Name="ShadowCasterTransform" />
|
||||
</Grid.RenderTransform>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="DisplayModeGroup">
|
||||
<VisualState x:Name="Compact" />
|
||||
<VisualState x:Name="Expanded" />
|
||||
<VisualState x:Name="Minimal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderContent.Margin" Value="{ThemeResource NavigationViewMinimalHeaderMargin}" />
|
||||
<Setter Target="NavigationViewBackButton.Style" Value="{ThemeResource NavigationBackButtonSmallStyle}" />
|
||||
<Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource NavigationViewMinimalContentGridBorderThickness}" />
|
||||
<Setter Target="ContentGrid.CornerRadius" Value="{ThemeResource NavigationViewMinimalContentGridCornerRadius}" />
|
||||
<Setter Target="ContentGrid.Margin" Value="{ThemeResource NavigationViewMinimalContentMargin}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="TopNavigationMinimal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource TopNavigationViewContentGridBorderThickness}" />
|
||||
<Setter Target="ContentGrid.CornerRadius" Value="{ThemeResource TopNavigationViewContentGridCornerRadius}" />
|
||||
<Setter Target="ContentGrid.Margin" Value="{ThemeResource TopNavigationViewContentMargin}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="MinimalWithBackButton">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderContent.Margin" Value="{ThemeResource NavigationViewMinimalHeaderMargin}" />
|
||||
<Setter Target="NavigationViewBackButton.Style" Value="{ThemeResource NavigationBackButtonSmallStyle}" />
|
||||
<Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource NavigationViewMinimalContentGridBorderThickness}" />
|
||||
<Setter Target="ContentGrid.CornerRadius" Value="{ThemeResource NavigationViewMinimalContentGridCornerRadius}" />
|
||||
<Setter Target="ContentGrid.Margin" Value="{ThemeResource NavigationViewMinimalContentMargin}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="TogglePaneGroup">
|
||||
<VisualState x:Name="TogglePaneButtonCollapsed" />
|
||||
<VisualState x:Name="TogglePaneButtonVisible">
|
||||
<VisualState.Setters>
|
||||
<!-- Might not need this setter when all the margins/paddings will be adequately set. -->
|
||||
<!-- This MinHeight setter is only here to ensure that AutoSuggestBox doesn't draw over ToggleButton. -->
|
||||
<Setter Target="PaneContentGridToggleButtonRow.MinHeight" Value="{StaticResource NavigationViewPaneHeaderRowMinHeight}" />
|
||||
<Setter Target="PaneTitlePresenter.Margin" Value="{ThemeResource NavigationViewItemInnerHeaderMargin}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="HeaderGroup">
|
||||
<VisualState x:Name="HeaderVisible" />
|
||||
<VisualState x:Name="HeaderCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderContent.Visibility" Value="Collapsed" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="AutoSuggestGroup">
|
||||
<VisualState x:Name="AutoSuggestBoxVisible" />
|
||||
<VisualState x:Name="AutoSuggestBoxCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="AutoSuggestArea.Visibility" Value="Collapsed" />
|
||||
<Setter Target="TopPaneAutoSuggestArea.Visibility" Value="Collapsed" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="PaneStateGroup">
|
||||
<VisualState x:Name="NotClosedCompact" />
|
||||
<VisualState x:Name="ClosedCompact">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="PaneAutoSuggestBoxPresenter.Visibility" Value="Collapsed" />
|
||||
<Setter Target="PaneAutoSuggestButton.Visibility" Value="Visible" />
|
||||
<Setter Target="PaneCustomContentBorder.Visibility" Value="Collapsed" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="PaneStateListSizeGroup">
|
||||
<VisualState x:Name="ListSizeFull" />
|
||||
<VisualState x:Name="ListSizeCompact">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="PaneContentGrid.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
|
||||
<Setter Target="ShadowCaster.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
|
||||
<Setter Target="PaneTitleTextBlock.Visibility" Value="Collapsed" />
|
||||
<Setter Target="PaneHeaderContentBorder.Visibility" Value="Collapsed" />
|
||||
<Setter Target="PaneContentGrid.HorizontalAlignment" Value="Left" />
|
||||
<Setter Target="PaneCustomContentBorder.HorizontalAlignment" Value="Left" />
|
||||
<Setter Target="FooterContentBorder.HorizontalAlignment" Value="Left" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="PaneOverlayGroup">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="PaneNotOverlaying" To="PaneOverlaying">
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCasterTransform" Storyboard.TargetProperty="TranslateX">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="{Binding ElementName=RootSplitView, Path=TemplateSettings.NegativeOpenPaneLengthMinusCompactLength}" />
|
||||
<SplineDoubleKeyFrame
|
||||
KeySpline="0.1,0.9 0.2,1.0"
|
||||
KeyTime="0:0:0.35"
|
||||
Value="0" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="Opacity">
|
||||
<LinearDoubleKeyFrame KeyTime="0:0:0.35" Value="1" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="HorizontalAlignment">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
<VisualTransition From="PaneOverlaying" To="PaneNotOverlaying">
|
||||
<Storyboard x:Name="ShadowCasterEaseOutStoryboard">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCasterTransform" Storyboard.TargetProperty="TranslateX">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
|
||||
<SplineDoubleKeyFrame
|
||||
KeySpline="0.1,0.9 0.2,1.0"
|
||||
KeyTime="0:0:0.12"
|
||||
Value="{Binding ElementName=RootSplitView, Path=TemplateSettings.NegativeOpenPaneLengthMinusCompactLength}" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="Opacity">
|
||||
<LinearDoubleKeyFrame KeyTime="0:0:0.12" Value="0" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="HorizontalAlignment">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="PaneOverlaying" />
|
||||
<VisualState x:Name="PaneNotOverlaying">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootSplitView.BorderBrush" Value="Transparent" />
|
||||
<Setter Target="ShadowCaster.Opacity" Value="0" />
|
||||
<Setter Target="RootSplitView.PaneBackground" Value="{ThemeResource NavigationViewExpandedPaneBackground}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="TitleBarVisibilityGroup">
|
||||
<VisualState x:Name="TitleBarVisible" />
|
||||
<VisualState x:Name="TitleBarCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="PaneContentGrid.Margin" Value="0,32,0,0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="OverflowLabelGroup">
|
||||
<VisualState x:Name="OverflowButtonWithLabel" />
|
||||
<VisualState x:Name="OverflowButtonNoLabel">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="BackButtonGroup">
|
||||
<VisualState x:Name="BackButtonVisible" />
|
||||
<VisualState x:Name="BackButtonCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="BackButtonPlaceholderOnTopNav.Width" Value="0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="PaneVisibilityGroup">
|
||||
<VisualState x:Name="PaneVisible" />
|
||||
<VisualState x:Name="PaneCollapsed">
|
||||
<VisualState.Setters>
|
||||
<!-- Note that RootSplitView.DisplayMode is set in code so we don't want to -->
|
||||
<!-- write it here and interfere. But these values work together to hide -->
|
||||
<!-- the left pane. -->
|
||||
<Setter Target="RootSplitView.CompactPaneLength" Value="0" />
|
||||
<Setter Target="ShadowCaster.Width" Value="0" />
|
||||
<Setter Target="PaneToggleButtonGrid.Visibility" Value="Collapsed" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="PaneSeparatorStates">
|
||||
<VisualState x:Name="SeparatorCollapsed" />
|
||||
<VisualState x:Name="SeparatorVisible">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="VisualItemsSeparator.Visibility" Value="Visible" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="controls:NavigationViewItem">
|
||||
<Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" />
|
||||
<Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}" />
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Margin" Value="{ThemeResource NavigationViewItemMargin}" />
|
||||
<Setter Property="UseSystemFocusVisuals" Value="True" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:NavigationViewItem">
|
||||
<Grid x:Name="NVIRootGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<primitives:NavigationViewItemPresenter
|
||||
x:Name="NavigationViewItemPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
Control.IsTemplateFocusTarget="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Icon="{TemplateBinding Icon}"
|
||||
InfoBadge="{TemplateBinding InfoBadge}"
|
||||
IsTabStop="false"
|
||||
UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" />
|
||||
<controls:ItemsRepeater
|
||||
x:Name="NavigationViewItemMenuItemsHost"
|
||||
Grid.Row="1"
|
||||
x:Load="False"
|
||||
Visibility="Collapsed">
|
||||
<controls:ItemsRepeater.Layout>
|
||||
<controls:StackLayout Orientation="Vertical" />
|
||||
</controls:ItemsRepeater.Layout>
|
||||
</controls:ItemsRepeater>
|
||||
<FlyoutBase.AttachedFlyout>
|
||||
<Flyout x:Name="ChildrenFlyout" Placement="RightEdgeAlignedTop">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style TargetType="FlyoutPresenter">
|
||||
<Setter Property="Padding" Value="{ThemeResource NavigationViewItemChildrenMenuFlyoutPadding}" />
|
||||
<!-- Set negative top margin to make the flyout align exactly with the button -->
|
||||
<Setter Property="Margin" Value="0,-4,0,0" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="FlyoutPresenter">
|
||||
<ScrollViewer
|
||||
x:Name="ScrollViewer"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Flyout.FlyoutPresenterStyle>
|
||||
<Grid x:Name="FlyoutRootGrid">
|
||||
<Grid x:Name="FlyoutContentGrid" />
|
||||
</Grid>
|
||||
</Flyout>
|
||||
</FlyoutBase.AttachedFlyout>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates">
|
||||
<VisualState x:Name="OnLeftNavigation">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="OnTopNavigationPrimary">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" />
|
||||
<Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" />
|
||||
<Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="OnTopNavigationOverflow">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="primitives:NavigationViewItemPresenter" />
|
||||
<Style TargetType="controls:NavigationViewItemHeader">
|
||||
<Setter Property="Foreground" Value="{ThemeResource NavigationViewItemHeaderForeground}" />
|
||||
<Setter Property="IsEnabled" Value="False" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:NavigationViewItemHeader">
|
||||
<Grid x:Name="NavigationViewItemHeaderRootGrid">
|
||||
<Grid
|
||||
x:Name="InnerHeaderGrid"
|
||||
Height="40"
|
||||
Margin="{ThemeResource NavigationViewItemInnerHeaderMargin}"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock
|
||||
x:Name="HeaderText"
|
||||
Margin="0,-1,0,-1"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource NavigationViewItemHeaderTextStyle}"
|
||||
Text="{TemplateBinding Content}"
|
||||
TextWrapping="NoWrap" />
|
||||
</Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="PaneStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="HeaderTextCollapsed" To="HeaderTextVisible">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerHeaderGrid" Storyboard.TargetProperty="Height">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="40" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Opacity">
|
||||
<LinearDoubleKeyFrame KeyTime="0:0:0" Value="0.0" />
|
||||
<LinearDoubleKeyFrame KeyTime="0:0:0.1" Value="0.0" />
|
||||
<SplineDoubleKeyFrame
|
||||
KeySpline="0.0,0.35 0.15,1.0"
|
||||
KeyTime="0:0:0.2"
|
||||
Value="1.0" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
<VisualTransition From="HeaderTextVisible" To="HeaderTextCollapsed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerHeaderGrid" Storyboard.TargetProperty="Height">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="Collapsed" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Opacity">
|
||||
<LinearDoubleKeyFrame KeyTime="0:0:0" Value="1.0" />
|
||||
<SplineDoubleKeyFrame
|
||||
KeySpline="0.0,0.35 0.15,1.0"
|
||||
KeyTime="0:0:0.1"
|
||||
Value="0.0" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="HeaderTextVisible" />
|
||||
<VisualState x:Name="HeaderTextCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderText.Visibility" Value="Collapsed" />
|
||||
<Setter Target="InnerHeaderGrid.Height" Value="0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="DisplayModeStates">
|
||||
<VisualState x:Name="LeftMode" />
|
||||
<VisualState x:Name="TopMode">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="InnerHeaderGrid.Margin" Value="{ThemeResource TopNavigationViewItemInnerHeaderMargin}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="controls:NavigationViewItemSeparator">
|
||||
<Setter Property="IsEnabled" Value="False" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid x:Name="NavigationViewItemSeparatorRootGrid">
|
||||
<Rectangle
|
||||
x:Name="SeparatorLine"
|
||||
Height="{ThemeResource NavigationViewItemSeparatorHeight}"
|
||||
Margin="{ThemeResource NavigationViewItemSeparatorMargin}"
|
||||
Fill="{ThemeResource NavigationViewItemSeparatorForeground}" />
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="NavigationSeparatorLineStates">
|
||||
<VisualState x:Name="HorizontalLine" />
|
||||
<VisualState x:Name="HorizontalLineCompact">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="SeparatorLine.Margin" Value="{ThemeResource NavigationViewCompactItemSeparatorMargin}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="VerticalLine">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="SeparatorLine.Height" Value="24" />
|
||||
<Setter Target="SeparatorLine.Width" Value="{ThemeResource TopNavigationViewItemSeparatorWidth}" />
|
||||
<Setter Target="SeparatorLine.Margin" Value="{ThemeResource TopNavigationViewItemSeparatorMargin}" />
|
||||
<Setter Target="SeparatorLine.VerticalAlignment" Value="Center" />
|
||||
<Setter Target="SeparatorLine.Fill" Value="{ThemeResource TopNavigationViewItemSeparatorForeground}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Wino.Mail.WinUI.Views.Abstract;
|
||||
|
||||
public abstract class ContactsAppShellAbstract : BasePage
|
||||
{
|
||||
protected ContactsAppShellAbstract()
|
||||
{
|
||||
NavigationCacheMode = Microsoft.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
|
||||
}
|
||||
}
|
||||
@@ -103,9 +103,7 @@
|
||||
Severity="Success" />
|
||||
|
||||
<!-- Failure InfoBar + Buttons -->
|
||||
<StackPanel
|
||||
Spacing="12"
|
||||
Visibility="{x:Bind helpers:XamlHelpers.BoolToVisibilityConverter(ViewModel.IsSetupFailed), Mode=OneWay}">
|
||||
<StackPanel Spacing="12" Visibility="{x:Bind helpers:XamlHelpers.BoolToVisibilityConverter(ViewModel.IsSetupFailed), Mode=OneWay}">
|
||||
<winuiControls:InfoBar
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
@@ -116,9 +114,7 @@
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Button
|
||||
Command="{x:Bind ViewModel.GoBackCommand}"
|
||||
Content="{x:Bind domain:Translator.AccountSetup_GoBackButton}" />
|
||||
<Button Command="{x:Bind ViewModel.GoBackCommand}" Content="{x:Bind domain:Translator.AccountSetup_GoBackButton}" />
|
||||
<Button
|
||||
Command="{x:Bind ViewModel.TryAgainCommand}"
|
||||
Content="{x:Bind domain:Translator.AccountSetup_TryAgainButton}"
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
|
||||
<!-- Page Header -->
|
||||
<StackPanel Grid.Row="0" Spacing="4">
|
||||
<TextBlock
|
||||
Style="{StaticResource TitleTextBlockStyle}"
|
||||
Text="{x:Bind domain:Translator.CalendarAccountSettings_Title, Mode=OneTime}" />
|
||||
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Text="{x:Bind domain:Translator.CalendarAccountSettings_Title, Mode=OneTime}" />
|
||||
<TextBlock
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
@@ -34,9 +32,7 @@
|
||||
<StackPanel MaxWidth="900" Spacing="4">
|
||||
|
||||
<!-- Account Color -->
|
||||
<controls:SettingsCard
|
||||
Description="{x:Bind domain:Translator.CalendarAccountSettings_AccountColorDescription, Mode=OneTime}"
|
||||
Header="{x:Bind domain:Translator.CalendarAccountSettings_AccountColor, Mode=OneTime}">
|
||||
<controls:SettingsCard Description="{x:Bind domain:Translator.CalendarAccountSettings_AccountColorDescription, Mode=OneTime}" Header="{x:Bind domain:Translator.CalendarAccountSettings_AccountColor, Mode=OneTime}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</controls:SettingsCard.HeaderIcon>
|
||||
@@ -48,9 +44,7 @@
|
||||
</controls:SettingsCard>
|
||||
|
||||
<!-- Enable Synchronization -->
|
||||
<controls:SettingsCard
|
||||
Description="{x:Bind domain:Translator.CalendarAccountSettings_SyncEnabledDescription, Mode=OneTime}"
|
||||
Header="{x:Bind domain:Translator.CalendarAccountSettings_SyncEnabled, Mode=OneTime}">
|
||||
<controls:SettingsCard Description="{x:Bind domain:Translator.CalendarAccountSettings_SyncEnabledDescription, Mode=OneTime}" Header="{x:Bind domain:Translator.CalendarAccountSettings_SyncEnabled, Mode=OneTime}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</controls:SettingsCard.HeaderIcon>
|
||||
@@ -58,9 +52,7 @@
|
||||
</controls:SettingsCard>
|
||||
|
||||
<!-- Default Show As Status -->
|
||||
<controls:SettingsCard
|
||||
Description="{x:Bind domain:Translator.CalendarAccountSettings_DefaultShowAsDescription, Mode=OneTime}"
|
||||
Header="{x:Bind domain:Translator.CalendarAccountSettings_DefaultShowAs, Mode=OneTime}">
|
||||
<controls:SettingsCard Description="{x:Bind domain:Translator.CalendarAccountSettings_DefaultShowAsDescription, Mode=OneTime}" Header="{x:Bind domain:Translator.CalendarAccountSettings_DefaultShowAs, Mode=OneTime}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</controls:SettingsCard.HeaderIcon>
|
||||
|
||||
@@ -15,16 +15,67 @@
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:local="using:Wino.Calendar.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:menu="using:Wino.Core.Domain.MenuItems"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<DataTemplate x:Key="CalendarNewEventTemplate" x:DataType="menu:NewMailMenuItem">
|
||||
<coreControls:WinoNavigationViewItem
|
||||
Height="50"
|
||||
DataContext="{x:Bind}"
|
||||
SelectsOnInvoked="False">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<coreControls:WinoFontIcon Icon="NewMail" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock
|
||||
Margin="0,-2,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="16"
|
||||
Style="{StaticResource FlyoutPickerTitleTextBlockStyle}"
|
||||
Text="{x:Bind domain:Translator.CalendarEventCompose_NewEventButton}" />
|
||||
</coreControls:WinoNavigationViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="CalendarManageAccountsTemplate" x:DataType="menu:ManageAccountsMenuItem">
|
||||
<coreControls:WinoNavigationViewItem DataContext="{x:Bind}" SelectsOnInvoked="False">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind domain:Translator.MenuManageAccounts}" />
|
||||
</coreControls:WinoNavigationViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="CalendarSettingsItemTemplate" x:DataType="menu:SettingsItem">
|
||||
<coreControls:WinoNavigationViewItem DataContext="{x:Bind}" SelectsOnInvoked="False">
|
||||
<coreControls:WinoNavigationViewItem.Icon>
|
||||
<muxc:AnimatedIcon>
|
||||
<muxc:AnimatedIcon.Source>
|
||||
<animatedvisuals:AnimatedSettingsVisualSource />
|
||||
</muxc:AnimatedIcon.Source>
|
||||
<muxc:AnimatedIcon.FallbackIconSource>
|
||||
<muxc:SymbolIconSource Symbol="Setting" />
|
||||
</muxc:AnimatedIcon.FallbackIconSource>
|
||||
</muxc:AnimatedIcon>
|
||||
</coreControls:WinoNavigationViewItem.Icon>
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind domain:Translator.MenuSettings}" />
|
||||
</coreControls:WinoNavigationViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="CalendarStoreUpdateItemTemplate" x:DataType="menu:StoreUpdateMenuItem">
|
||||
<coreControls:WinoNavigationViewItem DataContext="{x:Bind}" SelectsOnInvoked="False">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind domain:Translator.MenuUpdateAvailable}" />
|
||||
</coreControls:WinoNavigationViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<coreSelectors:NavigationMenuTemplateSelector
|
||||
x:Key="NavigationMenuTemplateSelector"
|
||||
AccountManagementTemplate="{StaticResource ManageAccountsTemplate}"
|
||||
NewMailTemplate="{StaticResource CalendarNewEventTemplate}"
|
||||
RatingItemTemplate="{StaticResource RatingItemTemplate}"
|
||||
SeperatorTemplate="{StaticResource SeperatorTemplate}"
|
||||
SettingsItemTemplate="{StaticResource SettingsItemTemplate}" />
|
||||
SeperatorTemplate="{StaticResource SeperatorTemplate}" />
|
||||
|
||||
<Style
|
||||
x:Key="CalendarNavigationButtonStyle"
|
||||
@@ -138,59 +189,43 @@
|
||||
</Grid.BackgroundTransition>
|
||||
</Grid>
|
||||
|
||||
<SplitView
|
||||
x:Name="MainSplitView"
|
||||
<muxc:NavigationView
|
||||
x:Name="navigationView"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="3"
|
||||
Background="Transparent"
|
||||
DisplayMode="Inline"
|
||||
DisplayModeChanged="NavigationViewDisplayModeChanged"
|
||||
IsBackButtonVisible="Collapsed"
|
||||
IsPaneOpen="{x:Bind ViewModel.PreferencesService.IsNavigationPaneOpened, Mode=TwoWay}"
|
||||
PaneBackground="Transparent">
|
||||
<SplitView.Pane>
|
||||
<Grid Padding="0,0,0,6">
|
||||
IsPaneToggleButtonVisible="False"
|
||||
IsSettingsVisible="False"
|
||||
IsTitleBarAutoPaddingEnabled="False"
|
||||
ItemInvoked="NavigationViewItemInvoked"
|
||||
MenuItemTemplateSelector="{StaticResource NavigationMenuTemplateSelector}"
|
||||
MenuItemsSource="{x:Bind ViewModel.MenuItems, Mode=OneWay}"
|
||||
OpenPaneLength="{x:Bind ViewModel.StatePersistenceService.OpenPaneLength, Mode=TwoWay}"
|
||||
PaneDisplayMode="Auto"
|
||||
Style="{StaticResource CalendarShellNavigationViewStyle}">
|
||||
<muxc:NavigationView.PaneCustomContent>
|
||||
<Grid x:Name="PaneCustomContent" Padding="0,0,0,6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button
|
||||
Margin="10,12,10,0"
|
||||
Padding="4,12"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Left"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Command="{x:Bind ViewModel.NewEventCommand}">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<coreControls:WinoFontIcon FontSize="16" Icon="NewMail" />
|
||||
<TextBlock
|
||||
Margin="10,-2,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="16"
|
||||
Style="{StaticResource FlyoutPickerTitleTextBlockStyle}"
|
||||
Text="{x:Bind domain:Translator.CalendarEventCompose_NewEventButton}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<calendarControls:WinoCalendarView
|
||||
x:Name="CalendarView"
|
||||
Grid.Row="1"
|
||||
Grid.Row="0"
|
||||
Margin="0,12,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
DateClickedCommand="{x:Bind ViewModel.DateClickedCommand}"
|
||||
HighlightedDateRange="{x:Bind ViewModel.HighlightedDateRange, Mode=OneWay}"
|
||||
TodayBackgroundColor="{ThemeResource SystemAccentColor}" />
|
||||
|
||||
|
||||
<!-- Account Calendars Host -->
|
||||
<ListView
|
||||
x:Name="CalendarHostListView"
|
||||
Grid.Row="2"
|
||||
Grid.Row="1"
|
||||
ItemsSource="{x:Bind ViewModel.AccountCalendarStateService.GroupedAccountCalendars}"
|
||||
SelectionMode="None">
|
||||
<ListView.Header>
|
||||
@@ -255,15 +290,6 @@
|
||||
Text="{x:Bind Name, Mode=OneWay}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
<!--<Border
|
||||
Margin="0,0,0,4"
|
||||
Padding="4,2,4,2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Background="{x:Bind helpers:XamlHelpers.GetSolidColorBrushFromHex(BackgroundColorHex), Mode=OneWay}"
|
||||
CornerRadius="3">
|
||||
|
||||
</Border>-->
|
||||
</CheckBox>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
@@ -273,78 +299,38 @@
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
<!-- Menu Items -->
|
||||
<ListView
|
||||
Grid.Row="3"
|
||||
ItemTemplateSelector="{StaticResource NavigationMenuTemplateSelector}"
|
||||
SelectedIndex="{x:Bind ViewModel.SelectedMenuItemIndex, Mode=TwoWay}">
|
||||
<ListView.Items>
|
||||
<ListViewItem>
|
||||
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||
<FontIcon
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Glyph="" />
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind domain:Translator.MenuManageAccounts}" />
|
||||
</StackPanel>
|
||||
</ListViewItem>
|
||||
<ListViewItem>
|
||||
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||
<muxc:AnimatedIcon Width="20">
|
||||
<muxc:AnimatedIcon.Source>
|
||||
<animatedvisuals:AnimatedSettingsVisualSource />
|
||||
</muxc:AnimatedIcon.Source>
|
||||
<muxc:AnimatedIcon.FallbackIconSource>
|
||||
<muxc:SymbolIconSource Symbol="Setting" />
|
||||
</muxc:AnimatedIcon.FallbackIconSource>
|
||||
</muxc:AnimatedIcon>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind domain:Translator.MenuSettings}" />
|
||||
</StackPanel>
|
||||
</ListViewItem>
|
||||
<ListViewItem Visibility="{x:Bind ViewModel.IsStoreUpdateItemVisible, Mode=OneWay}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind domain:Translator.MenuUpdateAvailable}" />
|
||||
</StackPanel>
|
||||
</ListViewItem>
|
||||
</ListView.Items>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</muxc:NavigationView.PaneCustomContent>
|
||||
|
||||
<!-- Main Content -->
|
||||
<Frame
|
||||
x:Name="InnerShellFrame"
|
||||
Padding="0,0,7,7"
|
||||
CacheSize="2"
|
||||
IsNavigationStackEnabled="True">
|
||||
<Frame.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<PopupThemeTransition />
|
||||
</TransitionCollection>
|
||||
</Frame.ContentTransitions>
|
||||
</Frame>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- InfoBar -->
|
||||
<coreControls:WinoInfoBar
|
||||
x:Name="ShellInfoBar"
|
||||
MaxWidth="700"
|
||||
Margin="0,60,25,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="False" />
|
||||
</Grid>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
<!-- Main Content -->
|
||||
<Frame
|
||||
x:Name="InnerShellFrame"
|
||||
Padding="0,0,7,7"
|
||||
CacheSize="2"
|
||||
IsNavigationStackEnabled="True">
|
||||
<Frame.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<PopupThemeTransition />
|
||||
</TransitionCollection>
|
||||
</Frame.ContentTransitions>
|
||||
</Frame>
|
||||
|
||||
<!-- InfoBar -->
|
||||
<coreControls:WinoInfoBar
|
||||
x:Name="ShellInfoBar"
|
||||
MaxWidth="700"
|
||||
Margin="0,60,25,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="False" />
|
||||
</Grid>
|
||||
</muxc:NavigationView>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="LowResolutionStates">
|
||||
@@ -353,14 +339,14 @@
|
||||
<AdaptiveTrigger MinWindowWidth="1200" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="MainSplitView.IsPaneOpen" Value="True" />
|
||||
<Setter Target="navigationView.IsPaneOpen" Value="True" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SmallScreen">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NavigationTitleStack.Visibility" Value="Collapsed" />
|
||||
<Setter Target="SearchBox.(Grid.ColumnSpan)" Value="2" />
|
||||
<Setter Target="MainSplitView.IsPaneOpen" Value="False" />
|
||||
<Setter Target="navigationView.IsPaneOpen" Value="False" />
|
||||
</VisualState.Setters>
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="0" />
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models;
|
||||
@@ -24,10 +26,16 @@ public sealed partial class CalendarAppShell : CalendarAppShellAbstract,
|
||||
{
|
||||
InitializeComponent();
|
||||
PreviewKeyDown += OnPreviewKeyDown;
|
||||
Loaded += OnLoaded;
|
||||
|
||||
ManageCalendarDisplayType(ViewModel.StatePersistenceService.CalendarDisplayType);
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdateNavigationPaneLayout(navigationView.DisplayMode);
|
||||
}
|
||||
|
||||
private void ManageCalendarDisplayType(Core.Domain.Enums.CalendarDisplayType displayType)
|
||||
{
|
||||
if (displayType == Core.Domain.Enums.CalendarDisplayType.Month)
|
||||
@@ -44,11 +52,40 @@ public sealed partial class CalendarAppShell : CalendarAppShellAbstract,
|
||||
|
||||
private void NextDateClicked(object sender, RoutedEventArgs e) => WeakReferenceMessenger.Default.Send(new GoNextDateRequestedMessage());
|
||||
|
||||
private async void NavigationViewItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
|
||||
{
|
||||
if (args.InvokedItemContainer is FrameworkElement { DataContext: IMenuItem menuItem })
|
||||
{
|
||||
await ViewModel.HandleNavigationItemInvokedAsync(menuItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigationViewDisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args)
|
||||
=> UpdateNavigationPaneLayout(args.DisplayMode);
|
||||
|
||||
private void UpdateNavigationPaneLayout(NavigationViewDisplayMode displayMode)
|
||||
{
|
||||
var paneContentVisibility = displayMode == NavigationViewDisplayMode.Expanded && navigationView.IsPaneOpen
|
||||
? Visibility.Visible
|
||||
: Visibility.Collapsed;
|
||||
|
||||
PaneCustomContent.Visibility = paneContentVisibility;
|
||||
|
||||
Debug.WriteLine($"NavigationView display mode changed to {displayMode}. Pane custom content visibility set to {paneContentVisibility}.");
|
||||
}
|
||||
|
||||
public void Receive(CalendarDisplayTypeChangedMessage message)
|
||||
{
|
||||
ManageCalendarDisplayType(message.NewDisplayType);
|
||||
}
|
||||
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
|
||||
Bindings.StopTracking();
|
||||
}
|
||||
|
||||
protected override void RegisterRecipients()
|
||||
{
|
||||
base.RegisterRecipients();
|
||||
|
||||
@@ -63,9 +63,7 @@
|
||||
HorizontalContentAlignment="Left"
|
||||
Style="{StaticResource DefaultButtonStyle}">
|
||||
<Button.Flyout>
|
||||
<Flyout
|
||||
x:Name="CalendarSelectionFlyout"
|
||||
Placement="BottomEdgeAlignedLeft">
|
||||
<Flyout x:Name="CalendarSelectionFlyout" Placement="BottomEdgeAlignedLeft">
|
||||
<ScrollViewer MaxHeight="360">
|
||||
<ItemsControl ItemsSource="{x:Bind ViewModel.AvailableCalendarGroups, Mode=OneWay}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:calendarControls="using:Wino.Calendar.Controls"
|
||||
xmlns:calendarHelpers="using:Wino.Calendar.Helpers"
|
||||
xmlns:collections="using:CommunityToolkit.Mvvm.Collections"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:data="using:Wino.Calendar.ViewModels.Data"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
@@ -14,7 +15,6 @@
|
||||
xmlns:local="using:Wino.Calendar.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:shared="using:Wino.Core.Domain.Entities.Shared"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
xmlns:calendar="using:Wino.Core.Domain.Entities.Calendar"
|
||||
xmlns:calendarHelpers="using:Wino.Calendar.Helpers"
|
||||
xmlns:calendarViewModels="using:Wino.Calendar.ViewModels"
|
||||
xmlns:coreControls="using:Wino.Mail.WinUI.Controls"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:coreControls="using:Wino.Mail.WinUI.Controls"
|
||||
xmlns:ctControls="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:data="using:Wino.Calendar.ViewModels.Data"
|
||||
@@ -210,9 +210,7 @@
|
||||
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />
|
||||
|
||||
<!-- Test Notification -->
|
||||
<Button
|
||||
Command="{x:Bind ViewModel.CreateTestNotificationCommand}"
|
||||
Style="{StaticResource TransparentActionButtonStyle}">
|
||||
<Button Command="{x:Bind ViewModel.CreateTestNotificationCommand}" Style="{StaticResource TransparentActionButtonStyle}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<coreControls:WinoFontIcon FontSize="16" Icon="Reminder" />
|
||||
<TextBlock VerticalAlignment="Center" Text="Test notification" />
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<abstract:ContactsAppShellAbstract
|
||||
x:Class="Wino.Mail.WinUI.Views.Contacts.ContactsAppShell"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:abstract="using:Wino.Mail.WinUI.Views.Abstract"
|
||||
xmlns:coreControls="using:Wino.Mail.WinUI.Controls"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
|
||||
|
||||
<Grid x:Name="RootGrid" Padding="0" ColumnSpacing="0" RowSpacing="0">
|
||||
<muxc:NavigationView
|
||||
x:Name="navigationView"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="3"
|
||||
Margin="-1,-1,0,0"
|
||||
Style="{StaticResource CalendarShellNavigationViewStyle}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AlwaysShowHeader="True"
|
||||
DisplayModeChanged="NavigationViewDisplayModeChanged"
|
||||
IsBackButtonVisible="Collapsed"
|
||||
IsPaneOpen="{x:Bind PreferencesService.IsNavigationPaneOpened, Mode=TwoWay}"
|
||||
IsPaneToggleButtonVisible="False"
|
||||
IsSettingsVisible="False"
|
||||
IsTabStop="True"
|
||||
IsTitleBarAutoPaddingEnabled="False"
|
||||
OpenPaneLength="{x:Bind StatePersistenceService.OpenPaneLength, Mode=TwoWay}"
|
||||
PaneDisplayMode="Auto"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Hidden">
|
||||
<Grid>
|
||||
<Frame
|
||||
x:Name="InnerShellFrame"
|
||||
Padding="0,0,7,7"
|
||||
IsNavigationStackEnabled="False" />
|
||||
|
||||
<coreControls:WinoInfoBar
|
||||
x:Name="ShellInfoBar"
|
||||
MaxWidth="700"
|
||||
Margin="0,60,25,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="False" />
|
||||
</Grid>
|
||||
</muxc:NavigationView>
|
||||
</Grid>
|
||||
</abstract:ContactsAppShellAbstract>
|
||||
@@ -0,0 +1,38 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Navigation;
|
||||
|
||||
namespace Wino.Mail.WinUI.Views.Contacts;
|
||||
|
||||
public sealed partial class ContactsAppShell : Views.Abstract.ContactsAppShellAbstract
|
||||
{
|
||||
public IPreferencesService PreferencesService { get; } = WinoApplication.Current.Services.GetRequiredService<IPreferencesService>();
|
||||
public IStatePersistanceService StatePersistenceService { get; } = WinoApplication.Current.Services.GetRequiredService<IStatePersistanceService>();
|
||||
public INavigationService NavigationService { get; } = WinoApplication.Current.Services.GetRequiredService<INavigationService>();
|
||||
|
||||
public ContactsAppShell()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (e.NavigationMode == Microsoft.UI.Xaml.Navigation.NavigationMode.New && InnerShellFrame.Content == null)
|
||||
{
|
||||
NavigationService.Navigate(WinoPage.ContactsPage, null, NavigationReferenceFrame.InnerShellFrame, NavigationTransitionType.None);
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigationViewDisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args)
|
||||
{
|
||||
InnerShellFrame.Margin = args.DisplayMode == NavigationViewDisplayMode.Minimal
|
||||
? new Thickness(7, 0, 0, 0)
|
||||
: new Thickness(0);
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:listview="using:Wino.Mail.WinUI.Controls.ListView"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="using:Wino.Mail.ViewModels.Data"
|
||||
xmlns:toolkitExt="using:CommunityToolkit.WinUI"
|
||||
xmlns:viewModels="using:Wino.Mail.ViewModels.Data"
|
||||
x:Name="root"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mailControls="using:Wino.Mail.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid RowSpacing="12">
|
||||
@@ -19,14 +19,20 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<controls:SettingsCard Grid.Row="0" Header="{x:Bind domain:Translator.SettingsEmailTemplates_NameTitle}" IsClickEnabled="False">
|
||||
<controls:SettingsCard
|
||||
Grid.Row="0"
|
||||
Header="{x:Bind domain:Translator.SettingsEmailTemplates_NameTitle}"
|
||||
IsClickEnabled="False">
|
||||
<TextBox
|
||||
x:Name="TemplateNameTextBox"
|
||||
PlaceholderText="{x:Bind domain:Translator.SettingsEmailTemplates_NamePlaceholder}"
|
||||
Text="{x:Bind ViewModel.TemplateName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</controls:SettingsCard>
|
||||
|
||||
<controls:SettingsCard Grid.Row="1" Header="{x:Bind domain:Translator.SettingsEmailTemplates_DescriptionTitle}" IsClickEnabled="False">
|
||||
<controls:SettingsCard
|
||||
Grid.Row="1"
|
||||
Header="{x:Bind domain:Translator.SettingsEmailTemplates_DescriptionTitle}"
|
||||
IsClickEnabled="False">
|
||||
<TextBox
|
||||
AcceptsReturn="True"
|
||||
PlaceholderText="{x:Bind domain:Translator.SettingsEmailTemplates_DescriptionPlaceholder}"
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="entities:EmailTemplate">
|
||||
<controls:SettingsCard
|
||||
Margin="0,0,0,4"
|
||||
Click="TemplateClicked"
|
||||
Description="{x:Bind Description}"
|
||||
Header="{x:Bind Name}"
|
||||
IsClickEnabled="True"
|
||||
Margin="0,0,0,4"
|
||||
Tag="{x:Bind}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
|
||||
@@ -27,24 +27,21 @@
|
||||
<controls1:MailItemDisplayInformationControl
|
||||
DisplayMode="Compact"
|
||||
MailItemInformation="{Binding ElementName=root, Path=ViewModel.DemoPreviewMailItemInformation}"
|
||||
ShowPreviewText="False"
|
||||
/>
|
||||
ShowPreviewText="False" />
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="MediumDisplayModePreviewTemplate" x:DataType="enums:MailListDisplayMode">
|
||||
<controls1:MailItemDisplayInformationControl
|
||||
DisplayMode="Medium"
|
||||
MailItemInformation="{Binding ElementName=root, Path=ViewModel.DemoPreviewMailItemInformation}"
|
||||
ShowPreviewText="True"
|
||||
/>
|
||||
ShowPreviewText="True" />
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="SpaciousDisplayModePreviewTemplate" x:DataType="enums:MailListDisplayMode">
|
||||
<controls1:MailItemDisplayInformationControl
|
||||
DisplayMode="Spacious"
|
||||
MailItemInformation="{Binding ElementName=root, Path=ViewModel.DemoPreviewMailItemInformation}"
|
||||
ShowPreviewText="True"
|
||||
/>
|
||||
ShowPreviewText="True" />
|
||||
</DataTemplate>
|
||||
|
||||
<mailSelectors:MailItemDisplayModePreviewTemplateSelector
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
</PathIcon>
|
||||
<StackPanel Spacing="2">
|
||||
<TextBlock Style="{ThemeResource BodyStrongTextBlockStyle}" Text="{x:Bind domain:Translator.SettingsStorage_Title}" />
|
||||
<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="{x:Bind domain:Translator.SettingsStorage_Description}" TextWrapping="WrapWholeWords" />
|
||||
<TextBlock
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{x:Bind domain:Translator.SettingsStorage_Description}"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="0,12,0,0">
|
||||
<Grid Grid.Row="1" Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
||||
@@ -62,8 +62,6 @@
|
||||
</winuiControls:BreadcrumbBar>
|
||||
</Border>
|
||||
|
||||
<Frame
|
||||
x:Name="WizardFrame"
|
||||
Grid.Row="1" />
|
||||
<Frame x:Name="WizardFrame" Grid.Row="1" />
|
||||
</Grid>
|
||||
</abstract:WelcomeHostPageAbstract>
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
<None Remove="BackgroundImages\Snowflake.jpg" />
|
||||
<None Remove="Controls\ListView\WinoListViewStyles.xaml" />
|
||||
<None Remove="ShellWindow.xaml" />
|
||||
<None Remove="Styles\CalendarShellNavigationViewStyle.xaml" />
|
||||
<None Remove="Styles\CalendarThemeResources.xaml" />
|
||||
<None Remove="Styles\DayHeaderControl.xaml" />
|
||||
<None Remove="Styles\WinoCalendarResources.xaml" />
|
||||
@@ -343,6 +344,11 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="Views\Mail\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="Styles\CalendarShellNavigationViewStyle.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Calendar\CalendarSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
Reference in New Issue
Block a user