mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
- Split generic "common" libraries into specific libraries - Use other packages in lieu of custom code - General cleanup
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using CKaczor.Wpf.Validation;
|
|
using System.Windows;
|
|
|
|
namespace FeedCenter.Options
|
|
{
|
|
public partial class CategoryWindow
|
|
{
|
|
public CategoryWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public bool? Display(Category category, Window owner)
|
|
{
|
|
// Set the data context
|
|
DataContext = category;
|
|
|
|
// Set the title based on the state of the category
|
|
Title = string.IsNullOrWhiteSpace(category.Name)
|
|
? Properties.Resources.CategoryWindowAdd
|
|
: Properties.Resources.CategoryWindowEdit;
|
|
|
|
// Set the window owner
|
|
Owner = owner;
|
|
|
|
// Show the dialog and result the result
|
|
return ShowDialog();
|
|
}
|
|
|
|
private void HandleOkayButtonClick(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.Validate())
|
|
return;
|
|
|
|
// Dialog is good
|
|
DialogResult = true;
|
|
|
|
// Close the dialog
|
|
Close();
|
|
}
|
|
}
|
|
} |