Files
FeedCenter/Application/Options/FeedWindow.xaml.cs
Chris Kaczor 6bae35a255 Start adding Miniflux support plus other cleanup
- Modernize old async code
- Update to .NET 10
- Adjust namespace
- Bypass update check when debugging
2025-11-13 10:33:56 -05:00

46 lines
990 B
C#

using ChrisKaczor.Wpf.Validation;
using System.Windows;
namespace FeedCenter.Options;
public partial class FeedWindow
{
private readonly FeedCenterEntities _entities;
public FeedWindow(FeedCenterEntities entities)
{
_entities = entities;
InitializeComponent();
}
public bool? Display(Feeds.Feed feed, Window owner)
{
CategoryComboBox.ItemsSource = _entities.Categories;
DataContext = feed;
Title = string.IsNullOrWhiteSpace(feed.Link) ? Properties.Resources.FeedWindowAdd : Properties.Resources.FeedWindowEdit;
Owner = owner;
return ShowDialog();
}
private void HandleOkayButtonClick(object sender, RoutedEventArgs e)
{
var transaction = _entities.BeginTransaction();
if (!this.IsValid(OptionsTabControl))
{
transaction.Rollback();
return;
}
transaction.Commit();
DialogResult = true;
Close();
}
}