or
<Style x:Key="DataFooter" TargetType="GridView:GridViewFooterCell"> <Setter Property="Content"> <Setter.Value> <StackPanel> <GridView:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <TextBlock VerticalAlignment="Center" Text="{Binding Caption}" /> <TextBlock VerticalAlignment="Center" Text="{Binding FormattedValue}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </GridView:AggregateResultsList> </StackPanel> </Setter.Value> </Setter> </Style>public class Address { String _Street; String _City; String _Town; String _County; String _PostCode; public String Street { get { return this._Street; } set { this._Street = value; NotifyPropertyChanged(() => Street); } } public String City { get { return this._City; } set { this._City = value; NotifyPropertyChanged(() => City); } } public String Town { get { return this._Town; } set { this._Town = value; NotifyPropertyChanged(() => Town); } } public String County { get { return this._County; } set { this._County = value; NotifyPropertyChanged(() => County); } } public String PostCode { get { return this._PostCode; } set { this._PostCode = value; NotifyPropertyChanged(() => PostCode); } } public Address() { } public Address(String street, String city, String town, String county, String postCode) { this.Street = street; this.City = city; this.Town = town; this.County = county; this.PostCode = postCode; } #region PropertyNotify [field: NonSerializedAttribute()] public event PropertyChangedEventHandler PropertyChanged = delegate { }; public readonly Action<Action> _synchronousInvoker; public Address(Action<Action> synchronousInvoker) { _synchronousInvoker = synchronousInvoker; } public void NotifyPropertyChanged<T>(Expression<Func<T>> expr) { var body = expr.Body as MemberExpression; if (body != null) { try { if (_synchronousInvoker != null) _synchronousInvoker(() => InvokePropertyChanged(expr)); else InvokePropertyChanged(expr); } catch (Exception Ex) { if (Ex.Message == "Invoke or BeginInvoke cannot be called on a control until the window handle has been created.") { InvokePropertyChanged(expr); } } } } private void InvokePropertyChanged<T>(Expression<Func<T>> expr) { var body = expr.Body as MemberExpression; if (body != null) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(body.Member.Name)); } } } #endregion } public class Employee : INotifyPropertyChanged { Int32 _EmployeeID; String _FirstName; String _SurName; Location _DefaultStore; float _Sallary; float _HourlyRate; EmployeeType _EmployeeType; Address _Address; public Int32 EmployeeID { get { return _EmployeeID; } set { _EmployeeID = value; NotifyPropertyChanged(() => EmployeeID); } } public String FirstName { get { return this._FirstName; } set { this._FirstName = value; NotifyPropertyChanged(() => FirstName); } } public String SurName { get { return this._SurName; } set { this._SurName = value; NotifyPropertyChanged(() => SurName); } } public Location DefaultStore { get { return this._DefaultStore; } set { this._DefaultStore = value; NotifyPropertyChanged(() => DefaultStore); } } public float Sallary { get { return this._Sallary; } set { this._Sallary = value; NotifyPropertyChanged(() => Sallary); } } public float HourlyRate { get { return this._HourlyRate; } set { this._HourlyRate = value; NotifyPropertyChanged(() => HourlyRate); } } public EmployeeType EmployeeType { get { return this._EmployeeType; } set { this._EmployeeType = value; NotifyPropertyChanged(() => EmployeeType); } } public Address Address { get { return _Address; } set { _Address = value; NotifyPropertyChanged(() => Address); } } public Employee() { } public Employee(Int32 employeeID, String firstName, String surName, Location defaultStore, float sallary, float hourlyRate, EmployeeType employeeType, Address address) { this._EmployeeID = employeeID; this._FirstName = firstName; this._SurName = surName; this._DefaultStore = defaultStore; this._Sallary = sallary; this._HourlyRate = hourlyRate; this._EmployeeType = employeeType; this._Address = address; } #region PropertyNotify [field: NonSerializedAttribute()] public event PropertyChangedEventHandler PropertyChanged = delegate { }; public readonly Action<Action> _synchronousInvoker; public Employee(Action<Action> synchronousInvoker) { _synchronousInvoker = synchronousInvoker; } public void NotifyPropertyChanged<T>(Expression<Func<T>> expr) { var body = expr.Body as MemberExpression; if (body != null) { try { if (_synchronousInvoker != null) _synchronousInvoker(() => InvokePropertyChanged(expr)); else InvokePropertyChanged(expr); } catch (Exception Ex) { if (Ex.Message == "Invoke or BeginInvoke cannot be called on a control until the window handle has been created.") { InvokePropertyChanged(expr); } } } } private void InvokePropertyChanged<T>(Expression<Func<T>> expr) { var body = expr.Body as MemberExpression; if (body != null) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(body.Member.Name)); } } } #endregion } public class EmployeeCollection : ObservableCollection<Employee> { public EmployeeCollection() { } }


[MetadataType(typeof(Part.PartMetadata))]public partial class Part : IValidatableObject { private sealed class PartMetadata { [RegularExpression(@"[0-9A-F]{4,20}")] // Not respected by the RadGridView public string PartNumber { get; set; } } public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) { if (PartNumber == DrawingNumber) { yield return new ValidationResult("part number = drawing number", new string[] { "PartNumber", "DrawingNumber" }); } }}<ControlTemplate> <Grid> <TextBlock x:Name="StartTextBox" Margin="4 2" Foreground="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding ActualStart,StringFormat=t}" /> <TextBlock x:Name="EndTextBox" Margin="4 2" Foreground="Black" HorizontalAlignment="Right" VerticalAlignment="Bottom" Text="{Binding ActualEnd,StringFormat=t}" /> </Grid> </ControlTemplate>