Skip to content
This repository has been archived by the owner on Nov 25, 2019. It is now read-only.

Commit

Permalink
Add CollectionViewGroup stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonius Riha committed Jan 6, 2014
1 parent 0fb038f commit 6ba5296
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
Expand Up @@ -149,6 +149,7 @@
<Compile Include="System.Windows.Data\BindingMode.cs" />
<Compile Include="System.Windows.Data\BindingStatus.cs" />
<Compile Include="System.Windows.Data\CollectionView.cs" />
<Compile Include="System.Windows.Data\CollectionViewGroup.cs" />
<Compile Include="System.Windows.Data\RelativeSourceMode.cs" />
<Compile Include="System.Windows.Data\UpdateSourceTrigger.cs" />
<Compile Include="System.Windows.Documents\LogicalDirection.cs" />
Expand Down
Expand Up @@ -149,6 +149,7 @@
<Compile Include="System.Windows.Data\BindingMode.cs" />
<Compile Include="System.Windows.Data\BindingStatus.cs" />
<Compile Include="System.Windows.Data\CollectionView.cs" />
<Compile Include="System.Windows.Data\CollectionViewGroup.cs" />
<Compile Include="System.Windows.Data\RelativeSourceMode.cs" />
<Compile Include="System.Windows.Data\UpdateSourceTrigger.cs" />
<Compile Include="System.Windows.Documents\LogicalDirection.cs" />
Expand Down
Expand Up @@ -149,6 +149,7 @@
<Compile Include="System.Windows.Data\BindingMode.cs" />
<Compile Include="System.Windows.Data\BindingStatus.cs" />
<Compile Include="System.Windows.Data\CollectionView.cs" />
<Compile Include="System.Windows.Data\CollectionViewGroup.cs" />
<Compile Include="System.Windows.Data\RelativeSourceMode.cs" />
<Compile Include="System.Windows.Data\UpdateSourceTrigger.cs" />
<Compile Include="System.Windows.Documents\LogicalDirection.cs" />
Expand Down
Expand Up @@ -149,6 +149,7 @@
<Compile Include="System.Windows.Data\BindingMode.cs" />
<Compile Include="System.Windows.Data\BindingStatus.cs" />
<Compile Include="System.Windows.Data\CollectionView.cs" />
<Compile Include="System.Windows.Data\CollectionViewGroup.cs" />
<Compile Include="System.Windows.Data\RelativeSourceMode.cs" />
<Compile Include="System.Windows.Data\UpdateSourceTrigger.cs" />
<Compile Include="System.Windows.Documents\LogicalDirection.cs" />
Expand Down
Expand Up @@ -109,6 +109,7 @@ System.Windows.Controls.Primitives/TickPlacement.cs
System.Windows.Data/BindingMode.cs
System.Windows.Data/BindingStatus.cs
System.Windows.Data/CollectionView.cs
System.Windows.Data/CollectionViewGroup.cs
System.Windows.Data/RelativeSourceMode.cs
System.Windows.Data/UpdateSourceTrigger.cs
System.Windows.Documents/LogicalDirection.cs
Expand Down
@@ -0,0 +1,82 @@
//
// CollectionViewGroup.cs
//
// Author:
// Antonius Riha <antoniusriha@gmail.com>
//
// Copyright (c) 2012 Antonius Riha
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace System.Windows.Data
{
public abstract class CollectionViewGroup : INotifyPropertyChanged
{
readonly object name;

protected CollectionViewGroup (object name)
{
if (name == null)
throw new ArgumentNullException ("name");
this.name = name;
}

public abstract bool IsBottomLevel { get; }

public int ItemCount {
get {
throw new NotImplementedException ();
}
}

public ReadOnlyObservableCollection<object> Items {
get {
throw new NotImplementedException ();
}
}

public object Name {
get { return name; }
}

protected int ProtectedItemCount { get; set; }

protected ObservableCollection<object> ProtectedItems {
get {
throw new NotImplementedException ();
}
}

protected virtual void OnPropertyChanged (PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
PropertyChanged (this, e);
}

protected virtual event PropertyChangedEventHandler PropertyChanged;

event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
add { PropertyChanged += value; }
remove { PropertyChanged -= value; }
}
}
}

0 comments on commit 6ba5296

Please sign in to comment.