Browse Source

working on sample application. stubbed out a couple of modules.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
d6d4ad7b5b
  1. 19
      ExtendedWPFToolkitSolution/ExtendedWPFToolkit.sln
  2. 7
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/BusyIndicatorModule.cs
  3. 16
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Samples.Modules.BusyIndicator.csproj
  4. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml
  5. 27
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml.cs
  6. 11
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/NavigationView.xaml
  7. 27
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/NavigationView.xaml.cs
  8. 26
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/ButtonSpinnerModule.cs
  9. 55
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/AssemblyInfo.cs
  10. 71
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Resources.Designer.cs
  11. 117
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Resources.resx
  12. 30
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Settings.Designer.cs
  13. 7
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Settings.settings
  14. 122
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Samples.Modules.ButtonSpinner.csproj
  15. 10
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Samples.Modules.ButtonSpinner.csproj.vspscc
  16. 18
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/HomeView.xaml
  17. 27
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/HomeView.xaml.cs
  18. 10
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/NavigationView.xaml
  19. 27
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/NavigationView.xaml.cs
  20. 25
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Commands/TreeViewCommandBehavior.cs
  21. 64
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Commands/TreeViewSelected.cs
  22. 4
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/ModuleBase.cs
  23. 10
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/RegionNames.cs
  24. 4
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Samples.Infrastructure.csproj
  25. 12
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Bootstrapper.cs
  26. 8
      ExtendedWPFToolkitSolution/Src/Samples/Samples/IShellViewModel.cs
  27. 10
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Samples.csproj
  28. 20
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Shell.xaml
  29. 22
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Shell.xaml.cs
  30. 27
      ExtendedWPFToolkitSolution/Src/Samples/Samples/ShellViewModel.cs

19
ExtendedWPFToolkitSolution/ExtendedWPFToolkit.sln

@ -13,9 +13,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Modules.BusyIndicat
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Infrastructure", "Src\Samples\Samples.Infrastructure\Samples.Infrastructure.csproj", "{A4A049A4-665A-4651-9046-7D06E9D0CCDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Modules.ButtonSpinner", "Src\Samples\Modules\Samples.Modules.ButtonSpinner\Samples.Modules.ButtonSpinner.csproj", "{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}"
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 5
SccNumberOfProjects = 6
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs02
SccLocalPath0 = .
@ -34,6 +36,10 @@ Global
SccProjectTopLevelParentUniqueName4 = ExtendedWPFToolkit.sln
SccProjectName4 = Src/Samples/Samples.Infrastructure
SccLocalPath4 = Src\\Samples\\Samples.Infrastructure
SccProjectUniqueName5 = Src\\Samples\\Modules\\Samples.Modules.ButtonSpinner\\Samples.Modules.ButtonSpinner.csproj
SccProjectTopLevelParentUniqueName5 = ExtendedWPFToolkit.sln
SccProjectName5 = Src/Samples/Modules/Samples.Modules.ButtonSpinner
SccLocalPath5 = Src\\Samples\\Modules\\Samples.Modules.ButtonSpinner
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -84,6 +90,16 @@ Global
{A4A049A4-665A-4651-9046-7D06E9D0CCDC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{A4A049A4-665A-4651-9046-7D06E9D0CCDC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A4A049A4-665A-4651-9046-7D06E9D0CCDC}.Release|x86.ActiveCfg = Release|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Debug|x86.ActiveCfg = Debug|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Release|Any CPU.Build.0 = Release|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -93,5 +109,6 @@ Global
{F927B3FE-820C-4EE1-921F-D10D3AE287AE} = {01F2E61E-7F20-4F2E-8A3C-6604B18415B9}
{A4A049A4-665A-4651-9046-7D06E9D0CCDC} = {01F2E61E-7F20-4F2E-8A3C-6604B18415B9}
{1A9C0E21-DE3B-4B2D-9EF0-39AA1922CDA6} = {F927B3FE-820C-4EE1-921F-D10D3AE287AE}
{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463} = {F927B3FE-820C-4EE1-921F-D10D3AE287AE}
EndGlobalSection
EndGlobal

7
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/BusyIndicatorModule.cs

@ -7,14 +7,19 @@ namespace Samples.Modules.BusyIndicator
{
public class BusyIndicatorModule : ModuleBase
{
protected BusyIndicatorModule(IUnityContainer container, IRegionManager regionManager)
public BusyIndicatorModule(IUnityContainer container, IRegionManager regionManager)
: base(container, regionManager)
{
}
protected override void RegisterViewsAndTypes()
{
Container.RegisterType(typeof(object), typeof(HomeView), typeof(HomeView).FullName);
}
protected override void InitializeModule()
{
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView));
}
}
}

16
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Samples.Modules.BusyIndicator.csproj

@ -59,6 +59,12 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BusyIndicatorModule.cs" />
<Compile Include="Views\HomeView.xaml.cs">
<DependentUpon>HomeView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\NavigationView.xaml.cs">
<DependentUpon>NavigationView.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@ -88,6 +94,16 @@
<Name>Samples.Infrastructure</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Views\HomeView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\NavigationView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml

@ -0,0 +1,17 @@
<UserControl x:Class="Samples.Modules.BusyIndicator.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="BusyIndicator Title" />
<TextBlock Grid.Row="1" Margin="10" Text="BusyIndicator makes it easy to let the user know when an application is busy. Simply wrap the relevant content in an instance of the BusyIndicator control and toggle its IsBusy property to True during any long-running process.
" TextWrapping="Wrap" />
</Grid>
</UserControl>

27
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 Samples.Modules.BusyIndicator
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
{
public HomeView()
{
InitializeComponent();
}
}
}

11
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/NavigationView.xaml

@ -0,0 +1,11 @@
<TreeViewItem x:Class="Samples.Modules.BusyIndicator.NavigationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Header="BusyIndicator"
Tag="Samples.Modules.BusyIndicator.HomeView">
<TreeViewItem Header="Sub Item 1" />
<TreeViewItem Header="Sub Item 2" />
<TreeViewItem Header="Sub Item 3" />
</TreeViewItem>

27
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/NavigationView.xaml.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 Samples.Modules.BusyIndicator
{
/// <summary>
/// Interaction logic for NavigationView.xaml
/// </summary>
public partial class NavigationView : TreeViewItem
{
public NavigationView()
{
InitializeComponent();
}
}
}

26
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/ButtonSpinnerModule.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Samples.Infrastructure;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
namespace Samples.Modules.ButtonSpinner
{
public class ButtonSpinnerModule : ModuleBase
{
public ButtonSpinnerModule(IUnityContainer container, IRegionManager regionManager)
: base(container, regionManager) { }
protected override void InitializeModule()
{
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView));
}
protected override void RegisterViewsAndTypes()
{
Container.RegisterType(typeof(object), typeof(HomeView), typeof(HomeView).FullName);
}
}
}

55
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/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("Samples.Modules.ButtonSpinner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Samples.Modules.ButtonSpinner")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[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
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> 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")]

71
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Resources.Designer.cs

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.235
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Samples.Modules.ButtonSpinner.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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("Samples.Modules.ButtonSpinner.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

117
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Resources.resx

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Settings.Designer.cs

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.235
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Samples.Modules.ButtonSpinner.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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;
}
}
}
}

7
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Properties/Settings.settings

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

122
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Samples.Modules.ButtonSpinner.csproj

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Samples.Modules.ButtonSpinner</RootNamespace>
<AssemblyName>Samples.Modules.ButtonSpinner</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.Prism, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Libs\Prism\Microsoft.Practices.Prism.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Libs\Prism\Microsoft.Practices.Unity.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="ButtonSpinnerModule.cs" />
<Compile Include="Views\HomeView.xaml.cs">
<DependentUpon>HomeView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\NavigationView.xaml.cs">
<DependentUpon>NavigationView.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\WPFToolkit.Extended\WPFToolkit.Extended.csproj">
<Project>{72E591D6-8F83-4D8C-8F67-9C325E623234}</Project>
<Name>WPFToolkit.Extended</Name>
</ProjectReference>
<ProjectReference Include="..\..\Samples.Infrastructure\Samples.Infrastructure.csproj">
<Project>{A4A049A4-665A-4651-9046-7D06E9D0CCDC}</Project>
<Name>Samples.Infrastructure</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Views\HomeView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\NavigationView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

10
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Samples.Modules.ButtonSpinner.csproj.vspscc

@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

18
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/HomeView.xaml

@ -0,0 +1,18 @@
<UserControl x:Class="Samples.Modules.ButtonSpinner.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="ButtonSpinner Title" />
<TextBlock Grid.Row="1" Margin="10"
Text="The ButtonSpinner control allows you to add button spinners to any element and then respond to the Spin event to manipulate that element. The Spin event lets the developer know which direction the buttons are spinning; SpinDirection.Increase indicates an increment, SpinDirection.Decrease indicates a decrement."
TextWrapping="Wrap" />
</Grid>
</UserControl>

27
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/HomeView.xaml.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 Samples.Modules.ButtonSpinner
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
{
public HomeView()
{
InitializeComponent();
}
}
}

10
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/NavigationView.xaml

@ -0,0 +1,10 @@
<TreeViewItem x:Class="Samples.Modules.ButtonSpinner.NavigationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Header="ButtonSpinner" Tag="Samples.Modules.ButtonSpinner.HomeView">
<TreeViewItem Header="Sub Item 1" />
<TreeViewItem Header="Sub Item 2" />
<TreeViewItem Header="Sub Item 3" />
</TreeViewItem>

27
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ButtonSpinner/Views/NavigationView.xaml.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 Samples.Modules.ButtonSpinner
{
/// <summary>
/// Interaction logic for NavigationView.xaml
/// </summary>
public partial class NavigationView : TreeViewItem
{
public NavigationView()
{
InitializeComponent();
}
}
}

25
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Commands/TreeViewCommandBehavior.cs

@ -0,0 +1,25 @@
using System;
using Microsoft.Practices.Prism.Commands;
using System.Windows.Controls;
using System.Windows;
namespace Samples.Infrastructure.Commands
{
public class TreeViewCommandBehavior : CommandBehaviorBase<TreeView>
{
public TreeViewCommandBehavior(TreeView treeView)
: base(treeView)
{
treeView.SelectedItemChanged += SelectedItemChanged;
}
void SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
//This treeview command is specfic to the navigation region,
//so I always want to pass the tag of the selected treeviewitem
//because it will conatin the fully qualified navigation path
CommandParameter = (e.NewValue as FrameworkElement).Tag;
ExecuteCommand();
}
}
}

64
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Commands/TreeViewSelected.cs

@ -0,0 +1,64 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace Samples.Infrastructure.Commands
{
public class TreeViewSelected
{
private static readonly DependencyProperty SelectedCommandBehaviorProperty = DependencyProperty.RegisterAttached("SelectedCommandBehavior", typeof(TreeViewCommandBehavior), typeof(TreeViewSelected), null);
public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached("Command", typeof(ICommand), typeof(TreeViewSelected), new PropertyMetadata(OnSetCommandCallback));
public static void SetCommand(TreeView menuItem, ICommand command)
{
menuItem.SetValue(CommandProperty, command);
}
public static ICommand GetCommand(TreeView menuItem)
{
return menuItem.GetValue(CommandProperty) as ICommand;
}
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.RegisterAttached("CommandParameter", typeof(object), typeof(TreeViewSelected), new PropertyMetadata(OnSetCommandParameterCallback));
public static void SetCommandParameter(TreeView menuItem, object parameter)
{
menuItem.SetValue(CommandParameterProperty, parameter);
}
public static object GetCommandParameter(TreeView menuItem)
{
return menuItem.GetValue(CommandParameterProperty);
}
private static void OnSetCommandCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
TreeView menuItem = dependencyObject as TreeView;
if (menuItem != null)
{
TreeViewCommandBehavior behavior = GetOrCreateBehavior(menuItem);
behavior.Command = e.NewValue as ICommand;
}
}
private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
TreeView menuItem = dependencyObject as TreeView;
if (menuItem != null)
{
TreeViewCommandBehavior behavior = GetOrCreateBehavior(menuItem);
behavior.CommandParameter = e.NewValue;
}
}
private static TreeViewCommandBehavior GetOrCreateBehavior(TreeView menuItem)
{
TreeViewCommandBehavior behavior = menuItem.GetValue(SelectedCommandBehaviorProperty) as TreeViewCommandBehavior;
if (behavior == null)
{
behavior = new TreeViewCommandBehavior(menuItem);
menuItem.SetValue(SelectedCommandBehaviorProperty, behavior);
}
return behavior;
}
}
}

4
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/ModuleBase.cs

@ -18,9 +18,13 @@ namespace Samples.Infrastructure
public void Initialize()
{
//types must be registered first
RegisterViewsAndTypes();
//now initialize the module
InitializeModule();
}
protected abstract void InitializeModule();
protected abstract void RegisterViewsAndTypes();
}
}

10
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/RegionNames.cs

@ -0,0 +1,10 @@
using System;
namespace Samples.Infrastructure
{
public static class RegionNames
{
public static readonly string NavigationRegion = "NavigationRegion";
public static readonly string ContentRegion = "ContentRegion";
}
}

4
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Samples.Infrastructure.csproj

@ -61,6 +61,8 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\TreeViewCommandBehavior.cs" />
<Compile Include="Commands\TreeViewSelected.cs" />
<Compile Include="ModuleBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
@ -75,6 +77,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RegionNames.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -85,6 +88,7 @@
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

12
ExtendedWPFToolkitSolution/Src/Samples/Samples/Bootstrapper.cs

@ -2,6 +2,9 @@
using Microsoft.Practices.Prism.UnityExtensions;
using Microsoft.Practices.Unity;
using System.Windows;
using Microsoft.Practices.Prism.Modularity;
using Samples.Modules.BusyIndicator;
using Samples.Modules.ButtonSpinner;
namespace Samples
{
@ -9,6 +12,7 @@ namespace Samples
{
protected override DependencyObject CreateShell()
{
Container.RegisterType<IShellViewModel, ShellViewModel>();
return Container.Resolve<Shell>();
}
@ -19,5 +23,13 @@ namespace Samples
App.Current.MainWindow = (Shell)Shell;
App.Current.MainWindow.Show();
}
protected override Microsoft.Practices.Prism.Modularity.IModuleCatalog CreateModuleCatalog()
{
ModuleCatalog catalog = new ModuleCatalog();
catalog.AddModule(typeof(BusyIndicatorModule));
catalog.AddModule(typeof(ButtonSpinnerModule));
return catalog;
}
}
}

8
ExtendedWPFToolkitSolution/Src/Samples/Samples/IShellViewModel.cs

@ -0,0 +1,8 @@
using System;
namespace Samples
{
public interface IShellViewModel
{
}
}

10
ExtendedWPFToolkitSolution/Src/Samples/Samples/Samples.csproj

@ -73,9 +73,11 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Bootstrapper.cs" />
<Compile Include="IShellViewModel.cs" />
<Compile Include="Shell.xaml.cs">
<DependentUpon>Shell.xaml</DependentUpon>
</Compile>
<Compile Include="ShellViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@ -106,6 +108,14 @@
<Project>{72E591D6-8F83-4D8C-8F67-9C325E623234}</Project>
<Name>WPFToolkit.Extended</Name>
</ProjectReference>
<ProjectReference Include="..\Modules\Samples.Modules.BusyIndicator\Samples.Modules.BusyIndicator.csproj">
<Project>{1A9C0E21-DE3B-4B2D-9EF0-39AA1922CDA6}</Project>
<Name>Samples.Modules.BusyIndicator</Name>
</ProjectReference>
<ProjectReference Include="..\Modules\Samples.Modules.ButtonSpinner\Samples.Modules.ButtonSpinner.csproj">
<Project>{1CFCE8B5-5A5F-4161-BA12-F317ED0E6463}</Project>
<Name>Samples.Modules.ButtonSpinner</Name>
</ProjectReference>
<ProjectReference Include="..\Samples.Infrastructure\Samples.Infrastructure.csproj">
<Project>{A4A049A4-665A-4651-9046-7D06E9D0CCDC}</Project>
<Name>Samples.Infrastructure</Name>

20
ExtendedWPFToolkitSolution/Src/Samples/Samples/Shell.xaml

@ -1,8 +1,26 @@
<Window x:Class="Samples.Shell"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Shell" Height="300" Width="300">
xmlns:inf="clr-namespace:Samples.Infrastructure;assembly=Samples.Infrastructure"
xmlns:infCommands="clr-namespace:Samples.Infrastructure.Commands;assembly=Samples.Infrastructure"
xmlns:prism="http://www.codeplex.com/CompositeWPF"
Title="Shell" Height="600" Width="800">
<Window.Resources>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TreeView prism:RegionManager.RegionName="{x:Static inf:RegionNames.NavigationRegion}"
infCommands:TreeViewSelected.Command="{Binding NavigateCommand}"
MinWidth="150" />
<ContentControl Grid.Column="1" prism:RegionManager.RegionName="{x:Static inf:RegionNames.ContentRegion}" Margin="10" />
</Grid>
</Window>

22
ExtendedWPFToolkitSolution/Src/Samples/Samples/Shell.xaml.cs

@ -1,26 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 Samples
{
/// <summary>
/// Interaction logic for Shell.xaml
/// </summary>
public partial class Shell : Window
{
public Shell()
public Shell(IShellViewModel viewModel)
{
InitializeComponent();
ViewModel = viewModel;
}
public IShellViewModel ViewModel
{
get { return (IShellViewModel)DataContext; }
private set { DataContext = value; }
}
}
}

27
ExtendedWPFToolkitSolution/Src/Samples/Samples/ShellViewModel.cs

@ -0,0 +1,27 @@
using System;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Regions;
using Samples.Infrastructure;
namespace Samples
{
public class ShellViewModel : IShellViewModel
{
private readonly IRegionManager _regionManager;
public ICommand NavigateCommand { get; set; }
public ShellViewModel(IRegionManager regionManager)
{
_regionManager = regionManager;
NavigateCommand = new DelegateCommand<string>(Navigate);
}
private void Navigate(string navigatePath)
{
if (!String.IsNullOrWhiteSpace(navigatePath))
_regionManager.RequestNavigate(RegionNames.ContentRegion, navigatePath);
}
}
}
Loading…
Cancel
Save