From 85be6b25f70bdc5f7cdec3987270923438b34889 Mon Sep 17 00:00:00 2001 From: Damien Chaib Date: Sun, 29 Dec 2013 19:01:56 +0100 Subject: [PATCH 1/3] SimpleNavigation sample with Caliburn.Micro only --- samples/SimpleNavigation/SimpleNavigation.sln | 22 +++ .../SimpleNavigation/App.config | 6 + .../SimpleNavigation/App.xaml | 14 ++ .../SimpleNavigation/App.xaml.cs | 17 +++ .../SimpleNavigation/AppBootstrapper.cs | 17 +++ .../SimpleNavigation/MainWindow.xaml | 8 ++ .../SimpleNavigation/MainWindow.xaml.cs | 28 ++++ .../SimpleNavigation/PageOneView.xaml | 9 ++ .../SimpleNavigation/PageOneView.xaml.cs | 28 ++++ .../SimpleNavigation/PageOneViewModel.cs | 6 + .../SimpleNavigation/PageTwoView.xaml | 9 ++ .../SimpleNavigation/PageTwoView.xaml.cs | 28 ++++ .../SimpleNavigation/PageTwoViewModel.cs | 6 + .../Properties/AssemblyInfo.cs | 55 +++++++ .../Properties/Resources.Designer.cs | 71 +++++++++ .../Properties/Resources.resx | 117 +++++++++++++++ .../Properties/Settings.Designer.cs | 30 ++++ .../Properties/Settings.settings | 7 + .../SimpleNavigation/ShellView.xaml | 17 +++ .../SimpleNavigation/ShellView.xaml.cs | 27 ++++ .../SimpleNavigation/ShellViewModel.cs | 22 +++ .../SimpleNavigation/SimpleNavigation.csproj | 136 ++++++++++++++++++ .../SimpleNavigation/packages.config | 4 + 23 files changed, 684 insertions(+) create mode 100644 samples/SimpleNavigation/SimpleNavigation.sln create mode 100644 samples/SimpleNavigation/SimpleNavigation/App.config create mode 100644 samples/SimpleNavigation/SimpleNavigation/App.xaml create mode 100644 samples/SimpleNavigation/SimpleNavigation/App.xaml.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/AppBootstrapper.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml create mode 100644 samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml create mode 100644 samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/PageOneViewModel.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml create mode 100644 samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/PageTwoViewModel.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/Properties/AssemblyInfo.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/Properties/Resources.Designer.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/Properties/Resources.resx create mode 100644 samples/SimpleNavigation/SimpleNavigation/Properties/Settings.Designer.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/Properties/Settings.settings create mode 100644 samples/SimpleNavigation/SimpleNavigation/ShellView.xaml create mode 100644 samples/SimpleNavigation/SimpleNavigation/ShellView.xaml.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/ShellViewModel.cs create mode 100644 samples/SimpleNavigation/SimpleNavigation/SimpleNavigation.csproj create mode 100644 samples/SimpleNavigation/SimpleNavigation/packages.config diff --git a/samples/SimpleNavigation/SimpleNavigation.sln b/samples/SimpleNavigation/SimpleNavigation.sln new file mode 100644 index 0000000..ffe4e05 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleNavigation", "SimpleNavigation\SimpleNavigation.csproj", "{81E02E7A-4193-40A5-A3F3-CFED82C0855E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81E02E7A-4193-40A5-A3F3-CFED82C0855E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81E02E7A-4193-40A5-A3F3-CFED82C0855E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81E02E7A-4193-40A5-A3F3-CFED82C0855E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81E02E7A-4193-40A5-A3F3-CFED82C0855E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/SimpleNavigation/SimpleNavigation/App.config b/samples/SimpleNavigation/SimpleNavigation/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/samples/SimpleNavigation/SimpleNavigation/App.xaml b/samples/SimpleNavigation/SimpleNavigation/App.xaml new file mode 100644 index 0000000..5e2f9e6 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/samples/SimpleNavigation/SimpleNavigation/App.xaml.cs b/samples/SimpleNavigation/SimpleNavigation/App.xaml.cs new file mode 100644 index 0000000..2243307 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace SimpleNavigation +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/AppBootstrapper.cs b/samples/SimpleNavigation/SimpleNavigation/AppBootstrapper.cs new file mode 100644 index 0000000..43da3b0 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/AppBootstrapper.cs @@ -0,0 +1,17 @@ +using Caliburn.Micro; +using System.Windows; + +namespace SimpleNavigation +{ public class AppBootstrapper : BootstrapperBase + { + public AppBootstrapper() + { + Start(); + } + + protected override void OnStartup(object sender, StartupEventArgs e) + { + DisplayRootViewFor(); + } + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml b/samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml new file mode 100644 index 0000000..0bdcacd --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml.cs b/samples/SimpleNavigation/SimpleNavigation/MainWindow.xaml.cs new file mode 100644 index 0000000..c046bf0 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/MainWindow.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.Navigation; +using System.Windows.Shapes; + +namespace SimpleNavigation +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml b/samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml new file mode 100644 index 0000000..d0d4315 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml @@ -0,0 +1,9 @@ + + Page One + diff --git a/samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml.cs b/samples/SimpleNavigation/SimpleNavigation/PageOneView.xaml.cs new file mode 100644 index 0000000..0ccf31e --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/PageOneView.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.Navigation; +using System.Windows.Shapes; + +namespace SimpleNavigation +{ + /// + /// Interaction logic for PageOneView.xaml + /// + public partial class PageOneView : UserControl + { + public PageOneView() + { + InitializeComponent(); + } + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/PageOneViewModel.cs b/samples/SimpleNavigation/SimpleNavigation/PageOneViewModel.cs new file mode 100644 index 0000000..cccc31e --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/PageOneViewModel.cs @@ -0,0 +1,6 @@ +namespace SimpleNavigation +{ + public class PageOneViewModel + { + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml b/samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml new file mode 100644 index 0000000..ce4d24c --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml @@ -0,0 +1,9 @@ + + Page Two + diff --git a/samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml.cs b/samples/SimpleNavigation/SimpleNavigation/PageTwoView.xaml.cs new file mode 100644 index 0000000..8185701 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/PageTwoView.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.Navigation; +using System.Windows.Shapes; + +namespace SimpleNavigation +{ + /// + /// Interaction logic for PageTwoView.xaml + /// + public partial class PageTwoView : UserControl + { + public PageTwoView() + { + InitializeComponent(); + } + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/PageTwoViewModel.cs b/samples/SimpleNavigation/SimpleNavigation/PageTwoViewModel.cs new file mode 100644 index 0000000..b0edcb0 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/PageTwoViewModel.cs @@ -0,0 +1,6 @@ +namespace SimpleNavigation +{ + public class PageTwoViewModel + { + } +} diff --git a/samples/SimpleNavigation/SimpleNavigation/Properties/AssemblyInfo.cs b/samples/SimpleNavigation/SimpleNavigation/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8fb713c --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/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("SimpleNavigation")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SimpleNavigation")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[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/SimpleNavigation/SimpleNavigation/Properties/Resources.Designer.cs b/samples/SimpleNavigation/SimpleNavigation/Properties/Resources.Designer.cs new file mode 100644 index 0000000..79fea75 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34003 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SimpleNavigation.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("SimpleNavigation.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/SimpleNavigation/SimpleNavigation/Properties/Resources.resx b/samples/SimpleNavigation/SimpleNavigation/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/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/SimpleNavigation/SimpleNavigation/Properties/Settings.Designer.cs b/samples/SimpleNavigation/SimpleNavigation/Properties/Settings.Designer.cs new file mode 100644 index 0000000..b220230 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34003 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SimpleNavigation.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/SimpleNavigation/SimpleNavigation/Properties/Settings.settings b/samples/SimpleNavigation/SimpleNavigation/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/samples/SimpleNavigation/SimpleNavigation/ShellView.xaml b/samples/SimpleNavigation/SimpleNavigation/ShellView.xaml new file mode 100644 index 0000000..e43b7bb --- /dev/null +++ b/samples/SimpleNavigation/SimpleNavigation/ShellView.xaml @@ -0,0 +1,17 @@ + + + +