diff --git a/Cairo/Perspex.Cairo/CairoExtensions.cs b/Cairo/Perspex.Cairo/CairoExtensions.cs
index 34099f9757..e9969ee90e 100644
--- a/Cairo/Perspex.Cairo/CairoExtensions.cs
+++ b/Cairo/Perspex.Cairo/CairoExtensions.cs
@@ -37,22 +37,34 @@ namespace Perspex.Cairo
public static Pango.Weight ToCairo(this Perspex.Media.FontWeight weight)
{
if (weight == Perspex.Media.FontWeight.Light)
+ {
return Pango.Weight.Light;
+ }
if (weight == Perspex.Media.FontWeight.Normal || weight == Perspex.Media.FontWeight.Regular)
+ {
return Pango.Weight.Normal;
+ }
if (weight == Perspex.Media.FontWeight.DemiBold || weight == Perspex.Media.FontWeight.Medium)
+ {
return Pango.Weight.Semibold;
+ }
if (weight == Perspex.Media.FontWeight.Bold)
+ {
return Pango.Weight.Bold;
+ }
if (weight == Perspex.Media.FontWeight.UltraBold || weight == Perspex.Media.FontWeight.ExtraBold)
+ {
return Pango.Weight.Ultrabold;
+ }
if (weight == Perspex.Media.FontWeight.Black || weight == Perspex.Media.FontWeight.Heavy || weight == Perspex.Media.FontWeight.UltraBlack)
+ {
return Pango.Weight.Heavy;
+ }
return Pango.Weight.Ultralight;
}
@@ -60,10 +72,14 @@ namespace Perspex.Cairo
public static Pango.Alignment ToCairo(this Perspex.Media.TextAlignment alignment)
{
if (alignment == Perspex.Media.TextAlignment.Left)
+ {
return Pango.Alignment.Left;
+ }
if (alignment == Perspex.Media.TextAlignment.Centered)
+ {
return Pango.Alignment.Center;
+ }
return Pango.Alignment.Right;
}
diff --git a/Cairo/Perspex.Cairo/Media/FormattedTextImpl.cs b/Cairo/Perspex.Cairo/Media/FormattedTextImpl.cs
index 0bfe888f8f..2925b2e741 100644
--- a/Cairo/Perspex.Cairo/Media/FormattedTextImpl.cs
+++ b/Cairo/Perspex.Cairo/Media/FormattedTextImpl.cs
@@ -46,7 +46,6 @@ namespace Perspex.Cairo.Media
set
{
-
this.Layout.Width = Pango.Units.FromDouble(value.Width);
}
}
diff --git a/Cairo/Perspex.Cairo/Media/Imaging/RenderTargetBitmapImpl.cs b/Cairo/Perspex.Cairo/Media/Imaging/RenderTargetBitmapImpl.cs
index c0ccc372ab..68404cbf03 100644
--- a/Cairo/Perspex.Cairo/Media/Imaging/RenderTargetBitmapImpl.cs
+++ b/Cairo/Perspex.Cairo/Media/Imaging/RenderTargetBitmapImpl.cs
@@ -12,7 +12,6 @@ namespace Perspex.Cairo.Media.Imaging
public class RenderTargetBitmapImpl : BitmapImpl, IRenderTargetBitmapImpl
{
-
public RenderTargetBitmapImpl(
Cairo.ImageSurface surface)
: base(surface)
diff --git a/Cairo/Perspex.Cairo/Renderer.cs b/Cairo/Perspex.Cairo/Renderer.cs
index ad4b7aeee6..046be3e5b4 100644
--- a/Cairo/Perspex.Cairo/Renderer.cs
+++ b/Cairo/Perspex.Cairo/Renderer.cs
@@ -20,6 +20,8 @@ namespace Perspex.Cairo
///
public class Renderer : RendererBase
{
+ private ImageSurface surface;
+
///
/// Initializes a new instance of the class.
///
@@ -30,7 +32,6 @@ namespace Perspex.Cairo
{
}
- private ImageSurface surface;
public Renderer(ImageSurface surface)
{
this.surface = surface;
diff --git a/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs b/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs
index c01c8b03d0..26ec49996e 100644
--- a/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs
+++ b/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs
@@ -22,7 +22,7 @@ namespace Perspex.Gtk
{
}
- public static GtkKeyboardDevice Instance
+ public static new GtkKeyboardDevice Instance
{
get { return instance; }
}
diff --git a/Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs b/Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs
index 3a78a6bb03..afa6a5ba02 100644
--- a/Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs
+++ b/Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs
@@ -22,7 +22,7 @@ namespace Perspex.Gtk
{
}
- public static GtkMouseDevice Instance
+ public static new GtkMouseDevice Instance
{
get { return instance; }
}
diff --git a/Perspex.Base/Collections/IPerspexReadOnlyList.cs b/Perspex.Base/Collections/IPerspexReadOnlyList.cs
index d25715c9b2..454467ce3c 100644
--- a/Perspex.Base/Collections/IPerspexReadOnlyList.cs
+++ b/Perspex.Base/Collections/IPerspexReadOnlyList.cs
@@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
-//
+//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
diff --git a/Perspex.Base/Collections/PerspexReadOnlyListView.cs b/Perspex.Base/Collections/PerspexReadOnlyListView.cs
index 0d767f358c..c6bae2e354 100644
--- a/Perspex.Base/Collections/PerspexReadOnlyListView.cs
+++ b/Perspex.Base/Collections/PerspexReadOnlyListView.cs
@@ -32,10 +32,9 @@ namespace Perspex.Collections
}
}
- public T this[int index]
- {
- get { return this.source[index]; }
- }
+ public event NotifyCollectionChangedEventHandler CollectionChanged;
+
+ public event PropertyChangedEventHandler PropertyChanged;
public int Count
{
@@ -83,9 +82,10 @@ namespace Perspex.Collections
}
}
- public event NotifyCollectionChangedEventHandler CollectionChanged;
-
- public event PropertyChangedEventHandler PropertyChanged;
+ public T this[int index]
+ {
+ get { return this.source[index]; }
+ }
public void Dispose()
{
@@ -163,15 +163,9 @@ namespace Perspex.Collections
}
}
- public TOut this[int index]
- {
- get
- {
- return (this.convert != null) ?
- this.convert(this.source[index]) :
- (TOut)(object)this.source[index];
- }
- }
+ public event NotifyCollectionChangedEventHandler CollectionChanged;
+
+ public event PropertyChangedEventHandler PropertyChanged;
public int Count
{
@@ -219,9 +213,15 @@ namespace Perspex.Collections
}
}
- public event NotifyCollectionChangedEventHandler CollectionChanged;
-
- public event PropertyChangedEventHandler PropertyChanged;
+ public TOut this[int index]
+ {
+ get
+ {
+ return (this.convert != null) ?
+ this.convert(this.source[index]) :
+ (TOut)(object)this.source[index];
+ }
+ }
public void Dispose()
{
@@ -289,5 +289,4 @@ namespace Perspex.Collections
}
}
}
-
}
diff --git a/Perspex.Base/Collections/PerspexSingleItemList.cs b/Perspex.Base/Collections/PerspexSingleItemList.cs
index 3bdc0e4e64..4497cc54a4 100644
--- a/Perspex.Base/Collections/PerspexSingleItemList.cs
+++ b/Perspex.Base/Collections/PerspexSingleItemList.cs
@@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
-//
+//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
@@ -36,18 +36,9 @@ namespace Perspex.Collections
this.item = item;
}
- public T this[int index]
- {
- get
- {
- if (index < 0 || index >= this.Count)
- {
- throw new ArgumentOutOfRangeException();
- }
+ public event NotifyCollectionChangedEventHandler CollectionChanged;
- return item;
- }
- }
+ public event PropertyChangedEventHandler PropertyChanged;
public int Count
{
@@ -96,9 +87,18 @@ namespace Perspex.Collections
}
}
- public event NotifyCollectionChangedEventHandler CollectionChanged;
+ public T this[int index]
+ {
+ get
+ {
+ if (index < 0 || index >= this.Count)
+ {
+ throw new ArgumentOutOfRangeException();
+ }
- public event PropertyChangedEventHandler PropertyChanged;
+ return this.item;
+ }
+ }
public IEnumerator GetEnumerator()
{
diff --git a/Perspex.Base/PerspexObject.cs b/Perspex.Base/PerspexObject.cs
index 8d35b9ce8e..6f62a7f874 100644
--- a/Perspex.Base/PerspexObject.cs
+++ b/Perspex.Base/PerspexObject.cs
@@ -6,15 +6,15 @@
namespace Perspex
{
+ using Splat;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
+ using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reflection;
using Perspex.Diagnostics;
- using Splat;
- using System.Reactive.Disposables;
using Perspex.Reactive;
///
@@ -306,25 +306,27 @@ namespace Perspex
{
Contract.Requires(property != null);
- return new PerspexObservable