Viewmodel erweitert
This commit is contained in:
50
KanSan/UI/Kunde/UCKundeList.xaml.cs
Normal file
50
KanSan/UI/Kunde/UCKundeList.xaml.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using KanSan.Base.Models;
|
||||
using KanSan.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
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 KanSan.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für UCKundeList.xaml
|
||||
/// </summary>
|
||||
public partial class UCKundeList : UserControl
|
||||
{
|
||||
|
||||
public UCKundeList()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new KundenListViewModel();
|
||||
}
|
||||
|
||||
private void NeueKunde_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
KundeAddedKlickEventArgs args = new KundeAddedKlickEventArgs();
|
||||
args.kunde = (DataContext as KundenListViewModel).NeueKunde();
|
||||
OnKlickedKunde(args);
|
||||
|
||||
}
|
||||
protected virtual void OnKlickedKunde(KundeAddedKlickEventArgs e)
|
||||
{
|
||||
EventHandler<KundeAddedKlickEventArgs> handler = KundeAdded;
|
||||
if (handler != null)
|
||||
handler(this, e);
|
||||
}
|
||||
public event EventHandler<KundeAddedKlickEventArgs> KundeAdded;
|
||||
}
|
||||
|
||||
public class KundeAddedKlickEventArgs : EventArgs
|
||||
{
|
||||
public Kunde kunde { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user