mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-05-09 16:16:13 -04:00
Remove unused parameters Remove unnecessary casts Make fields readonly Order modifiers Format document Sort usings Remove unnecessary nullable directive Apply namespace preferences (file-level)
53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
using DataLayer;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
namespace LibationAvalonia.Dialogs;
|
|
|
|
public partial class LiberatedStatusBatchManualDialog : DialogWindow
|
|
{
|
|
public class liberatedComboBoxItem
|
|
{
|
|
public LiberatedStatus Status { get; set; }
|
|
public string? Text { get; set; }
|
|
public override string? ToString() => Text;
|
|
}
|
|
|
|
public LiberatedStatus BookLiberatedStatus { get; private set; }
|
|
|
|
private liberatedComboBoxItem? _selectedStatus;
|
|
public object? SelectedItem
|
|
{
|
|
get => _selectedStatus;
|
|
set
|
|
{
|
|
_selectedStatus = value as liberatedComboBoxItem;
|
|
|
|
BookLiberatedStatus = _selectedStatus?.Status ?? default;
|
|
}
|
|
}
|
|
|
|
public List<liberatedComboBoxItem> BookStatuses { get; } =
|
|
[
|
|
new liberatedComboBoxItem { Status = LiberatedStatus.Liberated, Text = "Downloaded" },
|
|
new liberatedComboBoxItem { Status = LiberatedStatus.NotLiberated, Text = "Not Downloaded" },
|
|
];
|
|
|
|
public LiberatedStatusBatchManualDialog(bool isPdf) : this()
|
|
{
|
|
if (isPdf)
|
|
Title = Title?.Replace("book", "PDF");
|
|
}
|
|
|
|
public LiberatedStatusBatchManualDialog()
|
|
{
|
|
InitializeComponent();
|
|
SelectedItem = BookStatuses[0];
|
|
DataContext = this;
|
|
ControlToFocusOnShow = SaveButton;
|
|
}
|
|
|
|
public void SaveButton_Clicked(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
|
=> SaveAndClose();
|
|
}
|