Revert "File scoped namespaces"

This reverts commit d31d8f574e.
This commit is contained in:
Burak Kaan Köse
2025-02-16 11:43:30 +01:00
parent d31d8f574e
commit cf9869b71e
617 changed files with 32097 additions and 31478 deletions

View File

@@ -4,71 +4,72 @@ using Windows.UI.Xaml.Controls;
using Wino.Core.Domain;
using Wino.Core.Domain.Models.Folders;
namespace Wino.Dialogs;
public sealed partial class MoveMailDialog : ContentDialog
namespace Wino.Dialogs
{
public IMailItemFolder SelectedFolder
public sealed partial class MoveMailDialog : ContentDialog
{
get { return (IMailItemFolder)GetValue(SelectedFolderProperty); }
set { SetValue(SelectedFolderProperty, value); }
}
public static readonly DependencyProperty SelectedFolderProperty = DependencyProperty.Register(nameof(SelectedFolder), typeof(IMailItemFolder), typeof(MoveMailDialog), new PropertyMetadata(null, OnSelectedFolderChanged));
public List<IMailItemFolder> FolderList { get; set; }
public MoveMailDialog(List<IMailItemFolder> allFolders)
{
InitializeComponent();
if (allFolders == null) return;
FolderList = allFolders;
}
private static void OnSelectedFolderChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
{
if (obj is MoveMailDialog dialog)
public IMailItemFolder SelectedFolder
{
dialog.VerifySelection();
get { return (IMailItemFolder)GetValue(SelectedFolderProperty); }
set { SetValue(SelectedFolderProperty, value); }
}
}
private void VerifySelection()
{
if (SelectedFolder != null)
public static readonly DependencyProperty SelectedFolderProperty = DependencyProperty.Register(nameof(SelectedFolder), typeof(IMailItemFolder), typeof(MoveMailDialog), new PropertyMetadata(null, OnSelectedFolderChanged));
public List<IMailItemFolder> FolderList { get; set; }
public MoveMailDialog(List<IMailItemFolder> allFolders)
{
// Don't select non-move capable folders like Categories or More.
InitializeComponent();
if (!SelectedFolder.IsMoveTarget)
if (allFolders == null) return;
FolderList = allFolders;
}
private static void OnSelectedFolderChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
{
if (obj is MoveMailDialog dialog)
{
// Warn users for only proper mail folders. Not ghost folders.
InvalidFolderText.Visibility = Visibility.Visible;
InvalidFolderText.Text = string.Format(Translator.MoveMailDialog_InvalidFolderMessage, SelectedFolder.FolderName);
dialog.VerifySelection();
}
}
if (FolderTreeView.SelectedItem != null)
private void VerifySelection()
{
if (SelectedFolder != null)
{
// Don't select non-move capable folders like Categories or More.
if (!SelectedFolder.IsMoveTarget)
{
// Toggle the expansion for the selected container if available.
// I don't like the expand arrow touch area. It's better this way.
// Warn users for only proper mail folders. Not ghost folders.
InvalidFolderText.Visibility = Visibility.Visible;
InvalidFolderText.Text = string.Format(Translator.MoveMailDialog_InvalidFolderMessage, SelectedFolder.FolderName);
if (FolderTreeView.ContainerFromItem(FolderTreeView.SelectedItem) is Microsoft.UI.Xaml.Controls.TreeViewItem container)
if (FolderTreeView.SelectedItem != null)
{
container.IsExpanded = !container.IsExpanded;
// Toggle the expansion for the selected container if available.
// I don't like the expand arrow touch area. It's better this way.
if (FolderTreeView.ContainerFromItem(FolderTreeView.SelectedItem) is Microsoft.UI.Xaml.Controls.TreeViewItem container)
{
container.IsExpanded = !container.IsExpanded;
}
}
SelectedFolder = null;
}
else
{
Hide();
}
SelectedFolder = null;
}
else
{
Hide();
}
}
}
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
Hide();
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
Hide();
}
}
}