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..7b3eccf --- /dev/null +++ b/Samples/Stylet.Samples.HelloDialog/App.xaml @@ -0,0 +1,12 @@ + + + + + + + + + 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..9f6b139 --- /dev/null +++ b/Samples/Stylet.Samples.HelloDialog/Dialog1View.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Samples/Stylet.Samples.HelloDialog/Dialog1ViewModel.cs b/Samples/Stylet.Samples.HelloDialog/Dialog1ViewModel.cs new file mode 100644 index 0000000..fc0783f --- /dev/null +++ b/Samples/Stylet.Samples.HelloDialog/Dialog1ViewModel.cs @@ -0,0 +1,16 @@ +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 Dialog1ViewModel() + { + this.DisplayName = "I'm Dialog 1"; + } + } +} 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..b7ac1ef --- /dev/null +++ b/Samples/Stylet.Samples.HelloDialog/ShellView.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Samples/Stylet.Samples.HelloDialog/ShellViewModel.cs b/Samples/Stylet.Samples.HelloDialog/ShellViewModel.cs new file mode 100644 index 0000000..e06961a --- /dev/null +++ b/Samples/Stylet.Samples.HelloDialog/ShellViewModel.cs @@ -0,0 +1,33 @@ +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; + + public ShellViewModel(IWindowManager windowManager, IDialogFactory dialogFactory) + { + this.DisplayName = "Hello Dialog"; + + this.windowManager = windowManager; + this.dialogFactory = dialogFactory; + } + + public void ShowDialog() + { + var dialogVm = this.dialogFactory.CreateDialog1(); + this.windowManager.ShowDialog(dialogVm); + } + } + + 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.sln b/Samples/Stylet.Samples.sln index a193197..5650adf 100644 --- a/Samples/Stylet.Samples.sln +++ b/Samples/Stylet.Samples.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stylet.Samples.TabNavigatio 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 Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE