diff --git a/Perspex.Windows/DrawingContext.cs b/Perspex.Windows/DrawingContext.cs
index 881a7c58d1..d10ab74e2a 100644
--- a/Perspex.Windows/DrawingContext.cs
+++ b/Perspex.Windows/DrawingContext.cs
@@ -71,6 +71,7 @@ namespace Perspex.Windows
/// Draws text.
///
/// The foreground brush.
+ /// The output rectangle.
/// The text.
public void DrawText(Perspex.Media.Brush foreground, Rect rect, FormattedText text)
{
diff --git a/Perspex/Application.cs b/Perspex/Application.cs
index 0e094b4ffb..24ef9105ce 100644
--- a/Perspex/Application.cs
+++ b/Perspex/Application.cs
@@ -1,12 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Perspex.Styling;
+// -----------------------------------------------------------------------
+//
+// Copyright 2014 MIT Licence. See licence.md for more information.
+//
+// -----------------------------------------------------------------------
namespace Perspex
{
+ using Perspex.Styling;
+
public class Application
{
private Styles styles;
diff --git a/Perspex/BindingExtensions.cs b/Perspex/BindingExtensions.cs
index 8e54310da9..f739682cac 100644
--- a/Perspex/BindingExtensions.cs
+++ b/Perspex/BindingExtensions.cs
@@ -11,7 +11,7 @@ namespace Perspex
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Perspex.Controls;
+ using Perspex.Controls;
///
/// Provides binding utility extension methods.
diff --git a/Perspex/Classes.cs b/Perspex/Classes.cs
index bcfc627376..b05446fd0a 100644
--- a/Perspex/Classes.cs
+++ b/Perspex/Classes.cs
@@ -92,17 +92,6 @@ namespace Perspex
this.RaiseChanged(e);
}
- private void RaiseChanged(NotifyCollectionChangedEventArgs e)
- {
- if (this.CollectionChanged != null)
- {
- this.CollectionChanged(this, e);
- }
-
- this.changed.OnNext(e);
- this.afterChanged.OnNext(e);
- }
-
public void Clear()
{
NotifyCollectionChangedEventArgs e = new NotifyCollectionChangedEventArgs(
@@ -125,7 +114,7 @@ namespace Perspex
public IEnumerator GetEnumerator()
{
- return inner.GetEnumerator();
+ return this.inner.GetEnumerator();
}
public override string ToString()
@@ -135,7 +124,7 @@ namespace Perspex
IEnumerator IEnumerable.GetEnumerator()
{
- return inner.GetEnumerator();
+ return this.inner.GetEnumerator();
}
public bool Remove(string item)
@@ -173,5 +162,16 @@ namespace Perspex
return false;
}
}
+
+ private void RaiseChanged(NotifyCollectionChangedEventArgs e)
+ {
+ if (this.CollectionChanged != null)
+ {
+ this.CollectionChanged(this, e);
+ }
+
+ this.changed.OnNext(e);
+ this.afterChanged.OnNext(e);
+ }
}
}
diff --git a/Perspex/Contract.cs b/Perspex/Contract.cs
index 1550c098dd..18a3f65802 100644
--- a/Perspex/Contract.cs
+++ b/Perspex/Contract.cs
@@ -1,11 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+// -----------------------------------------------------------------------
+//
+// Copyright 2014 MIT Licence. See licence.md for more information.
+//
+// -----------------------------------------------------------------------
namespace Perspex
{
+ using System;
+
internal static class Contract
{
public static void Requires(bool condition) where TException : Exception, new()
diff --git a/Perspex/Controls/ControlTemplate.cs b/Perspex/Controls/ControlTemplate.cs
index 2347239afc..422f472ee9 100644
--- a/Perspex/Controls/ControlTemplate.cs
+++ b/Perspex/Controls/ControlTemplate.cs
@@ -21,6 +21,14 @@ namespace Perspex.Controls
this.build = build;
}
+ public static ControlTemplate Create(Func build)
+ where TControl : ITemplatedControl
+ {
+ Contract.Requires(build != null);
+
+ return new ControlTemplate(c => build((TControl)c));
+ }
+
public Control Build(ITemplatedControl templatedParent)
{
Contract.Requires(templatedParent != null);
@@ -30,14 +38,6 @@ namespace Perspex.Controls
return root;
}
- public static ControlTemplate Create(Func build)
- where TControl : ITemplatedControl
- {
- Contract.Requires(build != null);
-
- return new ControlTemplate(c => build((TControl)c));
- }
-
private void SetTemplatedParent(Control control, ITemplatedControl templatedParent)
{
Contract.Requires(control != null);
diff --git a/Perspex/Controls/ITemplatedControl.cs b/Perspex/Controls/ITemplatedControl.cs
index da20588791..473ab8c876 100644
--- a/Perspex/Controls/ITemplatedControl.cs
+++ b/Perspex/Controls/ITemplatedControl.cs
@@ -11,6 +11,8 @@ namespace Perspex.Controls
public interface ITemplatedControl
{
+ IEnumerable VisualChildren { get; }
+
///
/// Gets an observable for a .
///
@@ -18,7 +20,5 @@ namespace Perspex.Controls
/// The property to get the observable for.
/// The observable.
IObservable GetObservable(PerspexProperty property);
-
- IEnumerable VisualChildren { get; }
}
}
diff --git a/Perspex/Controls/LogicalChildren.cs b/Perspex/Controls/LogicalChildren.cs
index 9b5a308ce8..5ea6f97a71 100644
--- a/Perspex/Controls/LogicalChildren.cs
+++ b/Perspex/Controls/LogicalChildren.cs
@@ -41,7 +41,7 @@ namespace Perspex.Controls
public void Change(PerspexList childrenCollection)
{
this.childrenCollection.CollectionChanged -= this.CollectionChanged;
- this.Remove(inner.ToList());
+ this.Remove(this.inner.ToList());
this.childrenCollection = childrenCollection;
this.Add(childrenCollection);
childrenCollection.CollectionChanged += this.CollectionChanged;
diff --git a/Perspex/Input/InputManager.cs b/Perspex/Input/InputManager.cs
index 38ad825e9c..eee08ae83f 100644
--- a/Perspex/Input/InputManager.cs
+++ b/Perspex/Input/InputManager.cs
@@ -13,7 +13,7 @@ namespace Perspex.Input
public class InputManager : IInputManager
{
- List pointerOvers = new List();
+ private List pointerOvers = new List();
public void Process(RawInputEventArgs e)
{
diff --git a/Perspex/PerspexList.cs b/Perspex/PerspexList.cs
index 376f510e66..1735e73aaf 100644
--- a/Perspex/PerspexList.cs
+++ b/Perspex/PerspexList.cs
@@ -1,15 +1,16 @@
-namespace Perspex
+// -----------------------------------------------------------------------
+//
+// Copyright 2014 MIT Licence. See licence.md for more information.
+//
+// -----------------------------------------------------------------------
+
+namespace Perspex
{
using System;
- using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
- using System.Linq;
using System.Reactive.Linq;
- using System.Reactive.Subjects;
- using System.Text;
- using System.Threading.Tasks;
public class PerspexList : ObservableCollection
{
diff --git a/Perspex/PerspexObject.cs b/Perspex/PerspexObject.cs
index b0bbc992c5..442b08be8d 100644
--- a/Perspex/PerspexObject.cs
+++ b/Perspex/PerspexObject.cs
@@ -186,19 +186,19 @@ namespace Perspex
public void ClearBinding(PerspexProperty property)
{
throw new NotImplementedException();
- //Contract.Requires(property != null);
- //PriorityValue value;
-
- //if (this.values.TryGetValue(property, out value))
- //{
- // value.ClearLocalBinding();
-
- // this.Log().Debug(string.Format(
- // "Cleared binding on {0}.{1} (#{2:x8})",
- // this.GetType().Name,
- // property.Name,
- // this.GetHashCode()));
- //}
+ ////Contract.Requires(property != null);
+ ////PriorityValue value;
+
+ ////if (this.values.TryGetValue(property, out value))
+ ////{
+ //// value.ClearLocalBinding();
+
+ //// this.Log().Debug(string.Format(
+ //// "Cleared binding on {0}.{1} (#{2:x8})",
+ //// this.GetType().Name,
+ //// property.Name,
+ //// this.GetHashCode()));
+ ////}
}
///
@@ -344,7 +344,7 @@ namespace Perspex
{
Contract.Requires(property != null);
- const int priority = (int)BindingPriority.LocalValue;
+ const int Priority = (int)BindingPriority.LocalValue;
PriorityValue v;
if (!this.values.TryGetValue(property, out v))
@@ -365,8 +365,8 @@ namespace Perspex
this.GetHashCode(),
value));
- v.Clear(priority);
- v.Add(Observable.Never