diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..87ed07e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.cs eol=crlf
+*.xaml eol=crlf
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5b423ad
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,40 @@
+#Visual Studio files
+*.[Oo]bj
+*.user
+*.aps
+*.pch
+*.vspscc
+*.vssscc
+*_i.c
+*_p.c
+*.ncb
+*.suo
+*.tlb
+*.tlh
+*.bak
+*.[Cc]ache
+*.ilk
+*.log
+*.lib
+*.sbr
+*.sdf
+*.opensdf
+*.unsuccessfulbuild
+ipch/
+obj/
+[Bb]in
+[Dd]ebug*/
+[Rr]elease*/
+
+#Project files
+[Bb]uild/
+
+#NuGet
+packages/
+*.nupkg
+
+#Installer
+installer/Output
+
+*.gjq
+*.tmp
diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config
new file mode 100644
index 0000000..67f8ea0
--- /dev/null
+++ b/.nuget/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe
new file mode 100644
index 0000000..3ffdd33
Binary files /dev/null and b/.nuget/NuGet.exe differ
diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets
new file mode 100644
index 0000000..2c3545b
--- /dev/null
+++ b/.nuget/NuGet.targets
@@ -0,0 +1,151 @@
+
+
+
+ $(MSBuildProjectDirectory)\..\
+
+
+ false
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
+
+
+
+
+ $(SolutionDir).nuget
+
+
+
+ packages.$(MSBuildProjectName.Replace(' ', '_')).config
+
+
+
+
+
+ $(PackagesProjectConfig)
+
+
+
+
+ packages.config
+
+
+
+
+
+
+ $(NuGetToolsPath)\NuGet.exe
+ @(PackageSource)
+
+ "$(NuGetExePath)"
+ mono --runtime=v4.0.30319 $(NuGetExePath)
+
+ $(TargetDir.Trim('\\'))
+
+ -RequireConsent
+ -NonInteractive
+
+ "$(SolutionDir) "
+ "$(SolutionDir)"
+
+
+ $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
+ $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
+
+
+
+ RestorePackages;
+ $(BuildDependsOn);
+
+
+
+
+ $(BuildDependsOn);
+ BuildPackage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..35e1135
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c)
+
+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.
+
diff --git a/NuGet/CHANGELOG.txt b/NuGet/CHANGELOG.txt
new file mode 100644
index 0000000..b33aa2b
--- /dev/null
+++ b/NuGet/CHANGELOG.txt
@@ -0,0 +1,7 @@
+Stylet Changelog
+================
+
+v0.9.1
+------
+
+Initial release
diff --git a/NuGet/NuGet.exe b/NuGet/NuGet.exe
new file mode 100644
index 0000000..3ffdd33
Binary files /dev/null and b/NuGet/NuGet.exe differ
diff --git a/NuGet/Stylet.nuspec b/NuGet/Stylet.nuspec
new file mode 100644
index 0000000..777159f
--- /dev/null
+++ b/NuGet/Stylet.nuspec
@@ -0,0 +1,25 @@
+
+
+
+ Stylet
+ 0.9.1
+ Stylet
+ Antony Male
+ Antony Male
+ http://github.com/canton7/Stylet/blob/master/LICENSE.txt
+ http://github.com/canton7/Stylet
+ https://raw.githubusercontent.com/canton7/Stylet/master/StyletIcon.png
+ false
+ A very lightweight but powerful ViewModel-First MVVM framework for WPF, inspired by Caliburn.Micro. Comes with its own IoC container.
+ Copyright 2014 Antony Male
+ WPF MVVM ViewModel Screen Conductor ViewModel-First Model-View-ViewModel UI
+
+
+
+
+
+
+
+
+
+
diff --git a/NuGet/content/net45/StyletReadme.txt b/NuGet/content/net45/StyletReadme.txt
new file mode 100644
index 0000000..795f364
--- /dev/null
+++ b/NuGet/content/net45/StyletReadme.txt
@@ -0,0 +1,3 @@
+Welcome to Stylet! Stylet is a small but powerful MVVM framework, which supports a ViewModel-First approach.
+
+Please read the documentation at https://github.com/canton7/Stylet/wiki
diff --git a/NuGet/tools/install.ps1 b/NuGet/tools/install.ps1
new file mode 100644
index 0000000..f6a7499
--- /dev/null
+++ b/NuGet/tools/install.ps1
@@ -0,0 +1,8 @@
+param($installPath, $toolsPath, $package, $project)
+
+Write-Host "Hello"
+Write-Host $project.FullName
+$path = [System.IO.Path]
+$readmefile = $path::Combine($path::GetDirectoryName($project.FullName), "StyletReadme.txt")
+$DTE.ItemOperations.OpenFile($readmefile)
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6b129ff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,6 @@
+StyletIoC
+=========
+
+This project is still in development.
+
+[The wiki](https://github.com/canton7/Stylet/wiki/_pages) is the official (incomplete) documentation source.
diff --git a/Samples/.nuget/NuGet.Config b/Samples/.nuget/NuGet.Config
new file mode 100644
index 0000000..67f8ea0
--- /dev/null
+++ b/Samples/.nuget/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/.nuget/NuGet.exe b/Samples/.nuget/NuGet.exe
new file mode 100644
index 0000000..9cba6ed
Binary files /dev/null and b/Samples/.nuget/NuGet.exe differ
diff --git a/Samples/.nuget/NuGet.targets b/Samples/.nuget/NuGet.targets
new file mode 100644
index 0000000..2c3545b
--- /dev/null
+++ b/Samples/.nuget/NuGet.targets
@@ -0,0 +1,151 @@
+
+
+
+ $(MSBuildProjectDirectory)\..\
+
+
+ false
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
+
+
+
+
+ $(SolutionDir).nuget
+
+
+
+ packages.$(MSBuildProjectName.Replace(' ', '_')).config
+
+
+
+
+
+ $(PackagesProjectConfig)
+
+
+
+
+ packages.config
+
+
+
+
+
+
+ $(NuGetToolsPath)\NuGet.exe
+ @(PackageSource)
+
+ "$(NuGetExePath)"
+ mono --runtime=v4.0.30319 $(NuGetExePath)
+
+ $(TargetDir.Trim('\\'))
+
+ -RequireConsent
+ -NonInteractive
+
+ "$(SolutionDir) "
+ "$(SolutionDir)"
+
+
+ $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
+ $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
+
+
+
+ RestorePackages;
+ $(BuildDependsOn);
+
+
+
+
+ $(BuildDependsOn);
+ BuildPackage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.Hello/App.config b/Samples/Stylet.Samples.Hello/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.Hello/App.xaml b/Samples/Stylet.Samples.Hello/App.xaml
new file mode 100644
index 0000000..80e41ce
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.Hello/HelloBootstrapper.cs b/Samples/Stylet.Samples.Hello/HelloBootstrapper.cs
new file mode 100644
index 0000000..ca0c352
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/HelloBootstrapper.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.Hello
+{
+ class HelloBootstrapper : Bootstrapper
+ {
+ }
+}
diff --git a/Samples/Stylet.Samples.Hello/Properties/AssemblyInfo.cs b/Samples/Stylet.Samples.Hello/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ac35c77
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Stylet.Samples.Hello")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Stylet.Samples.Hello")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stylet.Samples.Hello/Properties/Resources.Designer.cs b/Samples/Stylet.Samples.Hello/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..eb301ed
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.Hello.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Stylet.Samples.Hello.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.Hello/Properties/Resources.resx b/Samples/Stylet.Samples.Hello/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.Hello/Properties/Settings.Designer.cs b/Samples/Stylet.Samples.Hello/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..6841459
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.Hello.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.Hello/Properties/Settings.settings b/Samples/Stylet.Samples.Hello/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.Hello/ShellView.xaml b/Samples/Stylet.Samples.Hello/ShellView.xaml
new file mode 100644
index 0000000..e944ad2
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/ShellView.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.Hello/ShellViewModel.cs b/Samples/Stylet.Samples.Hello/ShellViewModel.cs
new file mode 100644
index 0000000..df3b723
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/ShellViewModel.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Stylet.Samples.Hello
+{
+ class ShellViewModel : Screen
+ {
+ private string _name;
+ public string Name
+ {
+ get { return this._name; }
+ set { SetAndNotify(ref this._name, value); this.NotifyOfPropertyChange(() => this.CanSayHello); }
+ }
+
+ public ShellViewModel()
+ {
+ this.DisplayName = "Hello, Stylet";
+ }
+
+ public bool CanSayHello
+ {
+ get { return !String.IsNullOrEmpty(this.Name); }
+ }
+ public void SayHello()
+ {
+ MessageBox.Show(String.Format("Hello, {0}", this.Name)); // Don't do this
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.Hello/Stylet.Samples.Hello.csproj b/Samples/Stylet.Samples.Hello/Stylet.Samples.Hello.csproj
new file mode 100644
index 0000000..c4edc72
--- /dev/null
+++ b/Samples/Stylet.Samples.Hello/Stylet.Samples.Hello.csproj
@@ -0,0 +1,106 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {6C7FBB21-52AC-4333-A42A-9F5E9D048621}
+ WinExe
+ Properties
+ Stylet.Samples.Hello
+ Stylet.Samples.Hello
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {2435bd00-ac12-48b0-ad36-9bab2fdec3f5}
+ Stylet
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.HelloDialog/App.config b/Samples/Stylet.Samples.HelloDialog/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.HelloDialog/App.xaml b/Samples/Stylet.Samples.HelloDialog/App.xaml
new file mode 100644
index 0000000..4658d8d
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.HelloDialog/Bootstrapper.cs b/Samples/Stylet.Samples.HelloDialog/Bootstrapper.cs
new file mode 100644
index 0000000..5bf13d5
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Bootstrapper.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.HelloDialog
+{
+ public class Bootstrapper : Bootstrapper
+ {
+ protected override void ConfigureIoC(StyletIoC.IStyletIoCBuilder builder)
+ {
+ base.ConfigureIoC(builder);
+
+ builder.Bind().ToAbstractFactory();
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.HelloDialog/Dialog1View.xaml b/Samples/Stylet.Samples.HelloDialog/Dialog1View.xaml
new file mode 100644
index 0000000..713f4d2
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Dialog1View.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.HelloDialog/Dialog1ViewModel.cs b/Samples/Stylet.Samples.HelloDialog/Dialog1ViewModel.cs
new file mode 100644
index 0000000..85d412b
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Dialog1ViewModel.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.HelloDialog
+{
+ public class Dialog1ViewModel : Screen
+ {
+ public string Name { get; set; }
+
+ public Dialog1ViewModel()
+ {
+ this.DisplayName = "I'm Dialog 1";
+ }
+
+ public void Close()
+ {
+ this.TryClose(true);
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.HelloDialog/Properties/AssemblyInfo.cs b/Samples/Stylet.Samples.HelloDialog/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d907e2a
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Stylet.Samples.HelloDialog")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Stylet.Samples.HelloDialog")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stylet.Samples.HelloDialog/Properties/Resources.Designer.cs b/Samples/Stylet.Samples.HelloDialog/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..16ace46
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.HelloDialog.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Stylet.Samples.HelloDialog.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.HelloDialog/Properties/Resources.resx b/Samples/Stylet.Samples.HelloDialog/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.HelloDialog/Properties/Settings.Designer.cs b/Samples/Stylet.Samples.HelloDialog/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..15089d9
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.HelloDialog.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.HelloDialog/Properties/Settings.settings b/Samples/Stylet.Samples.HelloDialog/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.HelloDialog/ShellView.xaml b/Samples/Stylet.Samples.HelloDialog/ShellView.xaml
new file mode 100644
index 0000000..8adad9f
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/ShellView.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.HelloDialog/ShellViewModel.cs b/Samples/Stylet.Samples.HelloDialog/ShellViewModel.cs
new file mode 100644
index 0000000..a5ba9e2
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/ShellViewModel.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.HelloDialog
+{
+ public class ShellViewModel : Screen
+ {
+ private IWindowManager windowManager;
+ private IDialogFactory dialogFactory;
+
+ private string _nameString;
+ public string NameString
+ {
+ get { return this._nameString; }
+ set { SetAndNotify(ref _nameString, value); }
+ }
+
+ public ShellViewModel(IWindowManager windowManager, IDialogFactory dialogFactory)
+ {
+ this.DisplayName = "Hello Dialog";
+
+ this.windowManager = windowManager;
+ this.dialogFactory = dialogFactory;
+
+ this.NameString = "Click the button to show the dialog";
+ }
+
+ public void ShowDialog()
+ {
+ var dialogVm = this.dialogFactory.CreateDialog1();
+ if (this.windowManager.ShowDialog(dialogVm).GetValueOrDefault())
+ this.NameString = String.Format("Your name is {0}", dialogVm.Name);
+ else
+ this.NameString = "Dialog cancelled";
+ }
+ }
+
+ public interface IDialogFactory
+ {
+ Dialog1ViewModel CreateDialog1();
+ }
+}
diff --git a/Samples/Stylet.Samples.HelloDialog/Stylet.Samples.HelloDialog.csproj b/Samples/Stylet.Samples.HelloDialog/Stylet.Samples.HelloDialog.csproj
new file mode 100644
index 0000000..606c84f
--- /dev/null
+++ b/Samples/Stylet.Samples.HelloDialog/Stylet.Samples.HelloDialog.csproj
@@ -0,0 +1,113 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {F6DD6F38-40A3-4EC1-B342-0C2BCCF0DD44}
+ WinExe
+ Properties
+ Stylet.Samples.HelloDialog
+ Stylet.Samples.HelloDialog
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {2435bd00-ac12-48b0-ad36-9bab2fdec3f5}
+ Stylet
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.MasterDetail/App.config b/Samples/Stylet.Samples.MasterDetail/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.MasterDetail/App.xaml b/Samples/Stylet.Samples.MasterDetail/App.xaml
new file mode 100644
index 0000000..c48900c
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.MasterDetail/Bootstrapper.cs b/Samples/Stylet.Samples.MasterDetail/Bootstrapper.cs
new file mode 100644
index 0000000..4dbc01b
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Bootstrapper.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.MasterDetail
+{
+ public class Bootstrapper : Bootstrapper
+ {
+ }
+}
diff --git a/Samples/Stylet.Samples.MasterDetail/EmployeeModel.cs b/Samples/Stylet.Samples.MasterDetail/EmployeeModel.cs
new file mode 100644
index 0000000..d8f36b9
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/EmployeeModel.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.MasterDetail
+{
+ public class EmployeeModel
+ {
+ public string Name { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.MasterDetail/Properties/AssemblyInfo.cs b/Samples/Stylet.Samples.MasterDetail/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..36d8397
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Stylet.Samples.MasterDetail")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Stylet.Samples.MasterDetail")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stylet.Samples.MasterDetail/Properties/Resources.Designer.cs b/Samples/Stylet.Samples.MasterDetail/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..7e1f8d8
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.MasterDetail.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Stylet.Samples.MasterDetail.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.MasterDetail/Properties/Resources.resx b/Samples/Stylet.Samples.MasterDetail/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.MasterDetail/Properties/Settings.Designer.cs b/Samples/Stylet.Samples.MasterDetail/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..7c3053b
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.MasterDetail.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.MasterDetail/Properties/Settings.settings b/Samples/Stylet.Samples.MasterDetail/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.MasterDetail/ShellView.xaml b/Samples/Stylet.Samples.MasterDetail/ShellView.xaml
new file mode 100644
index 0000000..c4f1075
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/ShellView.xaml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+ Name:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.MasterDetail/ShellViewModel.cs b/Samples/Stylet.Samples.MasterDetail/ShellViewModel.cs
new file mode 100644
index 0000000..36730b3
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/ShellViewModel.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.MasterDetail
+{
+ public class ShellViewModel : Screen
+ {
+ public IObservableCollection Employees { get; private set; }
+
+ private EmployeeModel _selectedEmployee;
+ public EmployeeModel SelectedEmployee
+ {
+ get { return this._selectedEmployee; }
+ set { SetAndNotify(ref this._selectedEmployee, value) ;}
+ }
+
+ public ShellViewModel()
+ {
+ this.DisplayName = "Master-Detail";
+
+ this.Employees = new BindableCollection();
+
+ this.Employees.Add(new EmployeeModel() { Name = "Fred" });
+ this.Employees.Add(new EmployeeModel() { Name = "Bob" });
+
+ this.SelectedEmployee = this.Employees.FirstOrDefault();
+ }
+
+ public void AddEmployee()
+ {
+ this.Employees.Add(new EmployeeModel() { Name = "Unnamed" });
+ }
+
+ public void RemoveEmployee(EmployeeModel item)
+ {
+ this.Employees.Remove(item);
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.MasterDetail/Stylet.Samples.MasterDetail.csproj b/Samples/Stylet.Samples.MasterDetail/Stylet.Samples.MasterDetail.csproj
new file mode 100644
index 0000000..479e22f
--- /dev/null
+++ b/Samples/Stylet.Samples.MasterDetail/Stylet.Samples.MasterDetail.csproj
@@ -0,0 +1,105 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {A281DFF2-125E-4412-8927-0F09EEFC5AD1}
+ WinExe
+ Properties
+ Stylet.Samples.MasterDetail
+ Stylet.Samples.MasterDetail
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {2435bd00-ac12-48b0-ad36-9bab2fdec3f5}
+ Stylet
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.OverridingViewManager/App.config b/Samples/Stylet.Samples.OverridingViewManager/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.OverridingViewManager/App.xaml b/Samples/Stylet.Samples.OverridingViewManager/App.xaml
new file mode 100644
index 0000000..aa2422b
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Bootstrapper.cs b/Samples/Stylet.Samples.OverridingViewManager/Bootstrapper.cs
new file mode 100644
index 0000000..c0903fb
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Bootstrapper.cs
@@ -0,0 +1,19 @@
+using StyletIoC;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.OverridingViewManager
+{
+ public class Bootstrapper : Bootstrapper
+ {
+ protected override void ConfigureIoC(IStyletIoCBuilder builder)
+ {
+ base.ConfigureIoC(builder);
+
+ builder.Bind().To().InSingletonScope();
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.OverridingViewManager/CustomViewManager.cs b/Samples/Stylet.Samples.OverridingViewManager/CustomViewManager.cs
new file mode 100644
index 0000000..aee9912
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/CustomViewManager.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Stylet.Samples.OverridingViewManager
+{
+ [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
+ sealed class ViewModelAttribute : Attribute
+ {
+ readonly Type viewModel;
+
+ public ViewModelAttribute(Type viewModel)
+ {
+ this.viewModel = viewModel;
+ }
+
+ public Type ViewModel
+ {
+ get { return viewModel; }
+ }
+ }
+
+ public class CustomViewManager : ViewManager
+ {
+ // Dictionary of ViewModel type -> View type
+ private Dictionary viewModelToViewMapping;
+
+ public CustomViewManager()
+ {
+ var mappings = from type in AssemblySource.Assemblies.SelectMany(x => x.GetTypes())
+ let attributes = (ViewModelAttribute[])type.GetCustomAttributes(typeof(ViewModelAttribute), false)
+ where attributes.Length == 1 && typeof(UIElement).IsAssignableFrom(type)
+ select new { View = type, ViewModel = attributes[0].ViewModel };
+
+ this.viewModelToViewMapping = mappings.ToDictionary(x => x.ViewModel, x => x.View);
+ }
+
+ public override UIElement CreateViewForModel(object model)
+ {
+ Type viewType;
+ if (!this.viewModelToViewMapping.TryGetValue(model.GetType(), out viewType))
+ throw new Exception(String.Format("Could not find View for ViewModel {0}", model.GetType().Name));
+ return (UIElement)IoC.GetInstance(viewType, null);
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Properties/AssemblyInfo.cs b/Samples/Stylet.Samples.OverridingViewManager/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..2a6e1ec
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Stylet.Samples.OverridingViewManager")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Stylet.Samples.OverridingViewManager")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Properties/Resources.Designer.cs b/Samples/Stylet.Samples.OverridingViewManager/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..5c00f16
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.OverridingViewManager.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Stylet.Samples.OverridingViewManager.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Properties/Resources.resx b/Samples/Stylet.Samples.OverridingViewManager/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Properties/Settings.Designer.cs b/Samples/Stylet.Samples.OverridingViewManager/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..ea9af1f
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.OverridingViewManager.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Properties/Settings.settings b/Samples/Stylet.Samples.OverridingViewManager/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.OverridingViewManager/ShellView.xaml b/Samples/Stylet.Samples.OverridingViewManager/ShellView.xaml
new file mode 100644
index 0000000..6aff50f
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/ShellView.xaml
@@ -0,0 +1,8 @@
+
+
+ Hello, World
+
+
diff --git a/Samples/Stylet.Samples.OverridingViewManager/ShellView.xaml.cs b/Samples/Stylet.Samples.OverridingViewManager/ShellView.xaml.cs
new file mode 100644
index 0000000..5e5e80d
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/ShellView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Stylet.Samples.OverridingViewManager
+{
+ ///
+ /// Interaction logic for ShellView.xaml
+ ///
+ [ViewModel(typeof(ShellViewModel))]
+ public partial class ShellView : Window
+ {
+ public ShellView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.OverridingViewManager/ShellViewModel.cs b/Samples/Stylet.Samples.OverridingViewManager/ShellViewModel.cs
new file mode 100644
index 0000000..1b22c0b
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/ShellViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.OverridingViewManager
+{
+ public class ShellViewModel
+ {
+ }
+}
diff --git a/Samples/Stylet.Samples.OverridingViewManager/Stylet.Samples.OverridingViewManager.csproj b/Samples/Stylet.Samples.OverridingViewManager/Stylet.Samples.OverridingViewManager.csproj
new file mode 100644
index 0000000..5a51730
--- /dev/null
+++ b/Samples/Stylet.Samples.OverridingViewManager/Stylet.Samples.OverridingViewManager.csproj
@@ -0,0 +1,110 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {2F7D7EF3-730A-45E3-93CA-7C5031250246}
+ WinExe
+ Properties
+ Stylet.Samples.OverridingViewManager
+ Stylet.Samples.OverridingViewManager
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ShellView.xaml
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {2435bd00-ac12-48b0-ad36-9bab2fdec3f5}
+ Stylet
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.RedditBrowser/App.config b/Samples/Stylet.Samples.RedditBrowser/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.RedditBrowser/App.xaml b/Samples/Stylet.Samples.RedditBrowser/App.xaml
new file mode 100644
index 0000000..1e94178
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.RedditBrowser/Bootstrapper.cs b/Samples/Stylet.Samples.RedditBrowser/Bootstrapper.cs
new file mode 100644
index 0000000..e63514e
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Bootstrapper.cs
@@ -0,0 +1,22 @@
+using Stylet.Samples.RedditBrowser.Pages;
+using Stylet.Samples.RedditBrowser.RedditApi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser
+{
+ public class Bootstrapper : Bootstrapper
+ {
+ protected override void ConfigureIoC(StyletIoC.IStyletIoCBuilder builder)
+ {
+ base.ConfigureIoC(builder);
+
+ builder.Bind().To().InSingletonScope();
+ builder.Bind().ToAbstractFactory();
+ builder.Bind().ToAbstractFactory();
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Events/OpenSubredditEvent.cs b/Samples/Stylet.Samples.RedditBrowser/Events/OpenSubredditEvent.cs
new file mode 100644
index 0000000..d3aa2ea
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Events/OpenSubredditEvent.cs
@@ -0,0 +1,15 @@
+using Stylet.Samples.RedditBrowser.RedditApi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.Events
+{
+ public class OpenSubredditEvent
+ {
+ public string Subreddit { get; set; }
+ public SortMode SortMode { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/FodyWeavers.xml b/Samples/Stylet.Samples.RedditBrowser/FodyWeavers.xml
new file mode 100644
index 0000000..7369928
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/FodyWeavers.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/PostCommentsView.xaml b/Samples/Stylet.Samples.RedditBrowser/Pages/PostCommentsView.xaml
new file mode 100644
index 0000000..5f99960
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/PostCommentsView.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/PostCommentsViewModel.cs b/Samples/Stylet.Samples.RedditBrowser/Pages/PostCommentsViewModel.cs
new file mode 100644
index 0000000..cdfd08c
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/PostCommentsViewModel.cs
@@ -0,0 +1,33 @@
+using Stylet.Samples.RedditBrowser.RedditApi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.Pages
+{
+ public class PostCommentsViewModel : Screen
+ {
+ private IRedditClient client;
+
+ public string Subreddit { get; set; }
+ public string PostId36 { get; set; }
+ public CommentCollection CommentCollection { get; private set; }
+
+ public PostCommentsViewModel(IRedditClient client)
+ {
+ this.client = client;
+ }
+
+ protected override async void OnInitialActivate()
+ {
+ this.CommentCollection = await this.client.GetPostComments(this.Subreddit, this.PostId36);
+ }
+
+ public void GoBack()
+ {
+ this.TryClose();
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/PostsView.xaml b/Samples/Stylet.Samples.RedditBrowser/Pages/PostsView.xaml
new file mode 100644
index 0000000..9b49bad
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/PostsView.xaml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/PostsViewModel.cs b/Samples/Stylet.Samples.RedditBrowser/Pages/PostsViewModel.cs
new file mode 100644
index 0000000..3fd7da1
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/PostsViewModel.cs
@@ -0,0 +1,94 @@
+using Stylet.Samples.RedditBrowser.RedditApi;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.Pages
+{
+ public class PostsViewModel : Screen
+ {
+ public event EventHandler PostCommentsOpened;
+
+ private IRedditClient client;
+
+ public string Subreddit { get; set; }
+ public SortMode SortMode { get; set; }
+ public PostCollection PostCollection { get; private set; }
+ public Post SelectedPost { get; set; }
+
+ public PostsViewModel(IRedditClient client)
+ {
+ this.client = client;
+ }
+
+ protected override async void OnInitialActivate()
+ {
+ // Really un-advanced - just close
+ try
+ {
+ this.PostCollection = await this.client.GetPostsAsync(this.Subreddit, this.SortMode);
+ }
+ catch (Exception)
+ {
+ this.TryClose();
+ }
+ }
+
+ public void Close()
+ {
+ this.TryClose();
+ }
+
+ public bool CanNext
+ {
+ get { return this.PostCollection != null && this.PostCollection.HasNext; }
+ }
+ public async void Next()
+ {
+ this.PostCollection = await this.PostCollection.NextAsync();
+ }
+
+ public bool CanPrev
+ {
+ get { return this.PostCollection != null && this.PostCollection.HasPrev; }
+ }
+ public async void Prev()
+ {
+ this.PostCollection = await this.PostCollection.PrevAsync();
+ }
+
+ public bool CanOpenSelected
+ {
+ get { return this.SelectedPost != null; }
+ }
+ public void OpenSelected()
+ {
+ if (this.SelectedPost == null)
+ return;
+
+ Process.Start(this.SelectedPost.LinkUrl);
+ }
+
+ public bool CanOpenSelectedComments
+ {
+ get { return this.SelectedPost != null && this.SelectedPost.NumComments > 0; }
+ }
+ public void OpenSelectedComments()
+ {
+ if (this.SelectedPost == null)
+ return;
+
+ var handler = this.PostCommentsOpened;
+ if (handler != null)
+ handler(this, new PostCommentsOpenedEventArgs() { PostId36 = this.SelectedPost.Id36 });
+ }
+ }
+
+ public class PostCommentsOpenedEventArgs : EventArgs
+ {
+ public string PostId36 { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/ShellView.xaml b/Samples/Stylet.Samples.RedditBrowser/Pages/ShellView.xaml
new file mode 100644
index 0000000..996c9fe
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/ShellView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/ShellViewModel.cs b/Samples/Stylet.Samples.RedditBrowser/Pages/ShellViewModel.cs
new file mode 100644
index 0000000..898a19c
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/ShellViewModel.cs
@@ -0,0 +1,39 @@
+using Stylet.Samples.RedditBrowser.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.Pages
+{
+ public class ShellViewModel : Conductor.Collections.OneActive, IHandle
+ {
+ private ISubredditViewModelFactory subredditViewModelFactory;
+
+ public TaskbarViewModel Taskbar { get; private set; }
+
+ public ShellViewModel(IEventAggregator events, TaskbarViewModel taskbarViewModel, ISubredditViewModelFactory subredditViewModelFactory)
+ {
+ this.DisplayName = "Reddit Browser";
+
+ this.Taskbar = taskbarViewModel;
+ this.subredditViewModelFactory = subredditViewModelFactory;
+
+ events.Subscribe(this);
+ }
+
+ public void Handle(OpenSubredditEvent message)
+ {
+ var item = this.subredditViewModelFactory.CreateSubredditViewModel();
+ item.Subreddit = message.Subreddit;
+ item.SortMode = message.SortMode;
+ this.ActivateItem(item);
+ }
+ }
+
+ public interface ISubredditViewModelFactory
+ {
+ SubredditViewModel CreateSubredditViewModel();
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/SubredditView.xaml b/Samples/Stylet.Samples.RedditBrowser/Pages/SubredditView.xaml
new file mode 100644
index 0000000..da432ac
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/SubredditView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/SubredditViewModel.cs b/Samples/Stylet.Samples.RedditBrowser/Pages/SubredditViewModel.cs
new file mode 100644
index 0000000..5a2a2d3
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/SubredditViewModel.cs
@@ -0,0 +1,48 @@
+using Stylet.Samples.RedditBrowser.RedditApi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.Pages
+{
+ public class SubredditViewModel : Conductor.Collections.Navigation
+ {
+ private IPostCommentsViewModelFactory postCommentsViewModelFactory;
+
+ public string Subreddit { get; set; }
+ public SortMode SortMode { get; set; }
+ private PostsViewModel posts;
+
+ public SubredditViewModel(PostsViewModel posts, IPostCommentsViewModelFactory postCommentsViewModelFactory)
+ {
+ this.posts = posts;
+ this.postCommentsViewModelFactory = postCommentsViewModelFactory;
+
+ this.posts.PostCommentsOpened += (o, e) => this.OpenPostCommands(e.PostId36);
+ this.posts.Closed += (o, e) => this.TryClose();
+ }
+
+ protected override void OnInitialActivate()
+ {
+ this.DisplayName = String.Format("/r/{0}", this.Subreddit);
+ this.posts.Subreddit = this.Subreddit;
+ this.posts.SortMode = this.SortMode;
+
+ this.ActivateItem(this.posts);
+ }
+
+ private void OpenPostCommands(string postId36)
+ {
+ var item = this.postCommentsViewModelFactory.CreatePostCommentsViewModel();
+ item.PostId36 = postId36;
+ this.ActivateItem(item);
+ }
+ }
+
+ public interface IPostCommentsViewModelFactory
+ {
+ PostCommentsViewModel CreatePostCommentsViewModel();
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/TaskbarView.xaml b/Samples/Stylet.Samples.RedditBrowser/Pages/TaskbarView.xaml
new file mode 100644
index 0000000..d2b5cf9
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/TaskbarView.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.RedditBrowser/Pages/TaskbarViewModel.cs b/Samples/Stylet.Samples.RedditBrowser/Pages/TaskbarViewModel.cs
new file mode 100644
index 0000000..2d9ca0b
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Pages/TaskbarViewModel.cs
@@ -0,0 +1,32 @@
+using Stylet.Samples.RedditBrowser.Events;
+using Stylet.Samples.RedditBrowser.RedditApi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.Pages
+{
+ public class TaskbarViewModel : Screen
+ {
+ private IEventAggregator events;
+
+ public string Subreddit { get; set; }
+
+ public IEnumerable SortModes { get; private set; }
+ public SortMode SelectedSortMode { get; set; }
+
+ public TaskbarViewModel(IEventAggregator events)
+ {
+ this.events = events;
+ this.SortModes = SortMode.AllModes;
+ this.SelectedSortMode = SortMode.Hot;
+ }
+
+ public void Open()
+ {
+ this.events.Publish(new OpenSubredditEvent() { Subreddit = this.Subreddit, SortMode = this.SelectedSortMode });
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Properties/AssemblyInfo.cs b/Samples/Stylet.Samples.RedditBrowser/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bf98775
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Stylet.Samples.RedditBrowser")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Stylet.Samples.RedditBrowser")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stylet.Samples.RedditBrowser/Properties/Resources.Designer.cs b/Samples/Stylet.Samples.RedditBrowser/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..d6a0645
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.RedditBrowser.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Stylet.Samples.RedditBrowser.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Properties/Resources.resx b/Samples/Stylet.Samples.RedditBrowser/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.RedditBrowser/Properties/Settings.Designer.cs b/Samples/Stylet.Samples.RedditBrowser/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..38e51b5
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.RedditBrowser.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Properties/Settings.settings b/Samples/Stylet.Samples.RedditBrowser/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.RedditBrowser/RedditApi/CommentCollection.cs b/Samples/Stylet.Samples.RedditBrowser/RedditApi/CommentCollection.cs
new file mode 100644
index 0000000..0695756
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/RedditApi/CommentCollection.cs
@@ -0,0 +1,51 @@
+using Spring.Rest.Client;
+using Stylet.Samples.RedditBrowser.RedditApi.Contracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.RedditApi
+{
+ public class CommentCollection
+ {
+ private RestTemplate template;
+ private string subreddit;
+ private string postId;
+
+ public IReadOnlyList Comments { get; private set; }
+
+ public CommentCollection(RestTemplate template, string subreddit, string postId)
+ {
+ this.template = template;
+ this.subreddit = subreddit;
+ this.postId = postId;
+ }
+
+ public async Task LoadAsync()
+ {
+ var comments = await this.template.GetForObjectAsync>("/r/{subreddit}/comments/{postid}.json", this.subreddit, this.postId);
+ this.Comments = comments.SelectMany(x => x.Data.Children).Where(x => x.Kind == "t1").Select(x => this.ContractToComment(x.Data)).ToList();
+ }
+
+ private Comment ContractToComment(CommentData data)
+ {
+ var comment = new Comment()
+ {
+ Body = data.Body,
+ Author = data.Author
+ };
+ if (data.Replies != null && data.Replies.Data != null)
+ comment.Replies = data.Replies.Data.Children.Select(x => this.ContractToComment(x.Data)).ToList();
+ return comment;
+ }
+ }
+
+ public class Comment
+ {
+ public string Body { get; set; }
+ public string Author { get; set; }
+ public List Replies { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/RedditApi/Contracts/CommentsResponse.cs b/Samples/Stylet.Samples.RedditBrowser/RedditApi/Contracts/CommentsResponse.cs
new file mode 100644
index 0000000..edf8e52
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/RedditApi/Contracts/CommentsResponse.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.RedditApi.Contracts
+{
+ [DataContract]
+ public class CommentsResponse
+ {
+ [DataMember(Name = "kind")]
+ public string Kind { get; set; }
+
+ [DataMember(Name = "data")]
+ public CommentsResponseData Data { get; set; }
+ }
+
+ [DataContract]
+ public class CommentsResponseData
+ {
+ [DataMember(Name = "before")]
+ public string Before { get; set; }
+
+ [DataMember(Name = "after")]
+ public string After { get; set; }
+
+ [DataMember(Name = "children")]
+ public List Children { get; set; }
+ }
+
+ [DataContract]
+ public class CommentListing
+ {
+ [DataMember(Name = "kind")]
+ public string Kind { get; set; }
+
+ [DataMember(Name = "data")]
+ public CommentData Data { get; set; }
+ }
+
+ [DataContract]
+ public class CommentData
+ {
+ [DataMember(Name = "body")]
+ public string Body { get; set; }
+
+ [DataMember(Name = "replies")]
+ public CommentsResponse Replies { get; set; }
+
+ [DataMember(Name = "author")]
+ public string Author { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/RedditApi/Contracts/PostsResponse.cs b/Samples/Stylet.Samples.RedditBrowser/RedditApi/Contracts/PostsResponse.cs
new file mode 100644
index 0000000..2fc3f69
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/RedditApi/Contracts/PostsResponse.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.RedditApi.Contracts
+{
+ [DataContract]
+ public class PostsResponse
+ {
+ [DataMember(Name = "data")]
+ public PostsResponseData Data { get; set; }
+ }
+
+ [DataContract]
+ public class PostsResponseData
+ {
+ [DataMember(Name = "before")]
+ public string Before { get; set; }
+
+ [DataMember(Name = "after")]
+ public string After { get; set; }
+
+ [DataMember(Name = "children")]
+ public List Children { get; set; }
+ }
+
+ [DataContract]
+ public class Post
+ {
+ [DataMember(Name = "data")]
+ public PostData Data { get; set; }
+ }
+
+ [DataContract]
+ public class PostData
+ {
+ [DataMember(Name = "title")]
+ public string Title { get; set; }
+
+ [DataMember(Name = "url")]
+ public string Url { get; set; }
+
+ [DataMember(Name = "id")]
+ public string Id { get; set; }
+
+ [DataMember(Name = "num_comments")]
+ public int NumComments { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/RedditApi/PostCollection.cs b/Samples/Stylet.Samples.RedditBrowser/RedditApi/PostCollection.cs
new file mode 100644
index 0000000..0a3f5c8
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/RedditApi/PostCollection.cs
@@ -0,0 +1,89 @@
+using Spring.Rest.Client;
+using Stylet.Samples.RedditBrowser.RedditApi.Contracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.RedditApi
+{
+ public class PostCollection
+ {
+ private RestTemplate template;
+ private string subreddit;
+ private string sortMode;
+ private string after;
+ private string before;
+ ///
+ /// The number of items we've seen in this listing, *INCLUDING* the current posts
+ ///
+ private int count;
+
+ public IReadOnlyList Posts { get; private set; }
+
+ public bool HasNext
+ {
+ get { return this.after != null; }
+ }
+ public bool HasPrev
+ {
+ get { return this.before != null; }
+ }
+
+ public PostCollection(RestTemplate template, string subreddit, string sortMode)
+ : this(template, subreddit, sortMode, 0) { }
+
+ private PostCollection(RestTemplate template, string subreddit, string sortMode, int count)
+ {
+ this.template = template;
+ this.subreddit = subreddit;
+ this.sortMode = sortMode;
+ this.count = count;
+ }
+
+ public async Task LoadAsync()
+ {
+ var posts = await this.template.GetForObjectAsync("/r/{subreddit}/{mode}.json", this.subreddit, this.sortMode);
+ this.LoadPostsResponse(posts);
+ this.count = this.Posts.Count;
+ }
+
+ private void LoadPostsResponse(PostsResponse posts)
+ {
+ this.Posts = posts.Data.Children.Select(x => new Post()
+ {
+ Title = x.Data.Title,
+ LinkUrl = x.Data.Url,
+ Id36 = x.Data.Id,
+ NumComments = x.Data.NumComments,
+ }).ToList();
+ this.after = posts.Data.After;
+ this.before = posts.Data.Before;
+ }
+
+ public async Task NextAsync()
+ {
+ var posts = await this.template.GetForObjectAsync("/r/{subreddit}/{mode}.json?after={after}&count={count}", this.subreddit, this.sortMode, this.after, this.count);
+ var result = new PostCollection(this.template, this.subreddit, this.sortMode, this.count + posts.Data.Children.Count);
+ result.LoadPostsResponse(posts);
+ return result;
+ }
+
+ public async Task PrevAsync()
+ {
+ var posts = await this.template.GetForObjectAsync("/r/{subreddit}/{mode}.json?before={before}&count={count}", this.subreddit, this.sortMode, this.before, this.count + 1 - this.Posts.Count);
+ var result = new PostCollection(this.template, this.subreddit, this.sortMode, this.count - posts.Data.Children.Count);
+ result.LoadPostsResponse(posts);
+ return result;
+ }
+ }
+
+ public class Post
+ {
+ public string Title { get; set; }
+ public string LinkUrl { get; set; }
+ public string Id36 { get; set; }
+ public int NumComments { get; set; }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/RedditApi/RedditClient.cs b/Samples/Stylet.Samples.RedditBrowser/RedditApi/RedditClient.cs
new file mode 100644
index 0000000..437f4cb
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/RedditApi/RedditClient.cs
@@ -0,0 +1,62 @@
+using Spring.Http.Converters.Json;
+using Spring.Rest.Client;
+using Stylet.Samples.RedditBrowser.RedditApi.Contracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.RedditBrowser.RedditApi
+{
+ public interface IRedditClient
+ {
+ Task GetPostsAsync(string subreddit, SortMode sortMode);
+ Task GetPostComments(string subreddit, string postId36);
+ }
+
+ public class RedditClient : IRedditClient
+ {
+ private RestTemplate template;
+
+ public RedditClient()
+ {
+ this.template = new RestTemplate("http://reddit.com");
+ template.MessageConverters.Add(new DataContractJsonHttpMessageConverter());
+ }
+
+ public async Task GetPostsAsync(string subreddit, SortMode sortMode)
+ {
+ var postCollection = new PostCollection(this.template, subreddit, sortMode.Mode);
+ await postCollection.LoadAsync();
+ return postCollection;
+ }
+
+ public async Task GetPostComments(string subreddit, string postId36)
+ {
+ var commentCollection = new CommentCollection(this.template, subreddit, postId36);
+ await commentCollection.LoadAsync();
+ return commentCollection;
+ }
+ }
+
+ public struct SortMode
+ {
+ public static SortMode New = new SortMode("new", "New");
+ public static SortMode Hot = new SortMode("hot", "Hot");
+ public static SortMode Top = new SortMode("top", "Top");
+
+ public static IEnumerable AllModes
+ {
+ get { return new[] { New, Hot, Top }; }
+ }
+
+ public string Name { get; private set; }
+ public string Mode { get; private set; }
+ private SortMode(string mode, string name) : this()
+ {
+ this.Mode = mode;
+ this.Name = name;
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/Stylet.Samples.RedditBrowser.csproj b/Samples/Stylet.Samples.RedditBrowser/Stylet.Samples.RedditBrowser.csproj
new file mode 100644
index 0000000..89290f1
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/Stylet.Samples.RedditBrowser.csproj
@@ -0,0 +1,160 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {72B1C6E4-1293-47DD-BEFD-FA2E782BDBDA}
+ WinExe
+ Properties
+ Stylet.Samples.RedditBrowser
+ Stylet.Samples.RedditBrowser
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ ..\
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll
+
+
+ ..\packages\PropertyChanged.Fody.1.48.0.0\Lib\NET35\PropertyChanged.dll
+ False
+
+
+ False
+ ..\packages\Spring.Rest.1.1.1\lib\net40-client\Spring.Rest.dll
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {2435bd00-ac12-48b0-ad36-9bab2fdec3f5}
+ Stylet
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.RedditBrowser/UserControls/StretchingTreeView.cs b/Samples/Stylet.Samples.RedditBrowser/UserControls/StretchingTreeView.cs
new file mode 100644
index 0000000..6d701ec
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/UserControls/StretchingTreeView.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+
+namespace Stylet.Samples.RedditBrowser.UserControls
+{
+ // http://blogs.msdn.com/b/jpricket/archive/2008/08/05/wpf-a-stretching-treeview.aspx
+ public class StretchingTreeView : TreeView
+ {
+ protected override DependencyObject GetContainerForItemOverride()
+ {
+ return new StretchingTreeViewItem();
+ }
+
+ protected override bool IsItemItsOwnContainerOverride(object item)
+ {
+ return item is StretchingTreeViewItem;
+ }
+ }
+
+ public class StretchingTreeViewItem : TreeViewItem
+ {
+ public StretchingTreeViewItem()
+ {
+ this.Loaded += new RoutedEventHandler(StretchingTreeViewItem_Loaded);
+ }
+
+ private void StretchingTreeViewItem_Loaded(object sender, RoutedEventArgs e)
+ {
+ // The purpose of this code is to stretch the Header Content all the way accross the TreeView.
+ if (this.VisualChildrenCount > 0)
+ {
+ Grid grid = this.GetVisualChild(0) as Grid;
+ if (grid != null && grid.ColumnDefinitions.Count == 3)
+ {
+ // Remove the middle column which is set to Auto and let it get replaced with the
+ // last column that is set to Star.
+ grid.ColumnDefinitions.RemoveAt(1);
+ }
+ }
+ }
+
+ protected override DependencyObject GetContainerForItemOverride()
+ {
+ return new StretchingTreeViewItem();
+ }
+
+ protected override bool IsItemItsOwnContainerOverride(object item)
+ {
+ return item is StretchingTreeViewItem;
+ }
+
+ // http://stackoverflow.com/a/2957734/1086121
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ if (Template != null)
+ {
+ var btn = Template.FindName("Expander", this) as ToggleButton;
+ if (btn != null)
+ btn.VerticalAlignment = this.ToggleButtonVerticalAlignment;
+ }
+ }
+
+
+
+ public VerticalAlignment ToggleButtonVerticalAlignment
+ {
+ get { return (VerticalAlignment)GetValue(ToggleButtonVerticalAlignmentProperty); }
+ set { SetValue(ToggleButtonVerticalAlignmentProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for ToggleButtonVerticalAlignment. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty ToggleButtonVerticalAlignmentProperty =
+ DependencyProperty.Register("ToggleButtonVerticalAlignment", typeof(VerticalAlignment), typeof(StretchingTreeViewItem), new PropertyMetadata(VerticalAlignment.Center));
+
+
+ }
+}
diff --git a/Samples/Stylet.Samples.RedditBrowser/packages.config b/Samples/Stylet.Samples.RedditBrowser/packages.config
new file mode 100644
index 0000000..db9cc43
--- /dev/null
+++ b/Samples/Stylet.Samples.RedditBrowser/packages.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.TabNavigation/App.config b/Samples/Stylet.Samples.TabNavigation/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.TabNavigation/App.xaml b/Samples/Stylet.Samples.TabNavigation/App.xaml
new file mode 100644
index 0000000..69c10b6
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.TabNavigation/Bootstrapper.cs b/Samples/Stylet.Samples.TabNavigation/Bootstrapper.cs
new file mode 100644
index 0000000..d8255b4
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Bootstrapper.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Stylet.Samples.TabNavigation
+{
+ class Bootstrapper : Bootstrapper
+ {
+ }
+}
diff --git a/Samples/Stylet.Samples.TabNavigation/Page1View.xaml b/Samples/Stylet.Samples.TabNavigation/Page1View.xaml
new file mode 100644
index 0000000..1f6e742
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Page1View.xaml
@@ -0,0 +1,11 @@
+
+
+ This is page 1
+
+
diff --git a/Samples/Stylet.Samples.TabNavigation/Page1ViewModel.cs b/Samples/Stylet.Samples.TabNavigation/Page1ViewModel.cs
new file mode 100644
index 0000000..54e3476
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Page1ViewModel.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.TabNavigation
+{
+ class Page1ViewModel : Screen
+ {
+ public Page1ViewModel()
+ {
+ this.DisplayName = "Page 1";
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.TabNavigation/Page2View.xaml b/Samples/Stylet.Samples.TabNavigation/Page2View.xaml
new file mode 100644
index 0000000..3ad7ed0
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Page2View.xaml
@@ -0,0 +1,11 @@
+
+
+ This is page 2
+
+
diff --git a/Samples/Stylet.Samples.TabNavigation/Page2ViewModel.cs b/Samples/Stylet.Samples.TabNavigation/Page2ViewModel.cs
new file mode 100644
index 0000000..8f81b44
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Page2ViewModel.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.TabNavigation
+{
+ class Page2ViewModel : Screen
+ {
+ public Page2ViewModel()
+ {
+ this.DisplayName = "Page 2";
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.TabNavigation/Properties/AssemblyInfo.cs b/Samples/Stylet.Samples.TabNavigation/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1ed4031
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Stylet.Samples.TabNavigation")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Stylet.Samples.TabNavigation")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stylet.Samples.TabNavigation/Properties/Resources.Designer.cs b/Samples/Stylet.Samples.TabNavigation/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..36865ca
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.TabNavigation.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Stylet.Samples.TabNavigation.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.TabNavigation/Properties/Resources.resx b/Samples/Stylet.Samples.TabNavigation/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.TabNavigation/Properties/Settings.Designer.cs b/Samples/Stylet.Samples.TabNavigation/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..02f7865
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18444
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Stylet.Samples.TabNavigation.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.TabNavigation/Properties/Settings.settings b/Samples/Stylet.Samples.TabNavigation/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.TabNavigation/ShellView.xaml b/Samples/Stylet.Samples.TabNavigation/ShellView.xaml
new file mode 100644
index 0000000..63cf5af
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/ShellView.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Samples/Stylet.Samples.TabNavigation/ShellViewModel.cs b/Samples/Stylet.Samples.TabNavigation/ShellViewModel.cs
new file mode 100644
index 0000000..619f43e
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/ShellViewModel.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet.Samples.TabNavigation
+{
+ class ShellViewModel : Conductor.Collections.OneActive
+ {
+ public ShellViewModel(Page1ViewModel page1, Page2ViewModel page2)
+ {
+ this.ActivateItem(page1);
+ this.Items.Add(page2);
+ }
+ }
+}
diff --git a/Samples/Stylet.Samples.TabNavigation/Stylet.Samples.TabNavigation.csproj b/Samples/Stylet.Samples.TabNavigation/Stylet.Samples.TabNavigation.csproj
new file mode 100644
index 0000000..0b910b0
--- /dev/null
+++ b/Samples/Stylet.Samples.TabNavigation/Stylet.Samples.TabNavigation.csproj
@@ -0,0 +1,116 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {9A4E2DAD-AE68-4A82-8FA8-407DB74D6FBE}
+ WinExe
+ Properties
+ Stylet.Samples.TabNavigation
+ Stylet.Samples.TabNavigation
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {2435bd00-ac12-48b0-ad36-9bab2fdec3f5}
+ Stylet
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stylet.Samples.sln b/Samples/Stylet.Samples.sln
new file mode 100644
index 0000000..77cd578
--- /dev/null
+++ b/Samples/Stylet.Samples.sln
@@ -0,0 +1,65 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30110.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet", "..\Stylet\Stylet.csproj", "{2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.Hello", "Stylet.Samples.Hello\Stylet.Samples.Hello.csproj", "{6C7FBB21-52AC-4333-A42A-9F5E9D048621}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.TabNavigation", "Stylet.Samples.TabNavigation\Stylet.Samples.TabNavigation.csproj", "{9A4E2DAD-AE68-4A82-8FA8-407DB74D6FBE}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.MasterDetail", "Stylet.Samples.MasterDetail\Stylet.Samples.MasterDetail.csproj", "{A281DFF2-125E-4412-8927-0F09EEFC5AD1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.HelloDialog", "Stylet.Samples.HelloDialog\Stylet.Samples.HelloDialog.csproj", "{F6DD6F38-40A3-4EC1-B342-0C2BCCF0DD44}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.OverridingViewManager", "Stylet.Samples.OverridingViewManager\Stylet.Samples.OverridingViewManager.csproj", "{2F7D7EF3-730A-45E3-93CA-7C5031250246}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.RedditBrowser", "Stylet.Samples.RedditBrowser\Stylet.Samples.RedditBrowser.csproj", "{72B1C6E4-1293-47DD-BEFD-FA2E782BDBDA}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{C3BAC068-E2C0-4470-9F2E-A1711299BFAE}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6C7FBB21-52AC-4333-A42A-9F5E9D048621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6C7FBB21-52AC-4333-A42A-9F5E9D048621}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6C7FBB21-52AC-4333-A42A-9F5E9D048621}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6C7FBB21-52AC-4333-A42A-9F5E9D048621}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9A4E2DAD-AE68-4A82-8FA8-407DB74D6FBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9A4E2DAD-AE68-4A82-8FA8-407DB74D6FBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9A4E2DAD-AE68-4A82-8FA8-407DB74D6FBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9A4E2DAD-AE68-4A82-8FA8-407DB74D6FBE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A281DFF2-125E-4412-8927-0F09EEFC5AD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A281DFF2-125E-4412-8927-0F09EEFC5AD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A281DFF2-125E-4412-8927-0F09EEFC5AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A281DFF2-125E-4412-8927-0F09EEFC5AD1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F6DD6F38-40A3-4EC1-B342-0C2BCCF0DD44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F6DD6F38-40A3-4EC1-B342-0C2BCCF0DD44}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F6DD6F38-40A3-4EC1-B342-0C2BCCF0DD44}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F6DD6F38-40A3-4EC1-B342-0C2BCCF0DD44}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2F7D7EF3-730A-45E3-93CA-7C5031250246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2F7D7EF3-730A-45E3-93CA-7C5031250246}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2F7D7EF3-730A-45E3-93CA-7C5031250246}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2F7D7EF3-730A-45E3-93CA-7C5031250246}.Release|Any CPU.Build.0 = Release|Any CPU
+ {72B1C6E4-1293-47DD-BEFD-FA2E782BDBDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {72B1C6E4-1293-47DD-BEFD-FA2E782BDBDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {72B1C6E4-1293-47DD-BEFD-FA2E782BDBDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {72B1C6E4-1293-47DD-BEFD-FA2E782BDBDA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Stylet.sln b/Stylet.sln
new file mode 100644
index 0000000..96f4ca5
--- /dev/null
+++ b/Stylet.sln
@@ -0,0 +1,41 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30110.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet", "Stylet\Stylet.csproj", "{2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StyletUnitTests", "StyletUnitTests\StyletUnitTests.csproj", "{13AFA20D-CCEA-4A58-920E-4D8816C7296B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{AE3462E7-25F5-4BC8-933A-5D51393E9819}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StyletIntegrationTests", "StyletIntegrationTests\StyletIntegrationTests.csproj", "{C6021258-7CAE-4BC2-A08E-8433019405B7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2435BD00-AC12-48B0-AD36-9BAB2FDEC3F5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {13AFA20D-CCEA-4A58-920E-4D8816C7296B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {13AFA20D-CCEA-4A58-920E-4D8816C7296B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {13AFA20D-CCEA-4A58-920E-4D8816C7296B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {13AFA20D-CCEA-4A58-920E-4D8816C7296B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C6021258-7CAE-4BC2-A08E-8433019405B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C6021258-7CAE-4BC2-A08E-8433019405B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C6021258-7CAE-4BC2-A08E-8433019405B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C6021258-7CAE-4BC2-A08E-8433019405B7}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Stylet/AssemblySource.cs b/Stylet/AssemblySource.cs
new file mode 100644
index 0000000..d1b975a
--- /dev/null
+++ b/Stylet/AssemblySource.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet
+{
+ ///
+ /// Container for the list of assemblies in which Stylet will look for types
+ ///
+ public static class AssemblySource
+ {
+ ///
+ /// List of assemblies in which Stylet will look for types, (for autobinding in StyletIoC, and for finding Views).
+ /// Populated by the Bootstrapper
+ ///
+ public static readonly IObservableCollection Assemblies = new BindableCollection();
+ }
+}
diff --git a/Stylet/BindableCollection.cs b/Stylet/BindableCollection.cs
new file mode 100644
index 0000000..72f4295
--- /dev/null
+++ b/Stylet/BindableCollection.cs
@@ -0,0 +1,120 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Stylet
+{
+ ///
+ /// Represents a collection which is observasble
+ ///
+ ///
+ public interface IObservableCollection : IList, INotifyPropertyChanged, INotifyCollectionChanged, INotifyPropertyChangedDispatcher
+ {
+ ///
+ /// Add a range of items
+ ///
+ /// Items to add
+ void AddRange(IEnumerable items);
+
+ ///
+ /// Remove a range of items
+ ///
+ /// Items to remove
+ void RemoveRange(IEnumerable items);
+ }
+
+ ///
+ /// ObservableCollection subclass which supports AddRange and RemoveRange
+ ///
+ ///
+ public class BindableCollection : ObservableCollection, IObservableCollection
+ {
+ private Action _propertyChangedDispatcher = Execute.DefaultPropertyChangedDispatcher;
+ ///
+ /// Dispatcher to use when firing events. Defaults to Execute.DefaultPropertyChangedDispatcher
+ ///
+ public Action PropertyChangedDispatcher
+ {
+ get { return this._propertyChangedDispatcher; }
+ set { this._propertyChangedDispatcher = value; }
+ }
+
+ ///
+ /// We have to disable notifications when adding individual elements in the AddRange and RemoveRange implementations
+ ///
+ private bool isNotifying = true;
+
+ public BindableCollection() : base() { }
+ public BindableCollection(IEnumerable collection) : base(collection) { }
+
+ protected override void OnPropertyChanged(PropertyChangedEventArgs e)
+ {
+ if (this.isNotifying)
+ this.PropertyChangedDispatcher(() => base.OnPropertyChanged(e));
+ }
+
+ protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
+ {
+ if (this.isNotifying)
+ this.PropertyChangedDispatcher(() => base.OnCollectionChanged(e));
+ }
+
+ ///
+ /// Add a range of items
+ ///
+ /// Items to add
+ public virtual void AddRange(IEnumerable items)
+ {
+ var previousNotificationSetting = this.isNotifying;
+ this.isNotifying = false;
+ var index = Count;
+ foreach (var item in items)
+ {
+ this.InsertItem(index, item);
+ index++;
+ }
+ this.isNotifying = previousNotificationSetting;
+ this.OnPropertyChanged(new PropertyChangedEventArgs("Count"));
+ this.OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+ this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items.ToList()));
+ }
+
+ ///
+ /// Remove a range of items
+ ///
+ /// Items to remove
+ public virtual void RemoveRange(IEnumerable items)
+ {
+ var previousNotificationSetting = this.isNotifying;
+ this.isNotifying = false;
+ foreach (var item in items)
+ {
+ var index = IndexOf(item);
+ if (index >= 0)
+ {
+ this.RemoveItem(index);
+ }
+ }
+ this.isNotifying = previousNotificationSetting;
+ this.OnPropertyChanged(new PropertyChangedEventArgs("Count"));
+ this.OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+ this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, items.ToList()));
+ }
+
+ ///
+ /// Raise a change notification indicating that all bindings should be refreshed
+ ///
+ public void Refresh()
+ {
+ this.OnPropertyChanged(new PropertyChangedEventArgs("Count"));
+ this.OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+ this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ }
+ }
+}
diff --git a/Stylet/Bootstrapper.cs b/Stylet/Bootstrapper.cs
new file mode 100644
index 0000000..ef21652
--- /dev/null
+++ b/Stylet/Bootstrapper.cs
@@ -0,0 +1,82 @@
+using StyletIoC;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Stylet
+{
+ ///
+ /// Bootstrapper to be extended by any application which wants to use StyletIoC (the default)
+ ///
+ /// Type of the root ViewModel. This will be instantiated and displayed
+ public class Bootstrapper : BootstrapperBase where TRootViewModel : class
+ {
+ ///
+ /// IoC container. This is created after ConfigureIoC has been run.
+ ///
+ protected IContainer container;
+
+ ///
+ /// Called from the constructor, this does everything necessary to start the application, including set up StyletIoC
+ ///
+ protected override void Start()
+ {
+ base.Start();
+
+ var builder = new StyletIoCBuilder();
+
+ this.DefaultConfigureIoC(builder);
+ this.ConfigureIoC(builder);
+
+ this.container = builder.BuildContainer();
+ }
+
+ ///
+ /// Carries out default configuration of StyletIoC. Override if you don't want to do this
+ ///
+ /// StyletIoC builder to use to configure the container
+ protected virtual void DefaultConfigureIoC(StyletIoCBuilder builder)
+ {
+ // Mark these as auto-bindings, so the user can replace them if they want
+ builder.BindWeak(typeof(IWindowManager)).To().InSingletonScope();
+ builder.BindWeak(typeof(IEventAggregator)).To().InSingletonScope();
+ builder.BindWeak(typeof(IViewManager)).To().InSingletonScope();
+
+ builder.Autobind(AssemblySource.Assemblies);
+ }
+
+ ///
+ /// Override to add your own types to the IoC container.
+ ///
+ /// StyletIoC builder to use to configure the container
+ protected virtual void ConfigureIoC(IStyletIoCBuilder builder) { }
+
+ ///
+ /// Override which uses StyletIoC as the implementation for IoC.Get
+ ///
+ protected override object GetInstance(Type service, string key = null)
+ {
+ return this.container.Get(service, key);
+ }
+
+ ///
+ /// Override which uses StyletIoC as the implementation for IoC.GetAll
+ ///
+ protected override IEnumerable