﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Contractor.Views
{
  /// <summary>
  /// Interaction logic for AddExpenseDialog.xaml
  /// </summary>
  public partial class AddExpenseDialog
  {
    public AddExpenseDialog()
    {
      Expense = new Models.Expense();
      IsCanceled = false;
      IsValid = true;
      InitializeComponent();
      DataContext = this;
    }

    public Models.Expense Expense { get; set; }

    public bool IsValid { get; set; }

    public bool IsCanceled { get; set; }

    private void AddExpenseOkButton_OnClick(object sender, RoutedEventArgs e)
    {
      IsCanceled = !IsValid;
      Close();
    }

    private void AddExpenseCancelButton_OnClick(object sender, RoutedEventArgs e)
    {
      IsCanceled = true;
      Close();
    }
  }
}
