Removal of Bindings
This commit is contained in:
@@ -5,15 +5,21 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shared="using:Wino.Core.Domain.Entities.Shared"
|
||||
Title="{x:Bind domain:Translator.AccountPickerDialog_Title}"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ListView
|
||||
DisplayMemberPath="Address"
|
||||
IsItemClickEnabled="True"
|
||||
ItemClick="AccountClicked"
|
||||
ItemsSource="{x:Bind AvailableAccounts}"
|
||||
SelectionMode="None" />
|
||||
SelectionMode="None">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="shared:MailAccount">
|
||||
<TextBlock Text="{x:Bind Address}" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -20,20 +20,7 @@
|
||||
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
|
||||
|
||||
<!-- Root Account Template -->
|
||||
<DataTemplate x:Key="RootAccountTemplate" x:DataType="viewModelData:AccountProviderDetailViewModel">
|
||||
<winuiControls:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Command="{Binding ViewModel.NavigateAccountDetailsCommand, Mode=OneWay, ElementName=root}"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind Account.Address}"
|
||||
Header="{x:Bind Account.Name}"
|
||||
IsClickEnabled="True">
|
||||
<winuiControls:SettingsCard.HeaderIcon>
|
||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Account)}" />
|
||||
</winuiControls:SettingsCard.HeaderIcon>
|
||||
</winuiControls:SettingsCard>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
<!--#region Navigation Menu Templates-->
|
||||
|
||||
|
||||
@@ -19,7 +19,20 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
|
||||
<!-- Root Account Template -->
|
||||
<DataTemplate x:Key="RootAccountTemplate" x:DataType="viewModelData:AccountProviderDetailViewModel">
|
||||
<winuiControls:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Click="RootAccountTemplate_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind Account.Address}"
|
||||
Header="{x:Bind Account.Name}"
|
||||
IsClickEnabled="True">
|
||||
<winuiControls:SettingsCard.HeaderIcon>
|
||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Account)}" />
|
||||
</winuiControls:SettingsCard.HeaderIcon>
|
||||
</winuiControls:SettingsCard>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Merged Account Template -->
|
||||
<DataTemplate x:Key="MergedAccountTemplate" x:DataType="data:MergedAccountProviderDetailViewModel">
|
||||
@@ -29,7 +42,7 @@
|
||||
<winuiControls:SettingsCard
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Command="{Binding ViewModel.EditMergedAccountsCommand, Mode=OneWay, ElementName=root}"
|
||||
Click="EditMergedAccounts_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind domain:Translator.SettingsEditLinkedInbox_Description}"
|
||||
Header="{x:Bind domain:Translator.SettingsEditLinkedInbox_Title}"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using CommunityToolkit.WinUI.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Wino.Core.ViewModels.Data;
|
||||
using Wino.Mail.ViewModels.Data;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views;
|
||||
@@ -12,4 +15,21 @@ public sealed partial class AccountManagementPage : AccountManagementPageAbstrac
|
||||
|
||||
NavigationCacheMode = NavigationCacheMode.Enabled;
|
||||
}
|
||||
|
||||
private void EditMergedAccounts_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is SettingsCard card && card.CommandParameter is MergedAccountProviderDetailViewModel mergedAccount)
|
||||
{
|
||||
ViewModel.EditMergedAccountsCommand.Execute(mergedAccount);
|
||||
}
|
||||
}
|
||||
|
||||
private void RootAccountTemplate_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is SettingsCard card && card.CommandParameter is AccountProviderDetailViewModel accountDetails)
|
||||
{
|
||||
ViewModel.NavigateAccountDetailsCommand.Execute(accountDetails);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<DataTemplate x:Key="LinkedAccountTemplate" x:DataType="data:AccountProviderDetailViewModel">
|
||||
<controls:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Command="{Binding ViewModel.UnlinkAccountCommand, Mode=OneWay, ElementName=MainPage}"
|
||||
Click="UnlinkAccount_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind Account.Address}"
|
||||
Header="{x:Bind Account.Name}"
|
||||
@@ -38,7 +38,7 @@
|
||||
<DataTemplate x:Key="UnlinkedAccountTemplate" x:DataType="data:AccountProviderDetailViewModel">
|
||||
<controls:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Command="{Binding ViewModel.LinkAccountCommand, Mode=OneWay, ElementName=MainPage}"
|
||||
Click="LinkAccount_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind Account.Address}"
|
||||
FlowDirection="RightToLeft"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using CommunityToolkit.WinUI.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Mail.ViewModels.Data;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
|
||||
@@ -9,4 +12,20 @@ public sealed partial class MergedAccountDetailsPage : MergedAccountDetailsPageA
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UnlinkAccount_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is SettingsCard card && card.CommandParameter is AccountProviderDetailViewModel account)
|
||||
{
|
||||
ViewModel.UnlinkAccountCommand.Execute(account);
|
||||
}
|
||||
}
|
||||
|
||||
private void LinkAccount_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is SettingsCard card && card.CommandParameter is AccountProviderDetailViewModel account)
|
||||
{
|
||||
ViewModel.LinkAccountCommand.Execute(account);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,12 +84,12 @@
|
||||
<Grid.ContextFlyout>
|
||||
<MenuFlyout>
|
||||
<MenuFlyoutItem
|
||||
Command="{Binding ElementName=root, Path=ViewModel.OpenAttachmentCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Click="OpenAttachment_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Text="{x:Bind domain:Translator.Buttons_Open}" />
|
||||
<MenuFlyoutItem
|
||||
Command="{Binding ElementName=root, Path=ViewModel.SaveAttachmentCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Click="SaveAttachment_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Text="{x:Bind domain:Translator.Buttons_Save}" />
|
||||
</MenuFlyout>
|
||||
</Grid.ContextFlyout>
|
||||
@@ -139,8 +139,8 @@
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Command="{Binding ElementName=root, Path=ViewModel.RemoveAttachmentCommand}"
|
||||
CommandParameter="{Binding}">
|
||||
Click="RemoveAttachment_Click"
|
||||
CommandParameter="{x:Bind}">
|
||||
<SymbolIcon
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
|
||||
@@ -385,6 +385,30 @@ public sealed partial class ComposePage : ComposePageAbstract,
|
||||
DisposeDisposables();
|
||||
}
|
||||
|
||||
private void OpenAttachment_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is MenuFlyoutItem item && item.CommandParameter is MailAttachmentViewModel attachment)
|
||||
{
|
||||
ViewModel.OpenAttachmentCommand.Execute(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveAttachment_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is MenuFlyoutItem item && item.CommandParameter is MailAttachmentViewModel attachment)
|
||||
{
|
||||
ViewModel.SaveAttachmentCommand.Execute(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveAttachment_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is MailAttachmentViewModel attachment)
|
||||
{
|
||||
ViewModel.RemoveAttachmentCommand.Execute(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RegisterRecipients()
|
||||
{
|
||||
base.RegisterRecipients();
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Padding="0"
|
||||
Command="{Binding ElementName=root, Path=ViewModel.CopyClipboardCommand}"
|
||||
Click="CopyAddress_Click"
|
||||
CommandParameter="{x:Bind Address}"
|
||||
Content="{x:Bind Address}" />
|
||||
</Grid>
|
||||
@@ -83,7 +83,7 @@
|
||||
<Grid.ContextFlyout>
|
||||
<MenuFlyout Placement="Right">
|
||||
<MenuFlyoutItem
|
||||
Command="{Binding ElementName=root, Path=ViewModel.OpenAttachmentCommand}"
|
||||
Click="OpenAttachment_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Text="{x:Bind domain:Translator.Buttons_Open}">
|
||||
<MenuFlyoutItem.Icon>
|
||||
@@ -91,7 +91,7 @@
|
||||
</MenuFlyoutItem.Icon>
|
||||
</MenuFlyoutItem>
|
||||
<MenuFlyoutItem
|
||||
Command="{Binding ElementName=root, Path=ViewModel.SaveAttachmentCommand}"
|
||||
Click="SaveAttachment_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Text="{x:Bind domain:Translator.Buttons_Save}">
|
||||
<MenuFlyoutItem.Icon>
|
||||
|
||||
@@ -298,6 +298,30 @@ public sealed partial class MailRenderingPage : MailRenderingPageAbstract,
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyAddress_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is HyperlinkButton button && button.CommandParameter is string address)
|
||||
{
|
||||
ViewModel.CopyClipboardCommand.Execute(address);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenAttachment_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is MenuFlyoutItem item && item.CommandParameter is MailAttachmentViewModel attachment)
|
||||
{
|
||||
ViewModel.OpenAttachmentCommand.Execute(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveAttachment_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is MenuFlyoutItem item && item.CommandParameter is MailAttachmentViewModel attachment)
|
||||
{
|
||||
ViewModel.SaveAttachmentCommand.Execute(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RegisterRecipients()
|
||||
{
|
||||
base.RegisterRecipients();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<DataTemplate x:DataType="settings:SettingOption">
|
||||
<controls:SettingsCard
|
||||
Margin="0,2"
|
||||
Command="{Binding ElementName=root, Path=ViewModel.NavigateSubDetailCommand}"
|
||||
Click="SettingOptionClicked"
|
||||
CommandParameter="{x:Bind NavigationPage}"
|
||||
Description="{x:Bind Description}"
|
||||
Header="{x:Bind Title}"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CommunityToolkit.WinUI.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views.Settings;
|
||||
@@ -8,4 +10,9 @@ public sealed partial class SettingOptionsPage : SettingOptionsPageAbstract
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SettingOptionClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is SettingsCard card && card.CommandParameter is WinoPage page) ViewModel.NavigateSubDetailCommand.Execute(page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
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:behaviors="using:CommunityToolkit.WinUI.Behaviors"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:controls1="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -62,15 +61,15 @@
|
||||
|
||||
<RadioButton
|
||||
Grid.Column="2"
|
||||
Command="{Binding ElementName=root, Path=ViewModel.SetAliasPrimaryCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Click="SetAliasPrimary_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
IsChecked="{x:Bind IsPrimary, Mode=OneWay}" />
|
||||
|
||||
<Button
|
||||
Grid.Column="3"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding ElementName=root, Path=ViewModel.DeleteAliasCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Click="DeleteAlias_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
IsEnabled="{x:Bind CanDelete}">
|
||||
<Button.Content>
|
||||
<PathIcon Data="F1 M 19.375 3.125 C 19.375 3.26823 19.34733 3.382162 19.291992 3.466797 C 19.236652 3.551434 19.16341 3.61491 19.072266 3.657227 C 18.981119 3.699545 18.880207 3.727215 18.769531 3.740234 C 18.658854 3.753256 18.544922 3.759766 18.427734 3.759766 C 18.362629 3.759766 18.297525 3.758139 18.232422 3.754883 C 18.167316 3.751629 18.108723 3.75 18.056641 3.75 L 16.435547 17.783203 C 16.396484 18.095703 16.305338 18.387045 16.162109 18.657227 C 16.018879 18.927408 15.836588 19.161783 15.615234 19.360352 C 15.39388 19.55892 15.139974 19.71517 14.853516 19.829102 C 14.567057 19.943033 14.267578 20 13.955078 20 L 6.044922 20 C 5.732422 20 5.432942 19.943033 5.146484 19.829102 C 4.860026 19.71517 4.60612 19.55892 4.384766 19.360352 C 4.163411 19.161783 3.98112 18.927408 3.837891 18.657227 C 3.694661 18.387045 3.603516 18.095703 3.564453 17.783203 L 1.943359 3.75 C 1.878255 3.75 1.813151 3.751629 1.748047 3.754883 C 1.682943 3.758139 1.617839 3.759766 1.552734 3.759766 C 1.442057 3.759766 1.33138 3.753256 1.220703 3.740234 C 1.110026 3.727215 1.010742 3.697918 0.922852 3.652344 C 0.834961 3.606771 0.763346 3.541668 0.708008 3.457031 C 0.652669 3.372396 0.625 3.261719 0.625 3.125 C 0.625 2.95573 0.686849 2.809246 0.810547 2.685547 C 0.934245 2.56185 1.080729 2.5 1.25 2.5 L 6.933594 2.5 C 6.998697 2.141928 7.127278 1.809896 7.319336 1.503906 C 7.511393 1.197918 7.745768 0.932617 8.022461 0.708008 C 8.299153 0.483398 8.606771 0.309246 8.945312 0.185547 C 9.283854 0.06185 9.635416 0 10 0 C 10.364583 0 10.716146 0.06185 11.054688 0.185547 C 11.393229 0.309246 11.700846 0.483398 11.977539 0.708008 C 12.25423 0.932617 12.488605 1.197918 12.680664 1.503906 C 12.872721 1.809896 13.001302 2.141928 13.066406 2.5 L 18.75 2.5 C 18.91927 2.5 19.065754 2.56185 19.189453 2.685547 C 19.31315 2.809246 19.375 2.95573 19.375 3.125 Z M 8.232422 2.5 L 11.767578 2.5 C 11.702474 2.311199 11.611328 2.140301 11.494141 1.987305 C 11.376953 1.834311 11.240234 1.702475 11.083984 1.591797 C 10.927734 1.481121 10.758463 1.396484 10.576172 1.337891 C 10.39388 1.279297 10.201822 1.25 10 1.25 C 9.798177 1.25 9.606119 1.279297 9.423828 1.337891 C 9.241536 1.396484 9.072266 1.481121 8.916016 1.591797 C 8.759766 1.702475 8.623047 1.834311 8.505859 1.987305 C 8.388672 2.140301 8.297525 2.311199 8.232422 2.5 Z M 16.796875 3.75 L 3.203125 3.75 L 4.804688 17.646484 C 4.84375 17.972006 4.978841 18.237305 5.209961 18.442383 C 5.441081 18.647461 5.719401 18.75 6.044922 18.75 L 13.955078 18.75 C 14.111328 18.75 14.261067 18.72233 14.404297 18.666992 C 14.547525 18.611654 14.674479 18.535156 14.785156 18.4375 C 14.895833 18.339844 14.986979 18.222656 15.058594 18.085938 C 15.130208 17.949219 15.175781 17.802734 15.195312 17.646484 Z M 7.5 14.375 L 7.5 8.125 C 7.5 7.95573 7.561849 7.809246 7.685547 7.685547 C 7.809245 7.56185 7.955729 7.5 8.125 7.5 C 8.294271 7.5 8.440755 7.56185 8.564453 7.685547 C 8.68815 7.809246 8.75 7.95573 8.75 8.125 L 8.75 14.375 C 8.75 14.544271 8.68815 14.690756 8.564453 14.814453 C 8.440755 14.938151 8.294271 15 8.125 15 C 7.955729 15 7.809245 14.938151 7.685547 14.814453 C 7.561849 14.690756 7.5 14.544271 7.5 14.375 Z M 11.25 14.375 L 11.25 8.125 C 11.25 7.95573 11.311849 7.809246 11.435547 7.685547 C 11.559244 7.56185 11.705729 7.5 11.875 7.5 C 12.04427 7.5 12.190754 7.56185 12.314453 7.685547 C 12.43815 7.809246 12.5 7.95573 12.5 8.125 L 12.5 14.375 C 12.5 14.544271 12.43815 14.690756 12.314453 14.814453 C 12.190754 14.938151 12.04427 15 11.875 15 C 11.705729 15 11.559244 14.938151 11.435547 14.814453 C 11.311849 14.690756 11.25 14.544271 11.25 14.375 Z " />
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities.Mail;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views.Settings;
|
||||
@@ -6,6 +8,22 @@ public sealed partial class AliasManagementPage : AliasManagementPageAbstract
|
||||
{
|
||||
public AliasManagementPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SetAliasPrimary_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is RadioButton button && button.CommandParameter is MailAccountAlias alias)
|
||||
{
|
||||
ViewModel.SetAliasPrimaryCommand.Execute(alias);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteAlias_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is MailAccountAlias alias)
|
||||
{
|
||||
ViewModel.DeleteAliasCommand.Execute(alias);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
Height="48"
|
||||
Margin="0,0,16,0"
|
||||
DisplayName="{x:Bind Name}"
|
||||
ProfilePicture="{x:Bind helpers:XamlHelpers.Base64ToBitmapImage(Base64ContactPicture), Mode=OneWay}" />
|
||||
ProfilePicture="{x:Bind helpers:XamlHelpers.Base64ToBitmapImage(Base64ContactPicture)}" />
|
||||
|
||||
<!-- Contact Info -->
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
@@ -48,7 +48,7 @@
|
||||
Padding="4,2"
|
||||
Background="{ThemeResource AccentFillColorDefaultBrush}"
|
||||
CornerRadius="2"
|
||||
Visibility="{x:Bind IsRootContact, Mode=OneWay}">
|
||||
Visibility="{x:Bind IsRootContact}">
|
||||
<TextBlock
|
||||
FontSize="10"
|
||||
Foreground="{ThemeResource TextOnAccentFillColorPrimaryBrush}"
|
||||
@@ -57,7 +57,7 @@
|
||||
<Border
|
||||
Padding="4,2"
|
||||
CornerRadius="2"
|
||||
Visibility="{x:Bind IsOverridden, Mode=OneWay}">
|
||||
Visibility="{x:Bind IsOverridden}">
|
||||
<TextBlock FontSize="10" Text="{x:Bind domain:Translator.ContactStatus_Modified, Mode=OneTime}" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
@@ -69,23 +69,23 @@
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Button
|
||||
Command="{Binding ViewModel.EditContactCommand, ElementName=root}"
|
||||
CommandParameter="{Binding}"
|
||||
Click="EditContact_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Style="{StaticResource SubtleButtonStyle}"
|
||||
ToolTipService.ToolTip="{x:Bind domain:Translator.ContactAction_Edit, Mode=OneTime}">
|
||||
<FontIcon FontSize="16" Glyph="" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding ViewModel.PickContactPhotoCommand, ElementName=root}"
|
||||
CommandParameter="{Binding}"
|
||||
Click="PickContactPhoto_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Style="{StaticResource SubtleButtonStyle}"
|
||||
ToolTipService.ToolTip="{x:Bind domain:Translator.ContactAction_ChangePhoto, Mode=OneTime}">
|
||||
<FontIcon FontSize="16" Glyph="" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding ViewModel.DeleteContactCommand, ElementName=root}"
|
||||
CommandParameter="{Binding}"
|
||||
IsEnabled="{x:Bind helpers:XamlHelpers.ReverseBoolConverter(IsRootContact), Mode=OneWay}"
|
||||
Click="DeleteContact_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
IsEnabled="{x:Bind helpers:XamlHelpers.ReverseBoolConverter(IsRootContact)}"
|
||||
Style="{StaticResource SubtleButtonStyle}"
|
||||
ToolTipService.ToolTip="{x:Bind domain:Translator.ContactAction_Delete, Mode=OneTime}">
|
||||
<FontIcon FontSize="16" Glyph="" />
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views.Settings;
|
||||
@@ -6,6 +8,30 @@ public sealed partial class ContactsPage : ContactsPageAbstract
|
||||
{
|
||||
public ContactsPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EditContact_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is AccountContact contact)
|
||||
{
|
||||
ViewModel.EditContactCommand.Execute(contact);
|
||||
}
|
||||
}
|
||||
|
||||
private void PickContactPhoto_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is AccountContact contact)
|
||||
{
|
||||
ViewModel.PickContactPhotoCommand.Execute(contact);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteContact_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is AccountContact contact)
|
||||
{
|
||||
ViewModel.DeleteContactCommand.Execute(contact);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
Margin="4,0"
|
||||
Command="{Binding ViewModel.StartEditingShortcutCommand, ElementName=root}"
|
||||
Click="EditShortcut_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Content=""
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
@@ -78,7 +78,7 @@
|
||||
<Button
|
||||
Grid.Column="3"
|
||||
Margin="4,0"
|
||||
Command="{Binding ViewModel.DeleteShortcutCommand, ElementName=root}"
|
||||
Click="DeleteShortcut_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Content=""
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.ViewModels.Data;
|
||||
using Wino.Mail.WinUI.Views.Abstract;
|
||||
|
||||
namespace Wino.Views.Settings;
|
||||
@@ -8,4 +10,20 @@ public sealed partial class KeyboardShortcutsPage : KeyboardShortcutsPageAbstrac
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
private void EditShortcut_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is KeyboardShortcutViewModel shortcut)
|
||||
{
|
||||
ViewModel.StartEditingShortcutCommand.Execute(shortcut);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteShortcut_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is KeyboardShortcutViewModel shortcut)
|
||||
{
|
||||
ViewModel.DeleteShortcutCommand.Execute(shortcut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:reader="using:Wino.Core.Domain.Models.Reader"
|
||||
xmlns:system="using:System"
|
||||
x:Name="root"
|
||||
mc:Ignorable="d">
|
||||
|
||||
@@ -19,7 +20,7 @@
|
||||
<DataTemplate x:Key="SignatureDialogTemplate" x:DataType="entities:AccountSignature">
|
||||
<controls1:SwitchPresenter Value="{x:Bind Id}">
|
||||
<!-- Case for "None" signature -->
|
||||
<controls1:Case Value="{Binding ViewModel.EmptyGuid, Mode=OneTime, ElementName=root}" />
|
||||
<controls1:Case Value="{x:Bind system:Guid.Empty}" />
|
||||
|
||||
<!-- Default case for regular signatures -->
|
||||
<controls1:Case IsDefault="True">
|
||||
@@ -34,14 +35,14 @@
|
||||
<controls1:SettingsCard Header="{x:Bind domain:Translator.SettingsSignature_EditSignature_Title}">
|
||||
<Button
|
||||
Width="65"
|
||||
Command="{Binding ViewModel.OpenSignatureEditorEditCommand, Mode=OneWay, ElementName=root}"
|
||||
Click="EditSignature_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Content="{x:Bind domain:Translator.Buttons_Edit}" />
|
||||
</controls1:SettingsCard>
|
||||
<controls1:SettingsCard Header="{x:Bind domain:Translator.SettingsSignature_DeleteSignature_Title}">
|
||||
<Button
|
||||
Background="Red"
|
||||
Command="{Binding ViewModel.DeleteSignatureCommand, Mode=OneWay, ElementName=root}"
|
||||
Click="DeleteSignature_Click"
|
||||
CommandParameter="{x:Bind}"
|
||||
Content="{x:Bind domain:Translator.Buttons_Delete}" />
|
||||
</controls1:SettingsCard>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities.Mail;
|
||||
using Wino.Views.Abstract;
|
||||
|
||||
namespace Wino.Views.Settings;
|
||||
@@ -6,6 +8,22 @@ public sealed partial class SignatureManagementPage : SignatureManagementPageAbs
|
||||
{
|
||||
public SignatureManagementPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EditSignature_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is AccountSignature signature)
|
||||
{
|
||||
ViewModel.OpenSignatureEditorEditCommand.Execute(signature);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteSignature_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.CommandParameter is AccountSignature signature)
|
||||
{
|
||||
ViewModel.DeleteSignatureCommand.Execute(signature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user