Replace old markdown and remove redundant events (#389)
* Remove redundant messages * Replaced old markdown with preview. Added nuget config to add preview feed * Fix old extensions usage * Scrollbar margin for the markdown. --------- Co-authored-by: Burak Kaan Köse <bkaankose@outlook.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -206,9 +206,6 @@ PublishScripts/
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Nuget personal access tokens and Credentials
|
||||
nuget.config
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace Wino.Services
|
||||
if (SetProperty(ref isReadingMail, value))
|
||||
{
|
||||
OnPropertyChanged(nameof(IsBackButtonVisible));
|
||||
WeakReferenceMessenger.Default.Send(new ShellStateUpdated());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +62,6 @@ namespace Wino.Services
|
||||
if (SetProperty(ref isReaderNarrowed, value))
|
||||
{
|
||||
OnPropertyChanged(nameof(IsBackButtonVisible));
|
||||
WeakReferenceMessenger.Default.Send(new ShellStateUpdated());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ using Wino.Mail.ViewModels.Collections;
|
||||
using Wino.Mail.ViewModels.Data;
|
||||
using Wino.Mail.ViewModels.Messages;
|
||||
using Wino.Messaging.Client.Mails;
|
||||
using Wino.Messaging.Client.Shell;
|
||||
using Wino.Messaging.Server;
|
||||
using Wino.Messaging.UI;
|
||||
|
||||
@@ -283,8 +282,6 @@ namespace Wino.Mail.ViewModels
|
||||
|
||||
if (isMultiSelecting && StatePersistenceService.IsReaderNarrowed)
|
||||
{
|
||||
// Don't change the active mail item if the reader is narrowed, but just update the shell.
|
||||
Messenger.Send(new ShellStateUpdated());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace Wino.Mail.ViewModels
|
||||
FromAddress = message.From.Mailboxes.FirstOrDefault()?.Address ?? Translator.UnknownAddress;
|
||||
FromName = message.From.Mailboxes.FirstOrDefault()?.Name ?? Translator.UnknownSender;
|
||||
CreationDate = message.Date.DateTime;
|
||||
ContactPicture = initializedMailItemViewModel.SenderContact?.Base64ContactPicture;
|
||||
ContactPicture = initializedMailItemViewModel?.SenderContact?.Base64ContactPicture;
|
||||
|
||||
// Automatically disable images for Junk folder to prevent pixel tracking.
|
||||
// This can only work for selected mail item rendering, not for EML file rendering.
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
using Wino.Mail.ViewModels.Data;
|
||||
|
||||
namespace Wino.Mail.ViewModels.Messages
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// When a thread conversation listview has single selection, all other listviews
|
||||
/// must unselect all their items.
|
||||
/// </summary>
|
||||
public class ResetSingleMailItemSelectionEvent
|
||||
{
|
||||
public ResetSingleMailItemSelectionEvent(MailItemViewModel selectedViewModel)
|
||||
{
|
||||
SelectedViewModel = selectedViewModel;
|
||||
}
|
||||
|
||||
public MailItemViewModel SelectedViewModel { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,6 @@ namespace Wino.Views
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(new ClearMailSelectionsRequested());
|
||||
WeakReferenceMessenger.Default.Send(new DisposeRenderingFrameRequested());
|
||||
WeakReferenceMessenger.Default.Send(new ShellStateUpdated());
|
||||
}
|
||||
|
||||
private async void MenuItemContextRequested(UIElement sender, ContextRequestedEventArgs args)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:selectors="using:Wino.Selectors"
|
||||
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
|
||||
xmlns:toolkitExt="using:CommunityToolkit.WinUI"
|
||||
xmlns:viewModelData="using:Wino.Mail.ViewModels.Data"
|
||||
xmlns:wino="using:Wino"
|
||||
x:Name="root"
|
||||
@@ -176,7 +176,7 @@
|
||||
<controls:WinoExpander.Content>
|
||||
<listview:WinoListView
|
||||
x:Name="ThreadItemsList"
|
||||
ui:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
toolkitExt:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
IsThreadListView="True"
|
||||
ItemTemplate="{StaticResource ThreadSingleMailItemTemplate}"
|
||||
ItemsSource="{x:Bind ThreadItems}"
|
||||
@@ -431,9 +431,8 @@
|
||||
x:Name="MailListView"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ui:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
ui:ScrollViewerExtensions.EnableMiddleClickScrolling="True"
|
||||
ui:ScrollViewerExtensions.VerticalScrollBarMargin="0"
|
||||
toolkitExt:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
toolkitExt:ScrollViewerExtensions.VerticalScrollBarMargin="0"
|
||||
ItemDeletedCommand="{x:Bind ViewModel.ExecuteMailOperationCommand}"
|
||||
ItemTemplateSelector="{StaticResource MailItemDisplaySelector}"
|
||||
ItemsSource="{x:Bind MailCollectionViewSource.View, Mode=OneWay}"
|
||||
|
||||
@@ -25,18 +25,14 @@ using Wino.Mail.ViewModels.Data;
|
||||
using Wino.Mail.ViewModels.Messages;
|
||||
using Wino.MenuFlyouts.Context;
|
||||
using Wino.Messaging.Client.Mails;
|
||||
using Wino.Messaging.Client.Shell;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views
|
||||
{
|
||||
public sealed partial class MailListPage : MailListPageAbstract,
|
||||
IRecipient<ResetSingleMailItemSelectionEvent>,
|
||||
IRecipient<ClearMailSelectionsRequested>,
|
||||
IRecipient<ActiveMailItemChangedEvent>,
|
||||
IRecipient<ActiveMailFolderChangedEvent>,
|
||||
IRecipient<SelectMailItemContainerEvent>,
|
||||
IRecipient<ShellStateUpdated>,
|
||||
IRecipient<DisposeRenderingFrameRequested>
|
||||
{
|
||||
private const double RENDERING_COLUMN_MIN_WIDTH = 375;
|
||||
@@ -144,14 +140,6 @@ namespace Wino.Views
|
||||
MailListView.ClearSelections();
|
||||
}
|
||||
|
||||
void IRecipient<ResetSingleMailItemSelectionEvent>.Receive(ResetSingleMailItemSelectionEvent message)
|
||||
{
|
||||
// Single item in thread selected.
|
||||
// Force main list view to unselect all items, except for the one provided.
|
||||
|
||||
MailListView.ClearSelections(message.SelectedViewModel);
|
||||
}
|
||||
|
||||
private async void MailItemContextRequested(UIElement sender, ContextRequestedEventArgs args)
|
||||
{
|
||||
// Context is requested from a single mail point, but we might have multiple selected items.
|
||||
@@ -303,11 +291,6 @@ namespace Wino.Views
|
||||
|
||||
#endregion
|
||||
|
||||
public void Receive(ActiveMailFolderChangedEvent message)
|
||||
{
|
||||
UpdateAdaptiveness();
|
||||
}
|
||||
|
||||
public async void Receive(SelectMailItemContainerEvent message)
|
||||
{
|
||||
if (message.SelectedMailViewModel == null) return;
|
||||
@@ -354,11 +337,6 @@ namespace Wino.Views
|
||||
});
|
||||
}
|
||||
|
||||
public void Receive(ShellStateUpdated message)
|
||||
{
|
||||
UpdateAdaptiveness();
|
||||
}
|
||||
|
||||
private void SearchBoxFocused(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SearchBar.PlaceholderText = string.Empty;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<abstract:AliasManagementPageAbstract x:Class="Wino.Views.Settings.AliasManagementPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
|
||||
xmlns:toolkitExt="using:CommunityToolkit.WinUI"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:abstract="using:Wino.Views.Abstract"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
<ListView ItemTemplate="{StaticResource AccountAliasTemplate}"
|
||||
ItemsSource="{x:Bind ViewModel.AccountAliases, Mode=OneWay}"
|
||||
ui:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
toolkitExt:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
SelectionMode="None">
|
||||
<ListView.ItemContainerTransitions>
|
||||
<TransitionCollection>
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
xmlns:controls1="using:Wino.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
x:Name="root"
|
||||
xmlns:enums="using:Wino.Core.Domain.Enums"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:personalization="using:Wino.Core.UWP.Models.Personalization"
|
||||
xmlns:selectors="using:Wino.Selectors"
|
||||
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
|
||||
xmlns:toolkitExt="using:CommunityToolkit.WinUI"
|
||||
xmlns:viewModelData="using:Wino.Mail.ViewModels.Data"
|
||||
x:Name="root"
|
||||
Title="Personalization"
|
||||
mc:Ignorable="d">
|
||||
|
||||
@@ -149,8 +149,8 @@
|
||||
<DataTemplate x:Key="MediumDisplayModePreviewTemplate" x:DataType="enums:MailListDisplayMode">
|
||||
<controls1:MailItemDisplayInformationControl
|
||||
DisplayMode="Medium"
|
||||
ShowPreviewText="True"
|
||||
MailItem="{Binding ElementName=root, Path=ViewModel.DemoPreviewMailCopy}" />
|
||||
MailItem="{Binding ElementName=root, Path=ViewModel.DemoPreviewMailCopy}"
|
||||
ShowPreviewText="True" />
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="SpaciousDisplayModePreviewTemplate" x:DataType="enums:MailListDisplayMode">
|
||||
@@ -255,7 +255,7 @@
|
||||
|
||||
<!-- TODO: Group by custom/wino -->
|
||||
<GridView
|
||||
ui:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
toolkitExt:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
ItemTemplateSelector="{StaticResource AppThemePreviewTemplateSelector}"
|
||||
ItemsSource="{x:Bind ViewModel.AppThemes, Mode=OneWay}"
|
||||
SelectedItem="{x:Bind ViewModel.SelectedAppTheme, Mode=TwoWay}" />
|
||||
@@ -276,7 +276,7 @@
|
||||
ContentAlignment="Vertical">
|
||||
<ListView
|
||||
Margin="-18,0"
|
||||
ui:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
toolkitExt:ListViewExtensions.ItemContainerStretchDirection="Horizontal"
|
||||
ItemTemplateSelector="{StaticResource MailItemDisplayModePreviewTemplateSelector}"
|
||||
ItemsSource="{x:Bind ViewModel.InformationDisplayModes}"
|
||||
SelectedItem="{x:Bind ViewModel.SelectedInfoDisplayMode, Mode=TwoWay}" />
|
||||
|
||||
@@ -3,30 +3,19 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:abstract="using:Wino.Views.Abstract"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Wino.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:toolkitmd="using:CommunityToolkit.Labs.WinUI.MarkdownTextBlock"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="0,0,7,7"
|
||||
Background="{ThemeResource WinoContentZoneBackgroud}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="7">
|
||||
<Grid Padding="24">
|
||||
<Border Style="{StaticResource PageRootBorderStyle}">
|
||||
<Grid Padding="15">
|
||||
<ScrollViewer>
|
||||
<controls:MarkdownTextBlock
|
||||
x:Name="MarkdownControl"
|
||||
Background="Transparent"
|
||||
<toolkitmd:MarkdownTextBlock
|
||||
Margin="0,0,16,0"
|
||||
CharacterSpacing="12"
|
||||
Config="{x:Bind _config, Mode=OneTime}"
|
||||
FontSize="16"
|
||||
Header1FontSize="30"
|
||||
Header2FontSize="22"
|
||||
ImageStretch="UniformToFill"
|
||||
LinkClicked="HyperlinkClicked"
|
||||
ListBulletSpacing="10"
|
||||
Text="{x:Bind ViewModel.CurrentVersionNotes, Mode=OneWay}" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
using System;
|
||||
using Windows.System;
|
||||
using CommunityToolkit.Labs.WinUI.MarkdownTextBlock;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views
|
||||
{
|
||||
public sealed partial class WelcomePage : WelcomePageAbstract
|
||||
{
|
||||
private readonly MarkdownConfig _config;
|
||||
|
||||
public WelcomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void HyperlinkClicked(object sender, Microsoft.Toolkit.Uwp.UI.Controls.LinkClickedEventArgs e)
|
||||
{
|
||||
await Launcher.LaunchUriAsync(new System.Uri(e.Link));
|
||||
_config = new MarkdownConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,9 @@
|
||||
<PackageReference Include="CommunityToolkit.Diagnostics">
|
||||
<Version>8.2.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="CommunityToolkit.Labs.Uwp.Controls.MarkdownTextBlock">
|
||||
<Version>0.1.240917-build.1755</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm">
|
||||
<Version>8.2.2</Version>
|
||||
</PackageReference>
|
||||
@@ -177,9 +180,6 @@
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||
<Version>6.2.14</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Markdown">
|
||||
<Version>7.1.3</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.UI.Xaml">
|
||||
<Version>2.8.6</Version>
|
||||
</PackageReference>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Wino.Messaging.Client.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// When reading mail state or reader pane narrowed state is changed.
|
||||
/// </summary>
|
||||
public record ShellStateUpdated;
|
||||
}
|
||||
9
nuget.config
Normal file
9
nuget.config
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||
<clear />
|
||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="ToolkitLabsFeed" value="https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user