-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Perspex/master
Merge latest commits.
- Loading branch information
Showing
894 changed files
with
20,702 additions
and
16,659 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; This file is for unifying the coding style for different editors and IDEs. | ||
; More information at http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = CRLF | ||
|
||
[*.cs] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
[submodule "src/Perspex.ReactiveUI/src"] | ||
path = src/Perspex.ReactiveUI/src | ||
url = https://github.com/reactiveui/ReactiveUI.git | ||
[submodule "src/Perspex.HtmlRenderer/external"] | ||
path = src/Perspex.HtmlRenderer/external | ||
url = https://github.com/Perspex/HTML-Renderer.git | ||
branch = perspex-pcl | ||
[submodule "src/Markup/Perspex.Markup.Xaml/OmniXAML"] | ||
path = src/Markup/Perspex.Markup.Xaml/OmniXAML | ||
url = https://github.com/SuperJMN/OmniXAML.git |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=6417B24E_002D49C2_002D4985_002D8DB2_002D3AB9D898EC91/@EntryIndexedValue">ExplicitlyExcluded</s:String> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=E3A1060B_002D50D0_002D44E8_002D88B6_002DF44EF2E5BD72_002Ff_003Ahtml_002Ehtm/@EntryIndexedValue">ExplicitlyExcluded</s:String> | ||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantUsingDirective/@EntryIndexedValue">HINT</s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Interfaces/@EntryIndexedValue"><Policy Inspect="False" Prefix="I" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Locals/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Other/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Parameters/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="s_" Suffix="" Style="aaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"><ExtraRule Prefix="s_" Suffix="" Style="aaBb" /></Policy></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypeParameters/@EntryIndexedValue"><Policy Inspect="False" Prefix="T" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue"><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></s:String></wpf:ResourceDictionary> |
Binary file not shown.
44 changes: 44 additions & 0 deletions
44
Tests/Perspex.Controls.UnitTests/DockPanelTests/AlignerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace Perspex.Controls.UnitTests.DockPanelTests | ||
{ | ||
using Xunit; | ||
|
||
|
||
public class AlignerTests | ||
{ | ||
[Fact] | ||
public void ToStartTest() | ||
{ | ||
Segment container = new Segment(2, 5); | ||
|
||
var aligned = container.AlignToStart(2); | ||
Assert.Equal(new Segment(2, 4), aligned); | ||
} | ||
|
||
[Fact] | ||
public void ToEndTest() | ||
{ | ||
Segment container = new Segment(2, 5); | ||
|
||
var aligned = container.AlignToEnd(2); | ||
Assert.Equal(new Segment(3, 5), aligned); | ||
} | ||
|
||
[Fact] | ||
public void ToMiddleTest() | ||
{ | ||
Segment container = new Segment(2, 5); | ||
|
||
var aligned = container.AlignToMiddle(2); | ||
Assert.Equal(new Segment(2.5, 4.5), aligned); | ||
} | ||
|
||
[Fact] | ||
public void ToMiddleTest2() | ||
{ | ||
Segment container = new Segment(0, 500); | ||
|
||
var aligned = container.AlignToMiddle(200); | ||
Assert.Equal(new Segment(150, 350), aligned); | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
Tests/Perspex.Controls.UnitTests/DockPanelTests/LeftDockerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Perspex.Controls.UnitTests.DockPanelTests | ||
{ | ||
using System.Collections.Generic; | ||
using Layout; | ||
using Moq; | ||
using Xunit; | ||
|
||
public class LeftDockerTests | ||
{ | ||
private readonly ILayoutable _layoutable; | ||
|
||
public LeftDockerTests() | ||
{ | ||
var layoutableMock = new Mock<ILayoutable>(); | ||
layoutableMock.Setup(l => l.DesiredSize).Returns(new Size(40, 30)); | ||
_layoutable = layoutableMock.Object; | ||
} | ||
|
||
[Theory] | ||
[MemberData("Source")] | ||
public void Dock(Margins margins, Rect expectedRect) | ||
{ | ||
var sut = new LeftDocker(new Size(100, 50)); | ||
var actualRect = sut.GetDockingRect(_layoutable.DesiredSize, margins, new Alignments(Alignment.Middle, Alignment.Stretch)); | ||
|
||
Assert.Equal(expectedRect, actualRect); | ||
} | ||
|
||
// ReSharper disable once UnusedMember.Global | ||
public static IEnumerable<object[]> Source => new[] | ||
{ | ||
new object[] { new Margins(), new Rect(0, 0, 40, 50)}, | ||
new object[] { new Margins { VerticalMargin = new Segment(15, 0) }, new Rect(0, 15, 40, 35)}, | ||
new object[] { new Margins { VerticalMargin = new Segment(0, 15) }, new Rect(0, 0, 40, 35)}, | ||
new object[] { new Margins { VerticalMargin = new Segment(20, 15) }, new Rect(0, 20, 40, 15)}, | ||
}; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Tests/Perspex.Controls.UnitTests/DockPanelTests/RectAlignerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
namespace Perspex.Controls.UnitTests.DockPanelTests | ||
{ | ||
using Layout; | ||
using Xunit; | ||
|
||
public class RectAlignerTests | ||
{ | ||
private readonly Rect _container = new Rect(0, 0, 40, 40); | ||
private readonly Size _child = new Size(20, 20); | ||
|
||
[Theory] | ||
[MemberData("TestData")] | ||
public void LefTopTest(Alignment horz, Alignment vert, Rect expectedRect) | ||
{ | ||
var actualRect = _container.AlignChild(_child, horz, vert); | ||
Assert.Equal(expectedRect, actualRect); | ||
} | ||
|
||
// ReSharper disable once UnusedMember.Global | ||
public static object[] TestData => new object[] | ||
{ | ||
new object[] {Alignment.Start, Alignment.Start, new Rect(0, 0, 20, 20)}, | ||
new object[] {Alignment.Middle, Alignment.Start, new Rect(10, 0, 20, 20)}, | ||
new object[] {Alignment.End, Alignment.Start, new Rect(20, 0, 20, 20)}, | ||
new object[] {Alignment.Stretch, Alignment.Start, new Rect(0, 0, 40, 20)}, | ||
|
||
new object[] {Alignment.Start, Alignment.Middle, new Rect(0, 10, 20, 20)}, | ||
new object[] {Alignment.Middle, Alignment.Middle, new Rect(10, 10, 20, 20)}, | ||
new object[] {Alignment.End, Alignment.Middle, new Rect(20, 10, 20, 20)}, | ||
new object[] {Alignment.Stretch, Alignment.Middle, new Rect(0, 10, 40, 20)}, | ||
|
||
new object[] {Alignment.Start, VerticalAlignment.Bottom, new Rect(0, 20, 20, 20)}, | ||
new object[] {Alignment.Middle, VerticalAlignment.Bottom, new Rect(10, 20, 20, 20)}, | ||
new object[] {Alignment.End, VerticalAlignment.Bottom, new Rect(20, 20, 20, 20)}, | ||
new object[] {Alignment.Stretch, VerticalAlignment.Bottom, new Rect(0, 20, 40, 20)}, | ||
|
||
new object[] {Alignment.Stretch, VerticalAlignment.Stretch, new Rect(0, 0, 40, 40)}, | ||
}; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
Tests/Perspex.Controls.UnitTests/DockPanelTests/RightDockerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Perspex.Controls.UnitTests.DockPanelTests | ||
{ | ||
using System.Collections.Generic; | ||
using Layout; | ||
using Moq; | ||
using Xunit; | ||
|
||
public class RightDockerTests | ||
{ | ||
private readonly ILayoutable _layoutable; | ||
|
||
public RightDockerTests() | ||
{ | ||
var layoutableMock = new Mock<ILayoutable>(); | ||
layoutableMock.Setup(l => l.DesiredSize).Returns(new Size(40, 30)); | ||
_layoutable = layoutableMock.Object; | ||
} | ||
|
||
[Theory] | ||
[MemberData("Source")] | ||
public void Dock(Margins margins, Rect expectedRect) | ||
{ | ||
var sut = new RightDocker(new Size(100, 50)); | ||
var actualRect = sut.GetDockingRect(_layoutable.DesiredSize, margins, new Alignments(Alignment.Middle, Alignment.Stretch)); | ||
|
||
Assert.Equal(expectedRect, actualRect); | ||
} | ||
|
||
// ReSharper disable once UnusedMember.Global | ||
public static IEnumerable<object[]> Source => new[] | ||
{ | ||
new object[] { new Margins(), new Rect(60, 0, 40, 50)}, | ||
new object[] { new Margins { VerticalMargin = new Segment(0, 15) }, new Rect(60, 0, 40, 35)}, | ||
new object[] { new Margins { VerticalMargin = new Segment(15, 0) }, new Rect(60, 15, 40, 35)}, | ||
new object[] { new Margins { VerticalMargin = new Segment(20, 15) }, new Rect(60, 20, 40, 15)}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Getting Started | ||
|
||
## Windows | ||
|
||
![](add-dialogs.png) | ||
|
||
The easiest way to try out Perspex is to install the Visual Studio Extension. | ||
|
||
This will add a Perspex project template and a Window template to the standard Visual Studo “Add” dialog (yes, icons still to come :) ): | ||
|
||
## OSX / Linux | ||
|
||
It is a little more manual on non-Windows platforms, but using Xamarin Studio you can install the Perspex NuGet package. | ||
|
||
![](add-packages.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.