Browse Source

Merge branch 'alpha1'

pull/83/head 0.0.1-alpha
Steven Kirk 11 years ago
parent
commit
45da77b11c
  1. 1
      .gitignore
  2. 9
      Perspex.sln
  3. 7
      nuget/.gitignore
  4. 24
      nuget/Perspex/Perspex.nuspec
  5. 11
      nuget/Perspex/build/net45/perspex.targets
  6. 39
      nuget/build.bat
  7. 19
      samples/XamlTestApplication/Program.cs
  8. 20
      samples/XamlTestApplication/Views/MainWindow.cs
  9. 5
      samples/XamlTestApplication/Views/MainWindow.xaml
  10. 6
      samples/XamlTestApplication/XamlTestApplication.csproj
  11. 2
      src/Markup/Perspex.Markup.Xaml/Context/PerspexObjectAssembler.cs
  12. 12
      src/Markup/Perspex.Markup.Xaml/Context/PerspexParserFactory.cs
  13. 2
      src/Markup/Perspex.Markup.Xaml/Context/PerspexTypeRepository.cs
  14. 2
      src/Markup/Perspex.Markup.Xaml/Context/PerspexWiringContext.cs
  15. 2
      src/Markup/Perspex.Markup.Xaml/Context/PerspexXamlMember.cs
  16. 2
      src/Markup/Perspex.Markup.Xaml/Context/PerspexXamlMemberValuePlugin.cs
  17. 2
      src/Markup/Perspex.Markup.Xaml/Context/PerspexXamlType.cs
  18. 2
      src/Markup/Perspex.Markup.Xaml/Converters/BitmapConverter.cs
  19. 2
      src/Markup/Perspex.Markup.Xaml/Converters/BrushConverter.cs
  20. 2
      src/Markup/Perspex.Markup.Xaml/Converters/GridLengthTypeConverter.cs
  21. 2
      src/Markup/Perspex.Markup.Xaml/Converters/ThicknessConverter.cs
  22. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/ObservablePropertyBranch.cs
  23. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/PropertyMountPoint.cs
  24. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/PropertyPath.cs
  25. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/TargettedProperty.cs
  26. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/DataContextChangeSynchronizer.cs
  27. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/IPerspexPropertyBinder.cs
  28. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/PerspexPropertyBinder.cs
  29. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/SourceBindingEndpoint.cs
  30. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/TargetBindingEndpoint.cs
  31. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/XamlBinding.cs
  32. 2
      src/Markup/Perspex.Markup.Xaml/DataBinding/XamlBindingDefinition.cs
  33. 14
      src/Markup/Perspex.Markup.Xaml/GlobalSuppressions.cs
  34. 2
      src/Markup/Perspex.Markup.Xaml/MarkupExtensions/BindingExtension.cs
  35. 2
      src/Markup/Perspex.Markup.Xaml/MarkupExtensions/TypeExtension.cs
  36. 18
      src/Markup/Perspex.Markup.Xaml/Perspex.Markup.Xaml.csproj
  37. 109
      src/Markup/Perspex.Markup.Xaml/PerspexXamlLoader.cs
  38. 2
      src/Markup/Perspex.Markup.Xaml/Properties/AssemblyInfo.cs
  39. 2
      src/Markup/Perspex.Markup.Xaml/Templates/Template.cs
  40. 2
      src/Markup/Perspex.Markup.Xaml/Templates/TemplateContent.cs
  41. 2
      src/Markup/Perspex.Markup.Xaml/Templates/TemplateLoader.cs
  42. 2
      src/Markup/Perspex.Markup.Xaml/Templates/XamlDataTemplate.cs
  43. 0
      src/Markup/Perspex.Markup.Xaml/app.config
  44. 1
      src/Markup/Perspex.Markup.Xaml/packages.config
  45. 78
      src/Markup/Perspex.Xaml.Desktop/InflatableResourceTranslator.cs
  46. 187
      src/Markup/Perspex.Xaml.Desktop/Perspex.Xaml.Desktop.csproj
  47. 17
      src/Markup/Perspex.Xaml.Desktop/PerspexInflatableTypeFactory.cs
  48. 13
      src/Markup/Perspex.Xaml.Desktop/PerspexWindow.cs
  49. 11
      src/Markup/Perspex.Xaml.Desktop/PerspexXamlLoader.cs
  50. 9
      src/Markup/Perspex.Xaml.Desktop/Properties/AssemblyInfo.cs
  51. 23
      src/Markup/Perspex.Xaml.Desktop/packages.config
  52. 10
      src/Markup/Perspex.Xaml/HighLevel/IResourceProvider.cs
  53. 20
      src/Markup/Perspex.Xaml/HighLevel/PerspexLoaderFactory.cs
  54. 21
      src/Markup/Perspex.Xaml/HighLevel/PerspexObjectAssemblerFactory.cs
  55. 1
      src/Perspex.Application/Perspex.Application.csproj
  56. 27
      src/Perspex.Application/Platform/IAssetLoader.cs
  57. 48
      src/Windows/Perspex.Win32/AssetLoader.cs
  58. 5
      src/Windows/Perspex.Win32/Perspex.Win32.csproj
  59. 2
      src/Windows/Perspex.Win32/Win32Platform.cs

1
.gitignore

@ -16,7 +16,6 @@
[Dd]ebug/ [Dd]ebug/
[Rr]elease/ [Rr]elease/
x64/ x64/
build/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/

9
Perspex.sln

@ -57,9 +57,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Input.UnitTests", "
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Direct2D1.UnitTests", "tests\Perspex.Direct2D1.UnitTests\Perspex.Direct2D1.UnitTests.csproj", "{EFB11458-9CDF-41C0-BE4F-44AF45A4CAB8}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Direct2D1.UnitTests", "tests\Perspex.Direct2D1.UnitTests\Perspex.Direct2D1.UnitTests.csproj", "{EFB11458-9CDF-41C0-BE4F-44AF45A4CAB8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Xaml", "src\Markup\Perspex.Xaml\Perspex.Xaml.csproj", "{3E53A01A-B331-47F3-B828-4A5717E77A24}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Markup.Xaml", "src\Markup\Perspex.Markup.Xaml\Perspex.Markup.Xaml.csproj", "{3E53A01A-B331-47F3-B828-4A5717E77A24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Xaml.Desktop", "src\Markup\Perspex.Xaml.Desktop\Perspex.Xaml.Desktop.csproj", "{EB468C39-AAC4-4963-A7B2-0A405EA63EDD}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlTestApplication", "samples\XamlTestApplication\XamlTestApplication.csproj", "{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlTestApplication", "samples\XamlTestApplication\XamlTestApplication.csproj", "{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}"
EndProject EndProject
@ -178,10 +176,6 @@ Global
{3E53A01A-B331-47F3-B828-4A5717E77A24}.Debug|Any CPU.Build.0 = Debug|Any CPU {3E53A01A-B331-47F3-B828-4A5717E77A24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|Any CPU.ActiveCfg = Release|Any CPU {3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|Any CPU.Build.0 = Release|Any CPU {3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|Any CPU.Build.0 = Release|Any CPU
{EB468C39-AAC4-4963-A7B2-0A405EA63EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB468C39-AAC4-4963-A7B2-0A405EA63EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB468C39-AAC4-4963-A7B2-0A405EA63EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB468C39-AAC4-4963-A7B2-0A405EA63EDD}.Release|Any CPU.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Any CPU.Build.0 = Debug|Any CPU {78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|Any CPU.ActiveCfg = Release|Any CPU {78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -205,7 +199,6 @@ Global
{AC18926A-E784-40FE-B09D-BB0FE2B599F0} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {AC18926A-E784-40FE-B09D-BB0FE2B599F0} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
{EFB11458-9CDF-41C0-BE4F-44AF45A4CAB8} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {EFB11458-9CDF-41C0-BE4F-44AF45A4CAB8} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
{3E53A01A-B331-47F3-B828-4A5717E77A24} = {8B6A8209-894F-4BA1-B880-965FD453982C} {3E53A01A-B331-47F3-B828-4A5717E77A24} = {8B6A8209-894F-4BA1-B880-965FD453982C}
{EB468C39-AAC4-4963-A7B2-0A405EA63EDD} = {8B6A8209-894F-4BA1-B880-965FD453982C}
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C} = {9B9E3891-2366-4253-A952-D08BCEB71098} {78CAFE33-DBEB-4132-8A28-81CFE8A4933C} = {9B9E3891-2366-4253-A952-D08BCEB71098}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

7
nuget/.gitignore

@ -0,0 +1,7 @@
- build/
**/lib/**/*.dll
**/lib/**/*.xml
**/build/**/*.dll
**/build/**/*.xml
*.nupkg

24
nuget/Perspex/Perspex.nuspec

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>Perspex</id>
<version>0.0.1-alpha</version>
<authors>stevenk</authors>
<owners>stevenk</owners>
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
<projectUrl>https://github.com/grokys/Perspex/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>The Perspex UI framework</description>
<releaseNotes>Initial alpha release.</releaseNotes>
<copyright>Copyright 2015</copyright>
<tags>Perspex</tags>
<dependencies>
<dependency id="Glass" version="1.4.4.0" />
<dependency id="OmniXaml" version="1.4.4.0" />
<dependency id="reactiveui" version="6.5.0" />
<dependency id="reactiveui-core" version="6.5.0" />
<dependency id="Serilog" version="1.5.9" />
<dependency id="Splat" version="1.6.2" />
</dependencies>
</metadata>
</package>

11
nuget/Perspex/build/net45/perspex.targets

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(MSBuildThisFileDirectory)' != '' And HasTrailingSlash('$(MSBuildThisFileDirectory)')">
<PlatformLibs Include="$(MSBuildThisFileDirectory)**\*.dll" />
<Content Include="@(PlatformLibs)">
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

39
nuget/build.bat

@ -0,0 +1,39 @@
SET lib="Perspex\lib\portable-windows8+net45"
SET build="Perspex\build\net45"
mkdir %lib%
mkdir %build%
copy ..\src\Perspex.Animation\bin\Release\Perspex.Animation.dll %lib%
copy ..\src\Perspex.Animation\bin\Release\Perspex.Animation.xml %lib%
copy ..\src\Perspex.Application\bin\Release\Perspex.Application.dll %lib%
copy ..\src\Perspex.Application\bin\Release\Perspex.Application.xml %lib%
copy ..\src\Perspex.Base\bin\Release\Perspex.Base.dll %lib%
copy ..\src\Perspex.Base\bin\Release\Perspex.Base.xml %lib%
copy ..\src\Perspex.Controls\bin\Release\Perspex.Controls.dll %lib%
copy ..\src\Perspex.Controls\bin\Release\Perspex.Controls.xml %lib%
copy ..\src\Perspex.Diagnostics\bin\Release\\Perspex.Diagnostics.dll %lib%
copy ..\src\Perspex.Diagnostics\bin\Release\\Perspex.Diagnostics.xml %lib%
copy ..\src\Perspex.Input\bin\Release\Perspex.Input.dll %lib%
copy ..\src\Perspex.Input\bin\Release\Perspex.Input.xml %lib%
copy ..\src\Perspex.Interactivity\bin\Release\Perspex.Interactivity.dll %lib%
copy ..\src\Perspex.Interactivity\bin\Release\Perspex.Interactivity.xml %lib%
copy ..\src\Perspex.Layout\bin\Release\Perspex.Layout.dll %lib%
copy ..\src\Perspex.Layout\bin\Release\Perspex.Layout.xml %lib%
copy ..\src\Perspex.SceneGraph\bin\Release\Perspex.SceneGraph.dll %lib%
copy ..\src\Perspex.SceneGraph\bin\Release\Perspex.SceneGraph.xml %lib%
copy ..\src\Perspex.Styling\bin\Release\Perspex.Styling.dll %lib%
copy ..\src\Perspex.Styling\bin\Release\Perspex.Styling.xml %lib%
copy ..\src\Perspex.Themes.Default\bin\Release\Perspex.Themes.Default.dll %lib%
copy ..\src\Perspex.Themes.Default\bin\Release\Perspex.Themes.Default.xml %lib%
copy ..\src\Markup\Perspex.Markup.Xaml\bin\Release\Perspex.Markup.Xaml.dll %lib%
copy ..\src\Markup\Perspex.Markup.Xaml\bin\Release\Perspex.Markup.Xaml.xml %lib%
copy ..\src\NGenerics\bin\Release\NGenerics.dll %lib%
copy ..\src\Windows\Perspex.Direct2D1\bin\Release\Perspex.Direct2D1.dll %build%
copy ..\src\Windows\Perspex.Direct2D1\bin\Release\SharpDX.dll %build%
copy ..\src\Windows\Perspex.Direct2D1\bin\Release\SharpDX.Direct2D1.dll %build%
copy ..\src\Windows\Perspex.Direct2D1\bin\Release\SharpDX.DXGI.dll %build%
copy ..\src\Windows\Perspex.Win32\bin\Release\Perspex.Win32.dll %build%
nuget.exe pack Perspex\Perspex.nuspec

19
samples/XamlTestApplication/Program.cs

@ -1,22 +1,14 @@
#if PERSPEX_GTK namespace XamlTestApplication
using Perspex.Gtk;
#endif
namespace XamlTestApplication
{ {
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Windows.Threading; using System.Windows.Threading;
using Glass;
using OmniXaml.AppServices.Mvvm;
using OmniXaml.AppServices.NetCore;
using Perspex; using Perspex;
using Perspex.Collections; using Perspex.Collections;
using Perspex.Controls; using Perspex.Controls;
using Perspex.Controls.Templates; using Perspex.Controls.Templates;
using Perspex.Input;
using Perspex.Xaml.Desktop;
using ReactiveUI; using ReactiveUI;
using Views;
class Item class Item
{ {
@ -55,12 +47,7 @@ namespace XamlTestApplication
var testCommand = ReactiveCommand.Create(); var testCommand = ReactiveCommand.Create();
testCommand.Subscribe(_ => Debug.WriteLine("Test command executed.")); testCommand.Subscribe(_ => Debug.WriteLine("Test command executed."));
var typeFactory = new PerspexInflatableTypeFactory(); var window = new MainWindow();
var viewFactory = new ViewFactory(typeFactory);
viewFactory.RegisterViews(ViewRegistration.FromTypes(Assemblies.AssembliesInAppFolder.AllExportedTypes()));
var window = (Window) viewFactory.GetWindow("Main");
window.Show(); window.Show();
Application.Current.Run(window); Application.Current.Run(window);
} }

20
samples/XamlTestApplication/Views/MainWindow.cs

@ -1,15 +1,27 @@
namespace XamlTestApplication.Views namespace XamlTestApplication.Views
{ {
using OmniXaml.AppServices.Mvvm; using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using OmniXaml;
using Perspex.Controls;
using Perspex.Diagnostics; using Perspex.Diagnostics;
using Perspex.Xaml.Desktop; using Perspex.Markup.Xaml;
[ViewToken("Main", typeof(MainWindow))] public class MainWindow : Window
public class MainWindow : PerspexWindow
{ {
public MainWindow() public MainWindow()
{ {
this.InitializeComponent();
DevTools.Attach(this); DevTools.Attach(this);
} }
private void InitializeComponent()
{
PerspexXamlLoader.Load(this);
}
} }
} }

5
samples/XamlTestApplication/Views/MainWindow.xaml

@ -1,4 +1,7 @@
<Window Title="Perspex Test Application" Height="350" Width="525" xmlns="https://github.com/grokys/Perspex"> <Window x:Class="XamlTestApplication.MainWindow"
xmlns="https://github.com/grokys/Perspex"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Perspex Test Application" Height="350" Width="525">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

6
samples/XamlTestApplication/XamlTestApplication.csproj

@ -177,11 +177,7 @@
<Project>{3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f}</Project> <Project>{3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f}</Project>
<Name>Perspex.Themes.Default</Name> <Name>Perspex.Themes.Default</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\src\Markup\Perspex.Xaml.Desktop\Perspex.Xaml.Desktop.csproj"> <ProjectReference Include="..\..\src\Markup\Perspex.Markup.Xaml\Perspex.Markup.Xaml.csproj">
<Project>{eb468c39-aac4-4963-a7b2-0a405ea63edd}</Project>
<Name>Perspex.Xaml.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Markup\Perspex.Xaml\Perspex.Xaml.csproj">
<Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project> <Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project>
<Name>Perspex.Xaml</Name> <Name>Perspex.Xaml</Name>
</ProjectReference> </ProjectReference>

2
src/Markup/Perspex.Xaml/Context/PerspexObjectAssembler.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexObjectAssembler.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Context namespace Perspex.Markup.Xaml.Context
{ {
using System; using System;
using OmniXaml; using OmniXaml;

12
src/Markup/Perspex.Xaml.Desktop/PerspexParserFactory.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexParserFactory.cs

@ -1,19 +1,23 @@
namespace Perspex.Xaml.Desktop namespace Perspex.Markup.Xaml.Context
{ {
using Context;
using HighLevel;
using OmniXaml; using OmniXaml;
using OmniXaml.ObjectAssembler; using OmniXaml.ObjectAssembler;
using OmniXaml.Parsers.ProtoParser; using OmniXaml.Parsers.ProtoParser;
using OmniXaml.Parsers.XamlNodes; using OmniXaml.Parsers.XamlNodes;
using Perspex.Markup.Xaml.Context;
public class PerspexParserFactory : IXamlParserFactory public class PerspexParserFactory : IXamlParserFactory
{ {
private readonly IWiringContext wiringContext; private readonly IWiringContext wiringContext;
public PerspexParserFactory()
: this(new TypeFactory())
{
}
public PerspexParserFactory(ITypeFactory typeFactory) public PerspexParserFactory(ITypeFactory typeFactory)
{ {
wiringContext = PerspexWiringContextFactory.GetContext(typeFactory); wiringContext = new PerspexWiringContext(typeFactory);
} }
public IXamlParser CreateForReadingFree() public IXamlParser CreateForReadingFree()

2
src/Markup/Perspex.Xaml/Context/PerspexTypeRepository.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexTypeRepository.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Context namespace Perspex.Markup.Xaml.Context
{ {
using System; using System;
using DataBinding; using DataBinding;

2
src/Markup/Perspex.Xaml/Context/PerspexWiringContext.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexWiringContext.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Context namespace Perspex.Markup.Xaml.Context
{ {
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;

2
src/Markup/Perspex.Xaml/Context/PerspexXamlMember.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexXamlMember.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Context namespace Perspex.Markup.Xaml.Context
{ {
using DataBinding; using DataBinding;
using OmniXaml; using OmniXaml;

2
src/Markup/Perspex.Xaml/Context/PerspexXamlMemberValuePlugin.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexXamlMemberValuePlugin.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Context namespace Perspex.Markup.Xaml.Context
{ {
using System; using System;
using System.Reactive.Linq; using System.Reactive.Linq;

2
src/Markup/Perspex.Xaml/Context/PerspexXamlType.cs → src/Markup/Perspex.Markup.Xaml/Context/PerspexXamlType.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Context namespace Perspex.Markup.Xaml.Context
{ {
using System; using System;
using DataBinding; using DataBinding;

2
src/Markup/Perspex.Xaml/Converters/BitmapConverter.cs → src/Markup/Perspex.Markup.Xaml/Converters/BitmapConverter.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Converters namespace Perspex.Markup.Xaml.Converters
{ {
using System; using System;
using System.Globalization; using System.Globalization;

2
src/Markup/Perspex.Xaml/Converters/BrushConverter.cs → src/Markup/Perspex.Markup.Xaml/Converters/BrushConverter.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Converters namespace Perspex.Markup.Xaml.Converters
{ {
using System; using System;
using System.Globalization; using System.Globalization;

2
src/Markup/Perspex.Xaml/Converters/GridLengthTypeConverter.cs → src/Markup/Perspex.Markup.Xaml/Converters/GridLengthTypeConverter.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Converters namespace Perspex.Markup.Xaml.Converters
{ {
using System; using System;
using System.Globalization; using System.Globalization;

2
src/Markup/Perspex.Xaml/Converters/ThicknessConverter.cs → src/Markup/Perspex.Markup.Xaml/Converters/ThicknessConverter.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Converters namespace Perspex.Markup.Xaml.Converters
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

2
src/Markup/Perspex.Xaml/DataBinding/ChangeTracking/ObservablePropertyBranch.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/ObservablePropertyBranch.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding.ChangeTracking namespace Perspex.Markup.Xaml.DataBinding.ChangeTracking
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

2
src/Markup/Perspex.Xaml/DataBinding/ChangeTracking/PropertyMountPoint.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/PropertyMountPoint.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding.ChangeTracking namespace Perspex.Markup.Xaml.DataBinding.ChangeTracking
{ {
using System; using System;
using System.Reflection; using System.Reflection;

2
src/Markup/Perspex.Xaml/DataBinding/ChangeTracking/PropertyPath.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/PropertyPath.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding.ChangeTracking namespace Perspex.Markup.Xaml.DataBinding.ChangeTracking
{ {
public class PropertyPath public class PropertyPath
{ {

2
src/Markup/Perspex.Xaml/DataBinding/ChangeTracking/TargettedProperty.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/ChangeTracking/TargettedProperty.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding.ChangeTracking namespace Perspex.Markup.Xaml.DataBinding.ChangeTracking
{ {
using System; using System;
using System.Reflection; using System.Reflection;

2
src/Markup/Perspex.Xaml/DataBinding/DataContextChangeSynchronizer.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/DataContextChangeSynchronizer.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
using System; using System;
using System.Diagnostics; using System.Diagnostics;

2
src/Markup/Perspex.Xaml/DataBinding/IPerspexPropertyBinder.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/IPerspexPropertyBinder.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
using System.Collections.Generic; using System.Collections.Generic;

2
src/Markup/Perspex.Xaml/DataBinding/PerspexPropertyBinder.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/PerspexPropertyBinder.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

2
src/Markup/Perspex.Xaml/DataBinding/SourceBindingEndpoint.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/SourceBindingEndpoint.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
using System; using System;
using System.ComponentModel; using System.ComponentModel;

2
src/Markup/Perspex.Xaml/DataBinding/TargetBindingEndpoint.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/TargetBindingEndpoint.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
public class TargetBindingEndpoint public class TargetBindingEndpoint
{ {

2
src/Markup/Perspex.Xaml/DataBinding/XamlBinding.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/XamlBinding.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
using System; using System;
using System.Diagnostics; using System.Diagnostics;

2
src/Markup/Perspex.Xaml/DataBinding/XamlBindingDefinition.cs → src/Markup/Perspex.Markup.Xaml/DataBinding/XamlBindingDefinition.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.DataBinding namespace Perspex.Markup.Xaml.DataBinding
{ {
using ChangeTracking; using ChangeTracking;
using Controls; using Controls;

14
src/Markup/Perspex.Markup.Xaml/GlobalSuppressions.cs

@ -0,0 +1,14 @@
// -----------------------------------------------------------------------
// <copyright file="GlobalSuppressions.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
"StyleCop.CSharp.MaintainabilityRules",
"SA1401:Fields must be private",
Justification = "PerspexProperty fields should not be private.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
"StyleCop.CSharp.DocumentationRules",
"SA1609:Property documentation must have value",
Justification = "This rule is fscking pointless")]

2
src/Markup/Perspex.Xaml/MarkupExtensions/BindingExtension.cs → src/Markup/Perspex.Markup.Xaml/MarkupExtensions/BindingExtension.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.MarkupExtensions namespace Perspex.Markup.Xaml.MarkupExtensions
{ {
using System.Linq; using System.Linq;
using Controls; using Controls;

2
src/Markup/Perspex.Xaml/MarkupExtensions/TypeExtension.cs → src/Markup/Perspex.Markup.Xaml/MarkupExtensions/TypeExtension.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.MarkupExtensions namespace Perspex.Markup.Xaml.MarkupExtensions
{ {
using System; using System;
using Glass; using Glass;

18
src/Markup/Perspex.Xaml/Perspex.Xaml.csproj → src/Markup/Perspex.Markup.Xaml/Perspex.Markup.Xaml.csproj

@ -8,8 +8,8 @@
<ProjectGuid>{3E53A01A-B331-47F3-B828-4A5717E77A24}</ProjectGuid> <ProjectGuid>{3E53A01A-B331-47F3-B828-4A5717E77A24}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Perspex.Xaml</RootNamespace> <RootNamespace>Perspex.Markup.Xaml</RootNamespace>
<AssemblyName>Perspex.Xaml</AssemblyName> <AssemblyName>Perspex.Markup.Xaml</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage> <DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@ -32,16 +32,15 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Perspex.Markup.Xaml.XML</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs"> <Compile Include="..\..\Shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link> <Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="Converters\ThicknessConverter.cs" /> <Compile Include="Converters\ThicknessConverter.cs" />
<Compile Include="HighLevel\PerspexObjectAssemblerFactory.cs" />
<Compile Include="HighLevel\PerspexLoaderFactory.cs" />
<Compile Include="HighLevel\IResourceProvider.cs" />
<Compile Include="Context\PerspexWiringContext.cs" /> <Compile Include="Context\PerspexWiringContext.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="MarkupExtensions\BindingExtension.cs" /> <Compile Include="MarkupExtensions\BindingExtension.cs" />
<Compile Include="Converters\BrushConverter.cs" /> <Compile Include="Converters\BrushConverter.cs" />
<Compile Include="Converters\BitmapConverter.cs" /> <Compile Include="Converters\BitmapConverter.cs" />
@ -50,6 +49,7 @@
<Compile Include="DataBinding\ChangeTracking\PropertyMountPoint.cs" /> <Compile Include="DataBinding\ChangeTracking\PropertyMountPoint.cs" />
<Compile Include="DataBinding\ChangeTracking\PropertyPath.cs" /> <Compile Include="DataBinding\ChangeTracking\PropertyPath.cs" />
<Compile Include="DataBinding\ChangeTracking\TargettedProperty.cs" /> <Compile Include="DataBinding\ChangeTracking\TargettedProperty.cs" />
<Compile Include="Context\PerspexParserFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DataBinding\DataContextChangeSynchronizer.cs" /> <Compile Include="DataBinding\DataContextChangeSynchronizer.cs" />
<Compile Include="DataBinding\IPerspexPropertyBinder.cs" /> <Compile Include="DataBinding\IPerspexPropertyBinder.cs" />
@ -68,6 +68,7 @@
<Compile Include="Context\PerspexXamlMemberValuePlugin.cs" /> <Compile Include="Context\PerspexXamlMemberValuePlugin.cs" />
<Compile Include="Context\PerspexXamlType.cs" /> <Compile Include="Context\PerspexXamlType.cs" />
<Compile Include="Templates\XamlDataTemplate.cs" /> <Compile Include="Templates\XamlDataTemplate.cs" />
<Compile Include="PerspexXamlLoader.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
@ -78,6 +79,10 @@
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project> <Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project>
<Name>Perspex.Animation</Name> <Name>Perspex.Animation</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\Perspex.Application\Perspex.Application.csproj">
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project>
<Name>Perspex.Application</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Base\Perspex.Base.csproj"> <ProjectReference Include="..\..\Perspex.Base\Perspex.Base.csproj">
<Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project> <Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project>
<Name>Perspex.Base</Name> <Name>Perspex.Base</Name>
@ -149,6 +154,9 @@
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.0.0-beta008\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

109
src/Markup/Perspex.Markup.Xaml/PerspexXamlLoader.cs

@ -0,0 +1,109 @@
// -----------------------------------------------------------------------
// <copyright file="PerspexXamlLoader.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Markup.Xaml
{
using System;
using System.Reflection;
using OmniXaml;
using Perspex.Markup.Xaml.Context;
using Platform;
using Splat;
/// <summary>
/// Loads XAML for a perspex application.
/// </summary>
public class PerspexXamlLoader : XamlLoader
{
/// <summary>
/// Initializes a new instance of the <see cref="PerspexXamlLoader"/> class.
/// </summary>
public PerspexXamlLoader()
: this(new PerspexParserFactory())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="PerspexXamlLoader"/> class.
/// </summary>
/// <param name="xamlParserFactory">The parser factory to use.</param>
public PerspexXamlLoader(IXamlParserFactory xamlParserFactory)
: base(xamlParserFactory)
{
}
/// <summary>
/// Loads the XAML into a Perspex component.
/// </summary>
/// <param name="obj">The object to load the XAML into.</param>
public static void Load(object obj)
{
var loader = new PerspexXamlLoader();
loader.Load(obj.GetType(), obj);
}
/// <summary>
/// Loads the XAML for a type.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="rootInstance">
/// The optional instance into which the XAML should be loaded.
/// </param>
/// <returns>The loaded object.</returns>
public object Load(Type type, object rootInstance = null)
{
return this.Load(GetUriFor(type), rootInstance);
}
/// <summary>
/// Loads XAML from a URI.
/// </summary>
/// <param name="uri">The URI of the XAML file.</param>
/// <param name="rootInstance">
/// The optional instance into which the XAML should be loaded.
/// </param>
/// <returns>The loaded object.</returns>
public object Load(Uri uri, object rootInstance = null)
{
var assetLocator = Locator.Current.GetService<IAssetLoader>();
if (assetLocator == null)
{
throw new InvalidOperationException(
"Could not create IAssetLoader : maybe Application.RegisterServices() wasn't called?");
}
using (var stream = assetLocator.Open(uri))
{
return this.Load(stream, rootInstance);
}
}
/// <summary>
/// Gets the URI for a type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>The URI.</returns>
private static Uri GetUriFor(Type type)
{
if (type.Namespace != null)
{
var toRemove = type.GetTypeInfo().Assembly.GetName().Name;
var substracted = toRemove.Length < type.Namespace.Length ? type.Namespace.Remove(0, toRemove.Length + 1) : "";
var replace = substracted.Replace('.', '/');
if (replace != string.Empty)
{
replace = replace + "/";
}
return new Uri(replace + type.Name + ".xaml", UriKind.Relative);
}
return null;
}
}
}

2
src/Markup/Perspex.Xaml/Properties/AssemblyInfo.cs → src/Markup/Perspex.Markup.Xaml/Properties/AssemblyInfo.cs

@ -6,4 +6,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyTitle("Perspex.Xaml")] [assembly: AssemblyTitle("Perspex.Markup.Xaml")]

2
src/Markup/Perspex.Xaml/Templates/Template.cs → src/Markup/Perspex.Markup.Xaml/Templates/Template.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Templates namespace Perspex.Markup.Xaml.Templates
{ {
public class Template public class Template
{ {

2
src/Markup/Perspex.Xaml/Templates/TemplateContent.cs → src/Markup/Perspex.Markup.Xaml/Templates/TemplateContent.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Templates namespace Perspex.Markup.Xaml.Templates
{ {
using System.Collections.Generic; using System.Collections.Generic;
using Context; using Context;

2
src/Markup/Perspex.Xaml/Templates/TemplateLoader.cs → src/Markup/Perspex.Markup.Xaml/Templates/TemplateLoader.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Templates namespace Perspex.Markup.Xaml.Templates
{ {
using System.Collections.Generic; using System.Collections.Generic;
using OmniXaml; using OmniXaml;

2
src/Markup/Perspex.Xaml/Templates/XamlDataTemplate.cs → src/Markup/Perspex.Markup.Xaml/Templates/XamlDataTemplate.cs

@ -1,4 +1,4 @@
namespace Perspex.Xaml.Templates namespace Perspex.Markup.Xaml.Templates
{ {
using System; using System;
using Controls.Templates; using Controls.Templates;

0
src/Markup/Perspex.Xaml/app.config → src/Markup/Perspex.Markup.Xaml/app.config

1
src/Markup/Perspex.Xaml/packages.config → src/Markup/Perspex.Markup.Xaml/packages.config

@ -13,4 +13,5 @@
<package id="Splat" version="1.6.2" targetFramework="portable46-net451+win81" /> <package id="Splat" version="1.6.2" targetFramework="portable46-net451+win81" />
<package id="Sprache" version="2.0.0.46" targetFramework="portable46-net451+win81" /> <package id="Sprache" version="2.0.0.46" targetFramework="portable46-net451+win81" />
<package id="Sprache.SuperJMN" version="2.0.0.46" targetFramework="portable46-net451+win81" /> <package id="Sprache.SuperJMN" version="2.0.0.46" targetFramework="portable46-net451+win81" />
<package id="StyleCop.Analyzers" version="1.0.0-beta008" targetFramework="portable46-net451+win81" developmentDependency="true" />
</packages> </packages>

78
src/Markup/Perspex.Xaml.Desktop/InflatableResourceTranslator.cs

@ -1,78 +0,0 @@
namespace Perspex.Xaml.Desktop
{
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using OmniXaml.AppServices;
public class InflatableResourceTranslator : IInflatableTranslator
{
public Stream GetStream(Type type)
{
var uri = GetUriFor(type);
var assembly = Assembly.GetEntryAssembly();
var resourceName = assembly.GetName().Name + ".g";
var manager = new ResourceManager(resourceName, assembly);
using (ResourceSet resourceSet = manager.GetResourceSet(CultureInfo.CurrentCulture, true, true))
{
Stream s = (Stream)resourceSet.GetObject(uri.ToString(), true);
if (s == null)
{
throw new IOException(
"The requested resource could not be found: " +
uri.OriginalString);
}
return s;
}
}
private static Uri GetUriFor(Type type)
{
if (type.Namespace != null)
{
var toRemove = type.Assembly.GetName().Name;
var substracted = toRemove.Length < type.Namespace.Length ? type.Namespace.Remove(0, toRemove.Length + 1) : "";
var replace = substracted.Replace('.', Path.PathSeparator);
if (replace != string.Empty)
{
replace = replace + "/";
}
return new Uri(replace + type.Name + ".xaml", UriKind.Relative);
}
return null;
}
public Type GetTypeFor(Uri uri)
{
var withExt = uri.OriginalString;
var lastSlash = withExt.LastIndexOf("/", StringComparison.Ordinal);
var innerNs = withExt.Substring(0, lastSlash);
var fileName = withExt.Substring(lastSlash + 1, withExt.Length - lastSlash - 1);
var className = fileName.Substring(0, fileName.LastIndexOf('.'));
var assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
var type = from assembly in assemblies
let t = assembly.GetType(GetName(assembly, innerNs, className))
where t != null
select t;
return type.First();
}
private static string GetName(Assembly assembly, string innerNs, string className)
{
var ns = assembly.GetName().Name + "." + innerNs;
var fullLocator = ns + "." + className;
return fullLocator;
}
}
}

187
src/Markup/Perspex.Xaml.Desktop/Perspex.Xaml.Desktop.csproj

@ -1,187 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EB468C39-AAC4-4963-A7B2-0A405EA63EDD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Perspex.Xaml.Desktop</RootNamespace>
<AssemblyName>Perspex.Xaml.Desktop</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Glass, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Glass.1.4.4.0\lib\portable-net451+win81+wpa81\Glass.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OmniXaml, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\OmniXaml.1.4.4.0\lib\portable-net451+win81+wpa81\OmniXaml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OmniXaml.AppServices, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\OmniXaml.AppServices.1.4.4.0\lib\portable-net451+win81+wpa81\OmniXaml.AppServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OmniXaml.AppServices.Mvvm, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\OmniXaml.AppServices.Mvvm.1.4.4.0\lib\portable-net451+win81+wpa81\OmniXaml.AppServices.Mvvm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OmniXaml.AppServices.NetCore, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\OmniXaml.AppServices.NetCore.1.4.4.0\lib\net46\OmniXaml.AppServices.NetCore.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ReactiveUI, Version=6.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\reactiveui-core.6.5.0\lib\Net45\ReactiveUI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Serilog.1.5.9\lib\net45\Serilog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Serilog.1.5.9\lib\net45\Serilog.FullNetFx.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpDX, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXPackageBinDir)\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct2D1, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXPackageBinDir)\SharpDX.Direct2D1.dll</HintPath>
</Reference>
<Reference Include="SharpDX.DXGI, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXPackageBinDir)\SharpDX.DXGI.dll</HintPath>
</Reference>
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Sprache, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Sprache.SuperJMN.2.0.0.46\lib\portable-net451+win81+wpa81\Sprache.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Reactive.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Linq, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.PlatformServices, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Rx-XAML.2.2.5\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="PerspexInflatableTypeFactory.cs" />
<Compile Include="PerspexParserFactory.cs" />
<Compile Include="PerspexWindow.cs" />
<Compile Include="PerspexXamlLoader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="InflatableResourceTranslator.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Perspex.Animation\Perspex.Animation.csproj">
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project>
<Name>Perspex.Animation</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Base\Perspex.Base.csproj">
<Project>{b09b78d8-9b26-48b0-9149-d64a2f120f3f}</Project>
<Name>Perspex.Base</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Controls\Perspex.Controls.csproj">
<Project>{d2221c82-4a25-4583-9b43-d791e3f6820c}</Project>
<Name>Perspex.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Input\Perspex.Input.csproj">
<Project>{62024b2d-53eb-4638-b26b-85eeaa54866e}</Project>
<Name>Perspex.Input</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Interactivity\Perspex.Interactivity.csproj">
<Project>{6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b}</Project>
<Name>Perspex.Interactivity</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Layout\Perspex.Layout.csproj">
<Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project>
<Name>Perspex.Layout</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.SceneGraph\Perspex.SceneGraph.csproj">
<Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project>
<Name>Perspex.SceneGraph</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Styling\Perspex.Styling.csproj">
<Project>{f1baa01a-f176-4c6a-b39d-5b40bb1b148f}</Project>
<Name>Perspex.Styling</Name>
</ProjectReference>
<ProjectReference Include="..\Perspex.Xaml\Perspex.Xaml.csproj">
<Project>{3E53A01A-B331-47F3-B828-4A5717E77A24}</Project>
<Name>Perspex.Xaml</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\packages\SharpDX.2.6.3\build\SharpDX.targets" Condition="Exists('..\..\..\packages\SharpDX.2.6.3\build\SharpDX.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\SharpDX.2.6.3\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\SharpDX.2.6.3\build\SharpDX.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

17
src/Markup/Perspex.Xaml.Desktop/PerspexInflatableTypeFactory.cs

@ -1,17 +0,0 @@
namespace Perspex.Xaml.Desktop
{
using System;
using System.Collections.ObjectModel;
using Controls;
using OmniXaml;
using OmniXaml.AppServices;
using OmniXaml.AppServices.NetCore;
public class PerspexInflatableTypeFactory : InflatableTypeFactory
{
public PerspexInflatableTypeFactory() : base(new TypeFactory(), new InflatableResourceTranslator(), typeFactory => new PerspexXamlLoader(typeFactory))
{
Inflatables = new Collection<Type> { typeof(Window), typeof(UserControl) };
}
}
}

13
src/Markup/Perspex.Xaml.Desktop/PerspexWindow.cs

@ -1,13 +0,0 @@
namespace Perspex.Xaml.Desktop
{
using Controls;
using OmniXaml.AppServices.Mvvm;
public class PerspexWindow : Window, IView
{
public void SetViewModel(object viewModel)
{
this.DataContext = viewModel;
}
}
}

11
src/Markup/Perspex.Xaml.Desktop/PerspexXamlLoader.cs

@ -1,11 +0,0 @@
namespace Perspex.Xaml.Desktop
{
using OmniXaml;
public class PerspexXamlLoader : XamlLoader
{
public PerspexXamlLoader(ITypeFactory typeFactory) : base(new PerspexParserFactory(typeFactory))
{
}
}
}

9
src/Markup/Perspex.Xaml.Desktop/Properties/AssemblyInfo.cs

@ -1,9 +0,0 @@
// -----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
using System.Reflection;
[assembly: AssemblyTitle("Perspex.Xaml.Desktop")]

23
src/Markup/Perspex.Xaml.Desktop/packages.config

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Glass" version="1.4.4.0" targetFramework="net46" />
<package id="OmniXaml" version="1.4.4.0" targetFramework="net46" />
<package id="OmniXaml.AppServices" version="1.4.4.0" targetFramework="net46" />
<package id="OmniXaml.AppServices.Mvvm" version="1.4.4.0" targetFramework="net46" />
<package id="OmniXaml.AppServices.NetCore" version="1.4.4.0" targetFramework="net46" />
<package id="reactiveui" version="6.5.0" targetFramework="net46" />
<package id="reactiveui-core" version="6.5.0" targetFramework="net46" />
<package id="Rx-Core" version="2.2.5" targetFramework="net46" />
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net46" />
<package id="Rx-Linq" version="2.2.5" targetFramework="net46" />
<package id="Rx-Main" version="2.2.5" targetFramework="net46" />
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="net46" />
<package id="Rx-XAML" version="2.2.5" targetFramework="net46" />
<package id="Serilog" version="1.5.9" targetFramework="net46" />
<package id="SharpDX" version="2.6.3" targetFramework="net46" />
<package id="SharpDX.Direct2D1" version="2.6.3" targetFramework="net46" />
<package id="SharpDX.DXGI" version="2.6.3" targetFramework="net46" />
<package id="Splat" version="1.6.2" targetFramework="net46" />
<package id="Sprache" version="2.0.0.46" targetFramework="net46" />
<package id="Sprache.SuperJMN" version="2.0.0.46" targetFramework="net46" />
</packages>

10
src/Markup/Perspex.Xaml/HighLevel/IResourceProvider.cs

@ -1,10 +0,0 @@
namespace Perspex.Xaml.HighLevel
{
using System;
using System.IO;
public interface IResourceProvider
{
Stream GetStream(Uri uri);
}
}

20
src/Markup/Perspex.Xaml/HighLevel/PerspexLoaderFactory.cs

@ -1,20 +0,0 @@
namespace Perspex.Xaml.HighLevel
{
using Context;
using OmniXaml;
public static class PerspexWiringContextFactory
{
private static IWiringContext context;
public static IWiringContext GetContext(ITypeFactory factory)
{
if (context == null)
{
context = new PerspexWiringContext(factory);
}
return context;
}
}
}

21
src/Markup/Perspex.Xaml/HighLevel/PerspexObjectAssemblerFactory.cs

@ -1,21 +0,0 @@
namespace Perspex.Xaml.HighLevel
{
using OmniXaml;
using Context;
using OmniXaml.ObjectAssembler;
public class PerspexObjectAssemblerFactory : IObjectAssemblerFactory
{
private readonly WiringContext context;
public PerspexObjectAssemblerFactory(WiringContext context)
{
this.context = context;
}
public IObjectAssembler CreateAssembler(ObjectAssemblerSettings settings)
{
return new PerspexObjectAssembler(context, settings);
}
}
}

1
src/Perspex.Application/Perspex.Application.csproj

@ -72,6 +72,7 @@
<Link>Properties\SharedAssemblyInfo.cs</Link> <Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="Application.cs" /> <Compile Include="Application.cs" />
<Compile Include="Platform\IAssetLoader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

27
src/Perspex.Application/Platform/IAssetLoader.cs

@ -0,0 +1,27 @@
// -----------------------------------------------------------------------
// <copyright file="IAssetLoader.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Platform
{
using System;
using System.IO;
/// <summary>
/// Loads assets compiled into the application binary.
/// </summary>
public interface IAssetLoader
{
/// <summary>
/// Opens the resource with the requested URI.
/// </summary>
/// <param name="uri">The URI.</param>
/// <returns>A stream containing the resource contents.</returns>
/// <exception cref="FileNotFoundException">
/// The resource was not found.
/// </exception>
Stream Open(Uri uri);
}
}

48
src/Windows/Perspex.Win32/AssetLoader.cs

@ -0,0 +1,48 @@
// -----------------------------------------------------------------------
// <copyright file="AssetLoader.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Win32
{
using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using Perspex.Platform;
/// <summary>
/// Loads assets compiled into the application binary.
/// </summary>
public class AssetLoader : IAssetLoader
{
/// <summary>
/// Opens the resource with the requested URI.
/// </summary>
/// <param name="uri">The URI.</param>
/// <returns>A stream containing the resource contents.</returns>
/// <exception cref="FileNotFoundException">
/// The resource was not found.
/// </exception>
public Stream Open(Uri uri)
{
var assembly = Assembly.GetEntryAssembly();
var resourceName = assembly.GetName().Name + ".g";
var manager = new ResourceManager(resourceName, assembly);
using (var resourceSet = manager.GetResourceSet(CultureInfo.CurrentCulture, true, true))
{
var stream = (Stream)resourceSet.GetObject(uri.ToString(), true);
if (stream == null)
{
throw new FileNotFoundException($"The requested asset could not be found: {uri}");
}
return stream;
}
}
}
}

5
src/Windows/Perspex.Win32/Perspex.Win32.csproj

@ -63,6 +63,7 @@
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs"> <Compile Include="..\..\Shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link> <Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="AssetLoader.cs" />
<Compile Include="Input\KeyInterop.cs" /> <Compile Include="Input\KeyInterop.cs" />
<Compile Include="Input\WindowsKeyboardDevice.cs" /> <Compile Include="Input\WindowsKeyboardDevice.cs" />
<Compile Include="Input\WindowsMouseDevice.cs" /> <Compile Include="Input\WindowsMouseDevice.cs" />
@ -81,6 +82,10 @@
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project> <Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project>
<Name>Perspex.Animation</Name> <Name>Perspex.Animation</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\Perspex.Application\Perspex.Application.csproj">
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project>
<Name>Perspex.Application</Name>
</ProjectReference>
<ProjectReference Include="..\..\Perspex.Base\Perspex.Base.csproj"> <ProjectReference Include="..\..\Perspex.Base\Perspex.Base.csproj">
<Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project> <Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project>
<Name>Perspex.Base</Name> <Name>Perspex.Base</Name>

2
src/Windows/Perspex.Win32/Win32Platform.cs

@ -51,12 +51,14 @@ namespace Perspex.Win32
public static void Initialize() public static void Initialize()
{ {
var locator = Locator.CurrentMutable; var locator = Locator.CurrentMutable;
locator.Register(() => new PopupImpl(), typeof(IPopupImpl)); locator.Register(() => new PopupImpl(), typeof(IPopupImpl));
locator.Register(() => new WindowImpl(), typeof(IWindowImpl)); locator.Register(() => new WindowImpl(), typeof(IWindowImpl));
locator.Register(() => WindowsKeyboardDevice.Instance, typeof(IKeyboardDevice)); locator.Register(() => WindowsKeyboardDevice.Instance, typeof(IKeyboardDevice));
locator.Register(() => WindowsMouseDevice.Instance, typeof(IMouseDevice)); locator.Register(() => WindowsMouseDevice.Instance, typeof(IMouseDevice));
locator.Register(() => instance, typeof(IPlatformSettings)); locator.Register(() => instance, typeof(IPlatformSettings));
locator.Register(() => instance, typeof(IPlatformThreadingInterface)); locator.Register(() => instance, typeof(IPlatformThreadingInterface));
locator.RegisterConstant(new AssetLoader(), typeof(IAssetLoader));
} }
public bool HasMessages() public bool HasMessages()

Loading…
Cancel
Save