I want to bind to the Count/amount of items within my DataContext.
I have an object, lets say person which has a List
as a property. I would
XAML:
Code behind:
using System.Collections.Generic;
using System.Windows;
namespace CountDemo
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
DataContext = new Person();
}
}
public class Person
{
public List Addresses
{
get { return new List() {new Address(), new Address(), new Address()}; }
}
}
public class Address
{
}
}