Der DATA-Trigger

 

 

MainWindow.xaml:

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.Navigation;
using System.Windows.Shapes;

namespace WPFDataTrigger
{
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public List<Person> Personen { get; set; }

public MainWindow()
{
InitializeComponent();

Personen = new List<Person>();
Personen.Add(new Person { Geschlecht = "Frau", Name = "Peggy Carter" });
Personen.Add(new Person { Geschlecht = "Herr", Name = "Captain America" });
Personen.Add(new Person { Geschlecht = "Frau", Name = "Dharma Finkelstein" });
Personen.Add(new Person { Geschlecht = "Herr", Name = "Greg Montgomery" });

DataContext = this;


}
}
}

 

Person.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPFDataTrigger
{
public class Person
{
public string Geschlecht { get; set; }
public string Name { get; set; }
}

}

Top