Files
elwig/WGneu/MainWindow.xaml.cs
2023-02-04 23:57:38 +01:00

63 lines
1.6 KiB
C#

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Intrinsics.X86;
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.Navigation;
using System.Windows.Shapes;
namespace WGneu
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private readonly WGContext _context = new WGContext();
private CollectionViewSource countryViewSource;
public MainWindow()
{
InitializeComponent();
countryViewSource = (CollectionViewSource)FindResource("countryViewSource");
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_context.Countries.Load();
countryViewSource.Source = _context.Countries.Local.ToObservableCollection();
}
protected override void OnClosing(CancelEventArgs e)
{
_context.Dispose();
base.OnClosing(e);
}
private void Button1_Click(object sender, EventArgs e)
{
BankDetailsWindow w = new BankDetailsWindow();
w.Show();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
}
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
}
}