Emaıl templates.
This commit is contained in:
@@ -138,6 +138,21 @@
|
||||
CommandAlignment="Right"
|
||||
IsDynamicOverflowEnabled="True"
|
||||
OverflowButtonAlignment="Left">
|
||||
<AppBarElementContainer Visibility="{x:Bind helpers:XamlHelpers.CountToVisibilityConverter(ViewModel.AvailableEmailTemplates.Count), Mode=OneWay}">
|
||||
<ComboBox
|
||||
x:Name="EmailTemplatesComboBox"
|
||||
MinWidth="220"
|
||||
Margin="0,8,8,0"
|
||||
ItemsSource="{x:Bind ViewModel.AvailableEmailTemplates, Mode=OneWay}"
|
||||
PlaceholderText="{x:Bind domain:Translator.Composer_EmailTemplatesPlaceholder}"
|
||||
SelectionChanged="EmailTemplateSelectionChanged">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="mail:EmailTemplate">
|
||||
<TextBlock Text="{x:Bind Name}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</AppBarElementContainer>
|
||||
<AppBarButton
|
||||
MinWidth="40"
|
||||
HorizontalContentAlignment="Center"
|
||||
@@ -145,9 +160,7 @@
|
||||
Visibility="{x:Bind ViewModel.IsDraftBusy, Mode=OneWay}">
|
||||
<ProgressRing IsActive="True" />
|
||||
</AppBarButton>
|
||||
<AppBarButton
|
||||
Click="ToggleEditorThemeClicked"
|
||||
ToolTipService.ToolTip="{x:Bind GetEditorThemeToolTip(WebViewEditor.IsEditorDarkMode), Mode=OneWay}">
|
||||
<AppBarButton Click="ToggleEditorThemeClicked" ToolTipService.ToolTip="{x:Bind GetEditorThemeToolTip(WebViewEditor.IsEditorDarkMode), Mode=OneWay}">
|
||||
<AppBarButton.Icon>
|
||||
<coreControls:WinoFontIcon Icon="{x:Bind GetEditorThemeIcon(WebViewEditor.IsEditorDarkMode), Mode=OneWay}" />
|
||||
</AppBarButton.Icon>
|
||||
|
||||
@@ -18,6 +18,7 @@ using Windows.Foundation;
|
||||
using Windows.Storage;
|
||||
using Windows.UI.Core.Preview;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Entities.Mail;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
using Wino.Core.Domain.Models.Reader;
|
||||
using Wino.Mail.ViewModels.Data;
|
||||
@@ -53,6 +54,15 @@ public sealed partial class ComposePage : ComposePageAbstract,
|
||||
WebViewEditor.ToggleEditorTheme();
|
||||
}
|
||||
|
||||
private async void EmailTemplateSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is not ComboBox comboBox || comboBox.SelectedItem is not EmailTemplate template)
|
||||
return;
|
||||
|
||||
await WebViewEditor.RenderHtmlAsync(template.HtmlContent);
|
||||
comboBox.SelectedItem = null;
|
||||
}
|
||||
|
||||
private async void GlobalFocusManagerGotFocus(object? sender, FocusManagerGotFocusEventArgs e)
|
||||
{
|
||||
// In order to delegate cursor to the inner editor for WebView2.
|
||||
|
||||
Reference in New Issue
Block a user