This commit is contained in:
Vitaliy
2017-01-09 13:25:52 +03:00
parent a9f4f0f297
commit 6ead62af6e
98 changed files with 12058 additions and 72 deletions

24
AppleJobs.Data/App.config Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B4695C76-31FF-4BF1-9DC6-1BC62D374091}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AppleJobs.Data</RootNamespace>
<AssemblyName>AppleJobs.Data</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.Entity.6.9.9\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<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.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AppleJobsContext.cs" />
<Compile Include="Models\Inventory\Accessories.cs" />
<Compile Include="Models\Customer.cs" />
<Compile Include="Models\Inventory\Employee.cs" />
<Compile Include="Models\ModelsJobs\Model.cs" />
<Compile Include="Models\ModelsJobs\ModelJobPriceTemplate.cs" />
<Compile Include="Models\ModelsJobs\ModelJob.cs" />
<Compile Include="Models\ModelsJobs\ModelCategory.cs" />
<Compile Include="Models\Orders\Order.cs" />
<Compile Include="Models\Orders\OrderCategory.cs" />
<Compile Include="Models\Orders\OrderStatus.cs" />
<Compile Include="Models\TsModelAttribute.cs" />
<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="App.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</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>

View File

@@ -0,0 +1,51 @@
using AppleJobs.Data.Models;
using AppleJobs.Data.Models.ModelsJobs;
using Microsoft.AspNet.Identity.EntityFramework;
using MySql.Data.Entity;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
namespace AppleJobs.Data
{
[DbConfigurationType(typeof(MySqlEFConfiguration))]
public class AppleJobsContext : IdentityDbContext<ApplicationUser>
{
#region Common
public DbSet<Customer> Customers { get; set; }
#endregion
#region Orders
public DbSet<OrderCategory> OrderCategories { get; set; }
public DbSet<Order> Orders { get; set; }
public DbSet<OrderView> OrdersView { get; set; }
public DbSet<OrderStatus> OrderStatuses { get; set; }
#endregion
#region Inventory
public DbSet<Accessories> Accessories { get; set; }
public DbSet<Employee> Employees { get; set; }
#endregion
#region Prices
public DbSet<Model> Models { get; set; }
public DbSet<ModelJob> ModelJobs { get; set; }
public DbSet<ModelCategory> ModelCategories { get; set; }
public DbSet<ModelJobPriceTemplate> ModelJobPriceTemplates { get; set; }
#endregion
public AppleJobsContext(string connection = "Default") : base(connection)
{
}
}
public class ApplicationUser : IdentityUser
{
}
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
public class Customer
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public string MainEmail { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
{
public class Accessories
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
{
public class Employee
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public string ContactInfo { get; set; }
public string Email { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
public class Model
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public int ModelCategories_Id { get; set; }
[ForeignKey(nameof(ModelCategories_Id))]
public virtual ModelCategory ModelCategory { get; set; }
public virtual ICollection<ModelJob> ModelJobs { get; set; }
public string FilterString { get { return string.Format("{0},{1}", Name, ModelCategory?.FilterString); } }
}
}

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
public class ModelCategory
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public string FilterString { get { return string.Format("{0}", Name); } }
}
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
public class ModelJob
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public int Models_Id { get; set; }
[ForeignKey(nameof(Models_Id))]
public virtual Model Model { get; set; }
public string FilterString { get { return string.Format("{0},{1},{2}", Name, Description, Model?.FilterString); } }
}
}

View File

@@ -0,0 +1,22 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
public class ModelJobPriceTemplate
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public double? Price { get; set; }
public bool IsPriceFrom { get; set; }
public int ModelJobs_Id { get; set; }
public int Customers_Id { get; set; }
[ForeignKey(nameof(Customers_Id))]
public virtual Customer Customer { get; set; }
[ForeignKey(nameof(ModelJobs_Id))]
public virtual ModelJob ModelJob { get; set; }
public string FilterString { get { return string.Format("{0},{1}", Price, ModelJob?.FilterString); } }
}
}

View File

@@ -0,0 +1,104 @@
using AppleJobs.Data.Models.ModelsJobs;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
{
[TsModel]
public class OrderView
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Contact { get; set; }
public string Comment { get; set; }
public DateTime DateCreated { get; set; }
public DateTime? DateClosed { get; set; }
public DateTime DateUpdated { get; set; }
public string UserCreated { get; set; }
public bool? IsFast { get; set; }
public bool? IsDrive { get; set; }
public int? Price { get; set; }
public int OrderStatuses_Id { get; set; }
public int Models_Id { get; set; }
public int? ModelJobs_Id { get; set; }
public int Customers_Id { get; set; }
public int? Accessories_Id { get; set; }
public int? Employees_Id { get; set; }
public int OrderCategories_Id { get; set; }
//Joined
public string Status { get; set; }
public string Model { get; set; }
public string ModelJob { get; set; }
public string Customer { get; set; }
public string Accessories { get; set; }
public string Employee { get; set; }
public string OrderCategory { get; set; }
public string FilterString { get; set; }
}
[TsModel]
public class Order
{
public Order()
{
DateCreated = DateUpdated = DateTime.Now;
}
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Contact { get; set; }
public string Comment { get; set; }
public DateTime DateCreated { get; set; }
public DateTime? DateClosed { get; set; }
public DateTime DateUpdated { get; set; }
public string UserCreated { get; set; }
public bool? IsFast { get; set; }
public bool? IsDrive { get; set; }
public int? Price { get; set; }
public int OrderStatuses_Id { get; set; }
public int Models_Id { get; set; }
public int? ModelJobs_Id { get; set; }
public int Customers_Id { get; set; }
public int? Accessories_Id { get; set; }
public int? Employees_Id { get; set; }
[ForeignKey(nameof(OrderStatuses_Id))]
public virtual OrderStatus OrderStatus { get; set; }
[ForeignKey(nameof(Models_Id))]
public virtual Model Model { get; set; }
[ForeignKey(nameof(ModelJobs_Id))]
public virtual ModelJob JobModel { get; set; }
[ForeignKey(nameof(Customers_Id))]
public virtual Customer Customer { get; set; }
[ForeignKey(nameof(Accessories_Id))]
public virtual Accessories Accessories { get; set; }
[ForeignKey(nameof(Employees_Id))]
public virtual Employee Employee { get; set; }
public string FilterString
{
get
{
return string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}",
Contact, Comment, DateCreated, DateClosed, DateUpdated,
OrderStatus?.Name,
Model.FilterString,
JobModel.FilterString,
Customer?.Name,
Accessories?.Name,
Employee?.Name);
}
}
}
}

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
{
[TsModel]
public class OrderCategory
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public string FullName { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
{
[TsModel]
[Table("OrderStatuses")]
public class OrderStatus
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
using System;
namespace AppleJobs.Data.Models
{
public class TsModelAttribute : Attribute
{
}
}

View File

@@ -0,0 +1,46 @@
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("AppleJobs.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AppleJobs.Data")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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)]
// 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")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AppleJobs.Data.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("AppleJobs.Data.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;
}
}
}
}

View File

@@ -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>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AppleJobs.Data.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;
}
}
}
}

View File

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

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.0" targetFramework="net452" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net452" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net452" />
<package id="MySql.Data" version="6.9.9" targetFramework="net452" />
<package id="MySql.Data.Entity" version="6.9.9" targetFramework="net452" />
</packages>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View File

@@ -0,0 +1,14 @@
<Application x:Class="BrightSharp.Ui.Tests.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:BrightSharp.Ui.Tests"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/brightsharp;component/generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -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 BrightSharp.Ui.Tests
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0D6E1828-8D07-4701-B98A-65DBF1604D3F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BrightSharp.Ui.Tests</RootNamespace>
<AssemblyName>BrightSharp.Ui.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<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.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ListViewItemModel.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<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>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BrightSharp\BrightSharp.csproj">
<Project>{acc3c556-f8e4-4f2a-a23d-8e8749679a1b}</Project>
<Name>BrightSharp</Name>
</ProjectReference>
</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>

View File

@@ -0,0 +1,121 @@
using BrightSharp.Mvvm;
using System;
using System.ComponentModel;
namespace BrightSharp.Ui.Tests
{
public class CustomerViewModel : ObservableObject
{
static Random rnd = new Random();
private string _customerId;
private string _companyName;
private string _contactName;
private string _contactTitle;
private string _address;
private string _city;
private string _region;
private string _postalCode;
private string _country;
private string _phone;
private string _fax;
private string _color;
public CustomerViewModel()
{
byte[] colorBytes = new byte[3];
rnd.NextBytes(colorBytes);
Color = System.Windows.Media.Color.FromRgb(colorBytes[0], colorBytes[1], colorBytes[2]).ToString();
}
public string CustomerID
{
get { return _customerId; }
set { _customerId = value; RaisePropertyChanged(nameof(CustomerID)); }
}
public string CompanyName
{
get { return _companyName; }
set { _companyName = value; RaisePropertyChanged(nameof(CompanyName)); }
}
public string ContactName
{
get { return _contactName; }
set { _contactName = value; RaisePropertyChanged(nameof(ContactName)); }
}
public string ContactTitle
{
get { return _contactTitle; }
set { _contactTitle = value; RaisePropertyChanged(nameof(ContactTitle)); }
}
[Category("Location")]
public string Address
{
get { return _address; }
set { _address = value; RaisePropertyChanged(nameof(Address)); }
}
[Category("Location")]
public string City
{
get { return _city; }
set { _city = value; RaisePropertyChanged(nameof(City)); }
}
[Category("Location")]
public string Region
{
get { return _region; }
set { _region = value; RaisePropertyChanged(nameof(Region)); }
}
[Category("Contact Information")]
[Description("Postal code for Customer")]
public string PostalCode
{
get { return _postalCode; }
set { _postalCode = value; RaisePropertyChanged(nameof(PostalCode)); }
}
[Category("Location")]
[Description("Country for Customer")]
public string Country
{
get { return _country; }
set { _country = value; RaisePropertyChanged(nameof(Country)); }
}
[Category("Contact Information")]
[Description("Phone for Customer")]
public string Phone
{
get { return _phone; }
set { _phone = value; RaisePropertyChanged(nameof(Phone)); }
}
[Category("Contact Information")]
[Description("Fax for Customer")]
public string Fax
{
get { return _fax; }
set { _fax = value; RaisePropertyChanged(nameof(Fax)); }
}
[Category("Appearance")]
public string Color
{
get { return _color; }
set { _color = value; RaisePropertyChanged(nameof(Color)); }
}
public int NumberProperty { get; set; }
public double DoubleNumberProperty { get; set; }
[Category("PropertyGrid Explore Group")]
[Description("Indicates that Customer is has active state")]
[DisplayName("Is Active")]
public bool IsActive { get; set; }
[Category("PropertyGrid Explore Group")]
[Description("Indicates that Customer is has active state or it absent")]
[DisplayName("Is Active Or Not Exists")]
public bool? IsActiveOrEmpty { get; set; }
}
}

View File

@@ -0,0 +1,138 @@
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BrightSharp.Ui.Tests"
xmlns:viewModel="clr-namespace:BrightSharp.Ui.Tests"
xmlns:ex="clr-namespace:BrightSharp.Extensions;assembly=BrightSharp"
xmlns:BrightSharp="clr-namespace:BrightSharp;assembly=BrightSharp" x:Class="BrightSharp.Ui.Tests.MainWindow"
mc:Ignorable="d" Background="{DynamicResource WindowBackgroundBrush}"
Title="BrightSharp.Ui.Tests" Height="600" Width="1200">
<Window.Resources>
<x:Array x:Key="coll" Type="{x:Type viewModel:CustomerViewModel}">
<viewModel:CustomerViewModel CustomerID="ALFKI" CompanyName="Alfreds Futterkiste" ContactName="Maria Anders" ContactTitle="Sales Representative" Address="Obere Str. 57" City="Berlin" PostalCode="12209" Country="Germany" Phone="030-0074321" Fax="030-0076545" />
<viewModel:CustomerViewModel CustomerID="ANATR" CompanyName="Ana Trujillo Emparedados y helados" ContactName="Ana Trujillo" ContactTitle="Owner" Address="Avda. de la Constitución 2222" City="México D.F." PostalCode="05021" Country="Mexico" Phone="(5) 555-4729" Fax="(5) 555-3745" />
<viewModel:CustomerViewModel CustomerID="ANTON" CompanyName="Antonio Moreno Taquería" ContactName="Antonio Moreno" ContactTitle="Owner" Address="Mataderos 2312" City="México D.F." PostalCode="05023" Country="Mexico" Phone="(5) 555-3932" />
<viewModel:CustomerViewModel CustomerID="AROUT" CompanyName="Around the Horn" ContactName="Thomas Hardy" ContactTitle="Sales Representative" Address="120 Hanover Sq." City="London" PostalCode="WA1 1DP" Country="UK" Phone="(171) 555-7788" Fax="(171) 555-6750" />
<viewModel:CustomerViewModel CustomerID="BERGS" CompanyName="Berglunds snabbköp" ContactName="Christina Berglund" ContactTitle="Order Administrator" Address="Berguvsvägen 8" City="Luleå" PostalCode="S-958 22" Country="Sweden" Phone="0921-12 34 65" Fax="0921-12 34 67" />
<viewModel:CustomerViewModel CustomerID="BLAUS" CompanyName="Blauer See Delikatessen" ContactName="Hanna Moos" ContactTitle="Sales Representative" Address="Forsterstr. 57" City="Mannheim" PostalCode="68306" Country="Germany" Phone="0621-08460" Fax="0621-08924" />
<viewModel:CustomerViewModel CustomerID="BLONP" CompanyName="Blondesddsl père et fils" ContactName="Frédérique Citeaux" ContactTitle="Marketing Manager" Address="24, place Kléber" City="Strasbourg" PostalCode="67000" Country="France" Phone="88.60.15.31" Fax="88.60.15.32" />
<viewModel:CustomerViewModel CustomerID="BOLID" CompanyName="Bólido Comidas preparadas" ContactName="Martín Sommer" ContactTitle="Owner" Address="C/ Araquil, 67" City="Madrid" PostalCode="28023" Country="Spain" Phone="(91) 555 22 82" Fax="(91) 555 91 99" />
</x:Array>
<CollectionViewSource Source="{StaticResource coll}" x:Key="coll1" />
<CollectionViewSource Source="{StaticResource coll}" x:Key="coll2" />
</Window.Resources>
<Grid>
<BrightSharp:ZoomControl x:Name="zc" Margin="10" UseAnimation="True">
<ContentControl Style="{StaticResource DesignerItemStyle}"
Canvas.Left="10" Canvas.Top="20" Width="300" Height="473">
<GroupBox Header="Common">
<Grid>
<Button IsDefault="True" Content="Change Theme" Click="Button_Click" HorizontalAlignment="Left" Width="108" Height="32" VerticalAlignment="Top" Margin="10,10,0,0"/>
<ToggleButton Content="Toggle" HorizontalAlignment="Left" Width="108" Height="32" VerticalAlignment="Top" Margin="10,47,0,0"/>
<CheckBox Margin="10,84,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">CheckBox</CheckBox>
<CheckBox IsThreeState="True" ex:MarkupExtensionProperties.Docking="Right" Margin="10,105,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">CheckBox Right Allign</CheckBox>
<CheckBox HorizontalContentAlignment="Center" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Top" Margin="151,35,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="137">CheckBox Top Allign</CheckBox>
<RadioButton IsChecked="True" Margin="10,130,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">RadioButton</RadioButton>
<RadioButton Margin="10,151,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">RadioButton</RadioButton>
<TextBox x:Name="tb" Canvas.Left="10" Canvas.Top="269" Margin="151,10,10,0" VerticalAlignment="Top" />
<TabControl Margin="151,72,10,0" Height="122" VerticalAlignment="Top">
<TabItem Header="Tab1" />
<TabItem Header="Tab2" />
<TabItem Header="Tab3" />
</TabControl>
<CheckBox HorizontalAlignment="Left" Style="{StaticResource SwitchCheckBoxStyle}" Margin="19,0,0,10" Content="SwitchCheckBoxStyle" Width="250" RenderTransformOrigin="0.5,0.5" Height="27" VerticalAlignment="Bottom" />
<Calendar Margin="10,199,10,0" VerticalAlignment="Top">
<ex:MarkupExtensionProperties.TrailingElement>
<TextBlock HorizontalAlignment="Center" Foreground="DarkRed">Trailing</TextBlock>
</ex:MarkupExtensionProperties.TrailingElement>
<ex:MarkupExtensionProperties.LeadingElement>
<TextBlock HorizontalAlignment="Center" Foreground="DarkBlue">Leading</TextBlock>
</ex:MarkupExtensionProperties.LeadingElement>
</Calendar>
<ComboBox IsEditable="True" Margin="10,172,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" SelectedIndex="0" Width="136">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
<Separator />
<ComboBoxItem>Item 4</ComboBoxItem>
<ComboBoxItem>Item 5</ComboBoxItem>
</ComboBox>
</Grid>
</GroupBox>
</ContentControl>
<ContentControl Style="{StaticResource DesignerItemStyle}"
Height="474" Width="405"
Padding="2,27,2,2"
Canvas.Left="350"
Canvas.Top="20">
<GroupBox Margin="0,-25,0,0" Style="{StaticResource ExpandrStyleGroupBox}" >
<GroupBox.Header>
<Label>Collections</Label>
</GroupBox.Header>
<Grid x:Name="innerCanvas" Background="Transparent" ClipToBounds="True" >
<Menu VerticalAlignment="Top">
<MenuItem Header="File">
<MenuItem Header="New..."/>
<MenuItem Header="Open..."/>
<MenuItem Header="Save" />
<MenuItem Header="Save as..."/>
</MenuItem>
<MenuItem Header="Edit">
<MenuItem Header="Copy" />
<MenuItem Header="Paste" />
<MenuItem Header="Cut" />
</MenuItem>
<MenuItem Header="View"></MenuItem>
<MenuItem Header="Help">
<MenuItem Header="About..."></MenuItem>
</MenuItem>
</Menu>
<ListView ItemsSource="{Binding Source={StaticResource coll1}}" SelectedIndex="5" Margin="2,52,10,190">
<ListView.View>
<GridView>
<GridViewColumn Header="Customer" Width="100" DisplayMemberBinding="{Binding CustomerID}" />
<GridViewColumn Header="Company" Width="180" DisplayMemberBinding="{Binding CompanyName}" />
<GridViewColumn Header="Country" Width="100" DisplayMemberBinding="{Binding Country}" />
</GridView>
</ListView.View>
</ListView>
<ListBox Margin="10,258,0,10" HorizontalAlignment="Left" Width="180">
<ListBoxItem Content="123"/>
<ListBoxItem Content="456"/>
<ListBoxItem Content="789"/>
</ListBox>
<TreeView Margin="204,258,10,10">
<TreeViewItem Header="1">
<TreeViewItem Header="12">
<TreeViewItem Header="123"/>
<TreeViewItem Header="123"/>
<TreeViewItem Header="123"/>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Grid>
</GroupBox>
</ContentControl>
<ContentControl Style="{StaticResource DesignerItemStyle}"
Height="155" Width="405"
Padding="2,27,2,2"
Canvas.Left="450"
Canvas.Top="400">
<GroupBox Margin="0,-25,0,0" Style="{StaticResource ExpandrStyleGroupBox}" >
<GroupBox.Header>
<Label>Grid</Label>
</GroupBox.Header>
<DataGrid SelectedIndex="2" Margin="2" AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}" ItemsSource="{Binding Source={StaticResource coll2}}" />
</GroupBox>
</ContentControl>
</BrightSharp:ZoomControl>
</Grid>
</Window>

View File

@@ -0,0 +1,48 @@
using BrightSharp.Diagrams;
using BrightSharp.Extensions;
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;
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 BrightSharp.Ui.Tests
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
SelectionBehavior.Attach(innerCanvas);
tb.Text = ThemeManager.Theme.ToString();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if (Enum.IsDefined(typeof(ColorThemes), ThemeManager.Theme + 1))
{
ThemeManager.Theme = ThemeManager.Theme + 1;
}
else
{
ThemeManager.Theme = ColorThemes.Classic;
}
tb.Text = ThemeManager.Theme.ToString();
}
}
}

View File

@@ -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("BrightSharp.Ui.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BrightSharp.Ui.Tests")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BrightSharp.Ui.Tests.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("BrightSharp.Ui.Tests.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;
}
}
}
}

View File

@@ -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>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BrightSharp.Ui.Tests.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;
}
}
}
}

View File

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

View File

@@ -5,6 +5,12 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightSharp", "BrightSharp\BrightSharp.csproj", "{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightSharp", "BrightSharp\BrightSharp.csproj", "{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightSharp.Ui.Tests", "BrightSharp.Ui.Tests\BrightSharp.Ui.Tests.csproj", "{0D6E1828-8D07-4701-B98A-65DBF1604D3F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JetFrames.AppleJobs.Editor", "JetFrames.AppleJobs.Editor\JetFrames.AppleJobs.Editor.csproj", "{FD3E36B5-444A-4115-B288-6C924BEA0BD3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppleJobs.Data", "AppleJobs.Data\AppleJobs.Data.csproj", "{B4695C76-31FF-4BF1-9DC6-1BC62D374091}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -15,6 +21,18 @@ Global
{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU {ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU {ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}.Release|Any CPU.Build.0 = Release|Any CPU {ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}.Release|Any CPU.Build.0 = Release|Any CPU
{0D6E1828-8D07-4701-B98A-65DBF1604D3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D6E1828-8D07-4701-B98A-65DBF1604D3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D6E1828-8D07-4701-B98A-65DBF1604D3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D6E1828-8D07-4701-B98A-65DBF1604D3F}.Release|Any CPU.Build.0 = Release|Any CPU
{FD3E36B5-444A-4115-B288-6C924BEA0BD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD3E36B5-444A-4115-B288-6C924BEA0BD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD3E36B5-444A-4115-B288-6C924BEA0BD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD3E36B5-444A-4115-B288-6C924BEA0BD3}.Release|Any CPU.Build.0 = Release|Any CPU
{B4695C76-31FF-4BF1-9DC6-1BC62D374091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4695C76-31FF-4BF1-9DC6-1BC62D374091}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4695C76-31FF-4BF1-9DC6-1BC62D374091}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4695C76-31FF-4BF1-9DC6-1BC62D374091}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -0,0 +1,115 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Interactivity;
using System.Windows.Threading;
namespace BrightSharp.Behaviors
{
public class FilterDefaultViewTextBoxBehavior : Behavior<TextBox>
{
DispatcherTimer timer = new DispatcherTimer();
public FilterDefaultViewTextBoxBehavior()
{
timer.Tick += Timer_Tick;
FilterDelay = TimeSpan.FromSeconds(1);
IgnoreCase = null;
}
private void Timer_Tick(object sender, EventArgs e)
{
timer.Stop();
if (ItemsSource != null)
{
var view = CollectionViewSource.GetDefaultView(ItemsSource);
if (view is ListCollectionView)
{
var listCollectionView = (ListCollectionView)view;
if (listCollectionView.IsAddingNew || listCollectionView.IsEditingItem) return;
}
view.Filter = CustomFilter ?? GetDefaultFilter(ItemsSource.GetType().GetGenericArguments()[0]);
}
}
public bool HasFilterText
{
get { return (bool)GetValue(HasFilterTextProperty); }
set { SetValue(HasFilterTextProperty, value); }
}
public static readonly DependencyProperty HasFilterTextProperty =
DependencyProperty.Register("HasFilterText", typeof(bool), typeof(FilterDefaultViewTextBoxBehavior), new PropertyMetadata(false));
public IEnumerable ItemsSource
{
get { return (IEnumerable)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
// Using a DependencyProperty as the backing store for ItemsSource. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(FilterDefaultViewTextBoxBehavior), new PropertyMetadata(null));
public bool? IgnoreCase { get; set; }
private Predicate<object> GetDefaultFilter(Type filterItemType)
{
Func<object, string> dataFunc;
var pInfo = filterItemType.GetProperty("FilterString");
if (pInfo == null)
{
dataFunc = (x) => string.Join(",", filterItemType.GetProperties().Where(p => !p.Name.EndsWith("Id")).Select(p => (p.GetValue(x, null) ?? string.Empty).ToString()));
}
else
{
dataFunc = (x) => (pInfo.GetValue(x, null) ?? string.Empty).ToString();
}
var filterText = AssociatedObject.Text;
var ic = IgnoreCase ?? !filterText.Any(char.IsUpper);
return x =>
{
if (x == null || string.IsNullOrEmpty(filterText)) return true;
var propValStr = dataFunc(x);
foreach (var item in filterText.Split(';'))
{
if (propValStr.IndexOf(item, ic ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == -1)
return false;
}
return true;
};
}
public Predicate<object> CustomFilter { get; set; }
public TimeSpan FilterDelay { get { return timer.Interval; } set { timer.Interval = value; } }
protected override void OnAttached()
{
base.OnAttached();
HasFilterText = !string.IsNullOrEmpty(AssociatedObject.Text);
AssociatedObject.TextChanged += AssociatedObject_TextChanged;
}
private void AssociatedObject_TextChanged(object sender, TextChangedEventArgs e)
{
timer.Stop(); timer.Start();
HasFilterText = !string.IsNullOrEmpty(AssociatedObject.Text);
}
protected override void OnDetaching()
{
AssociatedObject.TextChanged -= AssociatedObject_TextChanged;
timer.Tick -= Timer_Tick;
base.OnDetaching();
}
}
}

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{acc3c556-f8e4-4f2a-a23d-8e8749679a1b}</ProjectGuid> <ProjectGuid>{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}</ProjectGuid>
<OutputType>library</OutputType> <OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BrightSharp</RootNamespace> <RootNamespace>BrightSharp</RootNamespace>
@@ -14,7 +14,6 @@
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
@@ -32,76 +31,110 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http"/>
<Reference Include="System.Xaml"> <Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="UserControl1.xaml"> <Compile Include="Behaviors\FiterGridTextBoxBehavior.cs" />
<Generator>MSBuild:Compile</Generator> <Compile Include="Commands\AsyncCommand.cs" />
<SubType>Designer</SubType> <Compile Include="Commands\RelayCommand.cs" />
</Page> <Compile Include="Diagrams\Adorners\ResizeRotateAdorner.cs" />
<Compile Include="UserControl1.xaml.cs"> <Compile Include="Diagrams\Adorners\ResizeRotateChrome.cs" />
<DependentUpon>UserControl1.xaml</DependentUpon> <Compile Include="Diagrams\Adorners\SizeAdorner.cs" />
<Compile Include="Diagrams\Adorners\SizeChrome.cs" />
<Compile Include="Diagrams\DesignerItemDecorator.cs" />
<Compile Include="Diagrams\SelectionBehavior.cs" />
<Compile Include="Diagrams\Thumbs\MoveThumb.cs" />
<Compile Include="Diagrams\Thumbs\ResizeThumb.cs" />
<Compile Include="Diagrams\Thumbs\RotateThumb.cs" />
<Compile Include="Extensions\WpfExtensions.cs" />
<Compile Include="Mvvm\ViewModelBase.cs" />
<Compile Include="ThemeManager.cs" />
<Compile Include="ZoomControl.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Page Include="Generic.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="Converters\ThicknessConverter.cs" />
<Compile Include="Extensions\MarkupExtensionProperties.cs" />
<Compile Include="Generic.cs" />
<Page Include="Diagrams\Resources\DesignerItem.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Diagrams\Resources\ResizeRotateChrome.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Diagrams\Resources\SizeChrome.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style.Blue.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style.DarkBlue.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style.Silver.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style.DevLab.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
</Compile> </Compile>
<Compile Include="Properties\Settings.Designer.cs"> <Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="icons\app.png" />
<Resource Include="icons\copy.png" />
<Resource Include="icons\cut.png" />
<Resource Include="icons\paste.png" />
<Resource Include="icons\undo.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
@@ -110,5 +143,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -0,0 +1,70 @@
using System;
using System.Threading.Tasks;
using System.Windows.Input;
namespace BrightSharp.Commands
{
public class AsyncCommand : ICommand
{
private readonly Func<object, Task> _execute;
private readonly Func<object, bool> _canExecute;
private Action _onComplete;
private Action<Exception> _onFail;
private bool _isExecuting;
public AsyncCommand(Func<object, Task> execute) : this(execute, o => true)
{
}
public AsyncCommand(Func<object, Task> execute, Func<object, bool> canExecute)
{
_execute = execute;
_canExecute = canExecute;
}
public AsyncCommand OnComplete(Action onComplete)
{
_onComplete = onComplete;
return this;
}
public AsyncCommand OnFail(Action<Exception> onFail)
{
_onFail = onFail;
return this;
}
public bool CanExecute(object parameter)
{
return !_isExecuting && _canExecute(parameter);
}
public event EventHandler CanExecuteChanged;
public async void Execute(object parameter)
{
_isExecuting = true;
OnCanExecuteChanged();
try
{
await _execute(parameter);
_onComplete?.Invoke();
}
catch (Exception ex)
{
while (ex.InnerException != null)
ex = ex.InnerException;
_onFail?.Invoke(ex);
}
finally
{
_isExecuting = false;
OnCanExecuteChanged();
}
}
protected virtual void OnCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, new EventArgs());
}
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.Windows.Input;
namespace BrightSharp.Commands
{
public class RelayCommand : ICommand
{
private readonly Action _methodToExecute;
private readonly Action<object> _methodToExecuteWithParam;
private readonly Func<object, bool> _canExecuteEvaluator;
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public RelayCommand(Action<object> methodToExecute, Func<object, bool> canExecuteEvaluator = null)
{
_methodToExecuteWithParam = methodToExecute;
_canExecuteEvaluator = canExecuteEvaluator;
}
public bool CanExecute(object parameter)
{
if (_canExecuteEvaluator == null)
return true;
else
return _canExecuteEvaluator.Invoke(parameter);
}
public void Execute(object parameter)
{
_methodToExecuteWithParam?.Invoke(parameter);
_methodToExecute?.Invoke();
}
}
public class RelayCommand<T> : ICommand
{
private readonly Action<T> _methodToExecuteWithParam;
private readonly Func<T, bool> _canExecuteEvaluator;
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public RelayCommand(Action<T> methodToExecute, Func<T, bool> canExecuteEvaluator = null)
{
_methodToExecuteWithParam = methodToExecute;
_canExecuteEvaluator = canExecuteEvaluator;
}
public bool CanExecute(object parameter)
{
if (_canExecuteEvaluator == null)
return true;
return _canExecuteEvaluator.Invoke((T)parameter);
}
public void Execute(object parameter)
{
_methodToExecuteWithParam?.Invoke((T)parameter);
}
}
}

View File

@@ -0,0 +1,40 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace BrightSharp.Converters
{
internal class ThicknessConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(value is Thickness)
{
var offset = double.Parse(parameter.ToString(), CultureInfo.InvariantCulture.NumberFormat);
var thick = (Thickness)value;
return new Thickness(Math.Max(0, thick.Left + offset),
Math.Max(0, thick.Top + offset),
Math.Max(0, thick.Right + offset),
Math.Max(0, thick.Bottom + offset));
}
else if(value is CornerRadius)
{
var offset = double.Parse(parameter.ToString(), CultureInfo.InvariantCulture.NumberFormat);
var thick = (CornerRadius)value;
return new CornerRadius(Math.Max(0, thick.TopLeft + offset),
Math.Max(0, thick.TopRight + offset),
Math.Max(0, thick.BottomRight + offset),
Math.Max(0, thick.BottomLeft + offset));
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,47 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
namespace Diagrams
{
public class ResizeRotateAdorner : Adorner
{
private VisualCollection visuals;
private ResizeRotateChrome chrome;
protected override int VisualChildrenCount
{
get
{
return this.visuals.Count;
}
}
public ResizeRotateAdorner(ContentControl designerItem)
: base(designerItem)
{
SnapsToDevicePixels = true;
this.chrome = new ResizeRotateChrome();
this.chrome.DataContext = designerItem;
this.visuals = new VisualCollection(this);
this.visuals.Add(this.chrome);
this.Focusable = true;
}
protected override Size ArrangeOverride(Size arrangeBounds)
{
this.chrome.Arrange(new Rect(arrangeBounds));
return arrangeBounds;
}
protected override Visual GetVisualChild(int index)
{
return this.visuals[index];
}
}
}

View File

@@ -0,0 +1,13 @@
using System.Windows;
using System.Windows.Controls;
namespace Diagrams
{
public class ResizeRotateChrome : Control
{
static ResizeRotateChrome()
{
FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(ResizeRotateChrome), new FrameworkPropertyMetadata(typeof(ResizeRotateChrome)));
}
}
}

View File

@@ -0,0 +1,44 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
namespace Diagrams
{
public class SizeAdorner : Adorner
{
private SizeChrome chrome;
private VisualCollection visuals;
private ContentControl designerItem;
protected override int VisualChildrenCount
{
get
{
return this.visuals.Count;
}
}
public SizeAdorner(ContentControl designerItem)
: base(designerItem)
{
this.SnapsToDevicePixels = true;
this.designerItem = designerItem;
this.chrome = new SizeChrome();
this.chrome.DataContext = designerItem;
this.visuals = new VisualCollection(this);
this.visuals.Add(this.chrome);
}
protected override Visual GetVisualChild(int index)
{
return this.visuals[index];
}
protected override Size ArrangeOverride(Size arrangeBounds)
{
this.chrome.Arrange(new Rect(new Point(0.0, 0.0), arrangeBounds));
return arrangeBounds;
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace Diagrams
{
public class SizeChrome : Control
{
static SizeChrome()
{
FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(SizeChrome), new FrameworkPropertyMetadata(typeof(SizeChrome)));
}
}
public class DoubleFormatConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double d = (double)value;
if (double.IsNaN(d)) return "(Auto)";
return Math.Round(d);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows;
using System.Windows.Media;
using System.Windows.Input;
using System.Windows.Media.Animation;
namespace Diagrams
{
public class DesignerItemDecorator : Control
{
private Adorner adorner;
public bool ShowDecorator
{
get { return (bool)GetValue(ShowDecoratorProperty); }
set { SetValue(ShowDecoratorProperty, value); }
}
public static readonly DependencyProperty ShowDecoratorProperty =
DependencyProperty.Register("ShowDecorator", typeof(bool), typeof(DesignerItemDecorator),
new FrameworkPropertyMetadata(false, new PropertyChangedCallback(ShowDecoratorProperty_Changed)));
public DesignerItemDecorator()
{
Unloaded += new RoutedEventHandler(this.DesignerItemDecorator_Unloaded);
}
private void HideAdorner()
{
if (this.adorner != null)
{
this.adorner.Visibility = Visibility.Hidden;
}
}
private void ShowAdorner()
{
if (this.adorner == null)
{
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
if (adornerLayer != null)
{
ContentControl designerItem = this.DataContext as ContentControl;
Canvas canvas = VisualTreeHelper.GetParent(designerItem) as Canvas;
this.adorner = new ResizeRotateAdorner(designerItem);
adornerLayer.Add(this.adorner);
if (this.ShowDecorator)
{
this.adorner.Visibility = Visibility.Visible;
var anim = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(.2));
this.adorner.BeginAnimation(OpacityProperty, anim);
}
else
{
this.adorner.Visibility = Visibility.Hidden;
}
}
}
else
{
this.adorner.Visibility = Visibility.Visible;
var anim = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(.2));
this.adorner.BeginAnimation(OpacityProperty, anim);
}
}
private void DesignerItemDecorator_Unloaded(object sender, RoutedEventArgs e)
{
if (this.adorner != null)
{
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
if (adornerLayer != null)
{
adornerLayer.Remove(this.adorner);
}
this.adorner = null;
}
}
private static void ShowDecoratorProperty_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DesignerItemDecorator decorator = (DesignerItemDecorator)d;
bool showDecorator = (bool)e.NewValue;
if (showDecorator)
{
decorator.ShowAdorner();
}
else
{
decorator.HideAdorner();
}
}
}
}

View File

@@ -0,0 +1,43 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Diagrams">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="SizeChrome.xaml"/>
<ResourceDictionary Source="ResizeRotateChrome.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type s:MoveThumb}">
<Rectangle Fill="Transparent"/>
</ControlTemplate>
<Style x:Key="DesignerItemStyle" TargetType="ContentControl">
<Setter Property="MinHeight" Value="26"/>
<Setter Property="MinWidth" Value="30"/>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="MaxHeight" Value="900" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
<s:MoveThumb Focusable="False" Cursor="SizeAll" Template="{StaticResource MoveThumbTemplate}" />
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"
Margin="{TemplateBinding Padding}"/>
<s:DesignerItemDecorator x:Name="ItemDecorator" Focusable="False"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Selector.IsSelected" Value="True">
<Setter TargetName="ItemDecorator" Property="ShowDecorator" Value="True" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,112 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Diagrams">
<Style TargetType="{x:Type Shape}" x:Key="ThumbCorner">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="Stroke" Value="#FF0166AC" />
<Setter Property="StrokeThickness" Value="1" />
<Setter Property="Width" Value="7" />
<Setter Property="Height" Value="7" />
<Setter Property="Margin" Value="-2" />
<Setter Property="Fill">
<Setter.Value>
<RadialGradientBrush Center="0.2, 0.2" GradientOrigin="0.2, 0.2" RadiusX="0.8" RadiusY="0.8">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="#FF9AFF9F" Offset="0.8" />
</RadialGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type s:ResizeRotateChrome}">
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type s:ResizeRotateChrome}">
<Grid>
<Grid Opacity="0" Margin="-3">
<s:MoveThumb Margin="0,-20,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="16"
Width="16"
Cursor="SizeAll"
Template="{DynamicResource MoveThumbTemplate}" />
<s:RotateThumb Width="20"
Height="20"
Margin="0,-20,0,0"
Cursor="Hand"
VerticalAlignment="Top"
HorizontalAlignment="Center"/>
<s:ResizeThumb Height="3"
Cursor="SizeNS"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"/>
<s:ResizeThumb Width="3"
Cursor="SizeWE"
VerticalAlignment="Stretch"
HorizontalAlignment="Left"/>
<s:ResizeThumb Width="3"
Cursor="SizeWE"
VerticalAlignment="Stretch"
HorizontalAlignment="Right"/>
<s:ResizeThumb Height="3"
Cursor="SizeNS"
VerticalAlignment="Bottom"
HorizontalAlignment="Stretch"/>
<s:ResizeThumb Width="7"
Height="7"
Margin="-2"
Cursor="SizeNWSE"
VerticalAlignment="Top"
HorizontalAlignment="Left"/>
<s:ResizeThumb Width="7"
Height="7"
Margin="-2"
Cursor="SizeNESW"
VerticalAlignment="Top"
HorizontalAlignment="Right"/>
<s:ResizeThumb Width="7"
Height="7"
Margin="-2"
Cursor="SizeNESW"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"/>
<s:ResizeThumb Width="7"
Height="7"
Margin="-2"
Cursor="SizeNWSE"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
</Grid>
<Canvas HorizontalAlignment="Right" VerticalAlignment="Top">
<ContentControl Canvas.Left="10" Content="{Binding Tag}" />
</Canvas>
<Grid IsHitTestVisible="False" Opacity="1" Margin="-3">
<Rectangle SnapsToDevicePixels="True"
StrokeThickness="1"
Margin="1"
Stroke="{DynamicResource DisabledBorderBrush}" StrokeDashArray="1 0 1"/>
<Line StrokeThickness="1" X1="0" Y1="0" X2="0" Y2="20"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="0,-19,0,0"
Stroke="White" StrokeDashArray="1 2"/>
<Path Style="{StaticResource ThumbCorner}" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,-20,0,0" Width="20" Height="20" Data="M 11.7927,9.92031C 12.5184,8.74318 12.6759,7.05297 12.1717,5.75967C 11.5909,4.44354 10.2501,3.37314 8.87896,3.04485C 7.39649,2.74559 5.63977,3.1934 4.48733,4.196C 3.50995,5.1756 2.91946,6.75691 3.08599,8.14841L 0.0842173,8.57665C 0.0347556,8.20576 0.00766225,7.8312 -1.64198e-005,7.45693C 0.038148,6.21681 0.383575,4.9557 0.968669,3.8699C 1.5589,2.89611 2.36362,2.03356 3.28126,1.37902C 5.28605,0.0810452 8.05891,-0.284222 10.3301,0.412526C 12.1794,1.09169 13.9099,2.53647 14.8289,4.31779C 15.3434,5.43808 15.5957,6.72245 15.5449,7.95982C 15.4307,9.19718 15.0066,10.4344 14.358,11.484L 16.0043,12.4819L 11.226,13.5191L 10.1463,8.92239L 11.7927,9.92031 Z M -1.64198e-005,-1.90735e-006 Z M 15.564,14.9728 Z "
Fill="YellowGreen" Stroke="{DynamicResource PressedBorderBrush}" />
<Rectangle Style="{StaticResource ThumbCorner}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Rectangle Style="{StaticResource ThumbCorner}" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Rectangle Style="{StaticResource ThumbCorner}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
<Rectangle Style="{StaticResource ThumbCorner}" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
<Viewbox Width="16" Height="16" HorizontalAlignment="Right" VerticalAlignment="Top" IsHitTestVisible="False" Margin="0,-20,0,0">
<Path Width="16" Height="16" Stretch="Fill" Fill="{DynamicResource NormalBrush}" StrokeThickness=".5" Stroke="{DynamicResource GlyphBrush}" Data="M 0,8.L 3.18485,4.81417L 3.18485,6.37077L 6.37181,6.37077L 6.37181,3.18408L 4.81418,3.18408L 8.00114,0L 11.1881,3.18408L 9.63047,3.18408L 9.63047,6.37077L 12.8174,6.37077L 12.8174,4.81417L 16.0044,8.L 12.8174,11.1876L 12.8174,9.63096L 9.63047,9.63096L 9.63047,12.8177L 11.1881,12.8177L 8.00114,16.0044L 4.81418,12.8177L 6.37181,12.8177L 6.37181,9.63096L 3.18485,9.63096L 3.18485,11.1876L 0,8. Z M 0,0 Z M 16.0044,16.0044 Z"/>
</Viewbox>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,49 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Diagrams">
<s:DoubleFormatConverter x:Key="doubleFormatConverter"/>
<Style TargetType="{x:Type s:SizeChrome}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type s:SizeChrome}">
<Grid SnapsToDevicePixels="True">
<Path Stroke="Red"
StrokeThickness="1"
Height="10"
VerticalAlignment="Bottom"
Margin="-2,0,-2,-15"
Stretch="Fill"
Data="M0,0 0,10 M 0,5 100,5 M 100,0 100,10" StrokeDashArray="1 2"/>
<TextBlock Text="{Binding Path=Width, Converter={StaticResource doubleFormatConverter}}"
Background="White"
Padding="3,0,3,0"
Foreground="#FF9C3535"
Margin="0,0,0,-18"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"/>
<Path Stroke="#FF9C3535"
StrokeThickness="1"
Width="10"
HorizontalAlignment="Right"
Margin="0,-2,-15,-2"
Stretch="Fill"
Data="M5,0 5,100 M 0,0 10,0 M 0,100 10,100" StrokeDashArray="1 2"/>
<TextBlock Text="{Binding Path=Height, Converter={StaticResource doubleFormatConverter}}"
Background="White"
Foreground="#FF9C3535"
Padding="3,0,3,0"
Margin="0,0,-18,0"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<TextBlock.LayoutTransform>
<RotateTransform Angle="90" CenterX="1" CenterY="0.5"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,91 @@
using BrightSharp.Extensions;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System;
namespace BrightSharp.Diagrams
{
public static class SelectionBehavior
{
public static void Attach(FrameworkElement fe)
{
ContentControl selectedControl = null;
Style designerStyle = (Style)Application.Current.FindResource("DesignerItemStyle");
if (fe is Panel)
{
var fePanel = (Panel)fe;
fe.PreviewMouseLeftButtonDown += (s, e) =>
{
if (e.Source is DependencyObject)
{
var clickedElement = ((DependencyObject)e.OriginalSource).Ancestors<ContentControl>().FirstOrDefault(el => el.Style == designerStyle && WpfExtensions.GetItemsPanel(el.GetParent(true)) == fe);
if (clickedElement == null)
{
foreach (DependencyObject item in fePanel.Children)
{
Selector.SetIsSelected(item, false);
}
selectedControl = null;
return;
}
foreach (var control in fePanel.Children.OfType<ContentControl>())
{
if (ProcessControl(control, clickedElement, ref selectedControl))
{
e.Handled = selectedControl.Content is ButtonBase;
return;
}
}
}
};
}
else if (fe is ItemsControl)
{
var feItemsControl = (ItemsControl)fe;
fe.PreviewMouseLeftButtonDown += (s, e) =>
{
if (e.Source is DependencyObject)
{
var clickedElement = ((DependencyObject)e.Source).Ancestors<ContentControl>().FirstOrDefault(el => el.Style == designerStyle && el.Parent == fe);
if (clickedElement == null)
{
foreach (DependencyObject item in feItemsControl.Items)
{
Selector.SetIsSelected(item, false);
}
selectedControl = null;
return;
}
foreach (var control in feItemsControl.Items.OfType<ContentControl>())
{
if (ProcessControl(control, clickedElement, ref selectedControl))
{
e.Handled = selectedControl.Content is ButtonBase;
return;
}
}
}
};
}
}
private static bool ProcessControl(ContentControl control, ContentControl clickedElement, ref ContentControl selectedControl)
{
if (control == clickedElement && control != selectedControl)
{
if (selectedControl != null)
{
Selector.SetIsSelected(selectedControl, false);
}
Selector.SetIsSelected(control, true);
selectedControl = control;
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,49 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
namespace Diagrams
{
public class MoveThumb : Thumb
{
private RotateTransform rotateTransform;
private ContentControl designerItem;
public MoveThumb()
{
DragStarted += new DragStartedEventHandler(this.MoveThumb_DragStarted);
DragDelta += new DragDeltaEventHandler(this.MoveThumb_DragDelta);
}
private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
{
this.designerItem = DataContext as ContentControl;
if (this.designerItem != null)
{
this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
}
}
private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
{
if (this.designerItem != null)
{
Point dragDelta = new Point(e.HorizontalChange, e.VerticalChange);
if (this.rotateTransform != null)
{
dragDelta = this.rotateTransform.Transform(dragDelta);
}
if (double.IsNaN(Canvas.GetLeft(this.designerItem))) Canvas.SetLeft(this.designerItem, 0);
if (double.IsNaN(Canvas.GetTop(this.designerItem))) Canvas.SetTop(this.designerItem, 0);
Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + dragDelta.X);
Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + dragDelta.Y);
}
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Media;
using System.Collections.Generic;
using System.Windows.Input;
namespace Diagrams
{
public class ResizeThumb : Thumb
{
private RotateTransform rotateTransform;
private double angle;
private Adorner adorner;
private Point transformOrigin;
private ContentControl designerItem;
private Canvas canvas;
public ResizeThumb()
{
DragStarted += new DragStartedEventHandler(this.ResizeThumb_DragStarted);
DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDelta);
DragCompleted += new DragCompletedEventHandler(this.ResizeThumb_DragCompleted);
MouseRightButtonDown += new MouseButtonEventHandler(this.ResizeThumb_MouseRightButtonDown);
}
private void ResizeThumb_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
this.designerItem = this.designerItem ?? this.DataContext as ContentControl;
if (VerticalAlignment == VerticalAlignment.Top || VerticalAlignment == VerticalAlignment.Bottom)
{
this.designerItem.Height = double.NaN;
}
if (HorizontalAlignment == HorizontalAlignment.Left || HorizontalAlignment == HorizontalAlignment.Right)
{
this.designerItem.Width = double.NaN;
}
}
private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
{
this.designerItem = this.DataContext as ContentControl;
if (this.designerItem != null)
{
this.canvas = VisualTreeHelper.GetParent(this.designerItem) as Canvas;
if (this.canvas != null)
{
this.transformOrigin = this.designerItem.RenderTransformOrigin;
this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
if (this.rotateTransform != null)
{
this.angle = this.rotateTransform.Angle * Math.PI / 180.0;
}
else
{
this.angle = 0.0d;
}
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
if (adornerLayer != null)
{
this.adorner = new SizeAdorner(this.designerItem);
adornerLayer.Add(this.adorner);
}
}
}
}
private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
{
if (this.designerItem != null)
{
double deltaVertical, deltaHorizontal;
if (double.IsNaN(Canvas.GetTop(this.designerItem))) Canvas.SetTop(this.designerItem, 0);
if (double.IsNaN(Canvas.GetLeft(this.designerItem))) Canvas.SetLeft(this.designerItem, 0);
if ((VerticalAlignment == VerticalAlignment.Top || VerticalAlignment == VerticalAlignment.Bottom) && double.IsNaN(this.designerItem.Height)) this.designerItem.Height = this.designerItem.ActualHeight;
if ((HorizontalAlignment == HorizontalAlignment.Left || HorizontalAlignment == HorizontalAlignment.Right) && double.IsNaN(this.designerItem.Width)) this.designerItem.Width = this.designerItem.ActualWidth;
switch (VerticalAlignment)
{
case System.Windows.VerticalAlignment.Bottom:
deltaVertical = Math.Min(-e.VerticalChange, this.designerItem.ActualHeight - this.designerItem.MinHeight);
Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + (this.transformOrigin.Y * deltaVertical * (1 - Math.Cos(-this.angle))));
Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) - deltaVertical * this.transformOrigin.Y * Math.Sin(-this.angle));
this.designerItem.Height -= deltaVertical;
break;
case System.Windows.VerticalAlignment.Top:
deltaVertical = Math.Min(e.VerticalChange, this.designerItem.ActualHeight - this.designerItem.MinHeight);
Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + deltaVertical * Math.Cos(-this.angle) + (this.transformOrigin.Y * deltaVertical * (1 - Math.Cos(-this.angle))));
Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + deltaVertical * Math.Sin(-this.angle) - (this.transformOrigin.Y * deltaVertical * Math.Sin(-this.angle)));
this.designerItem.Height -= deltaVertical;
break;
default:
break;
}
switch (HorizontalAlignment)
{
case System.Windows.HorizontalAlignment.Left:
deltaHorizontal = Math.Min(e.HorizontalChange, this.designerItem.ActualWidth - this.designerItem.MinWidth);
Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + deltaHorizontal * Math.Sin(this.angle) - this.transformOrigin.X * deltaHorizontal * Math.Sin(this.angle));
Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + deltaHorizontal * Math.Cos(this.angle) + (this.transformOrigin.X * deltaHorizontal * (1 - Math.Cos(this.angle))));
this.designerItem.Width -= deltaHorizontal;
break;
case System.Windows.HorizontalAlignment.Right:
deltaHorizontal = Math.Min(-e.HorizontalChange, this.designerItem.ActualWidth - this.designerItem.MinWidth);
Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) - this.transformOrigin.X * deltaHorizontal * Math.Sin(this.angle));
Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + (deltaHorizontal * this.transformOrigin.X * (1 - Math.Cos(this.angle))));
this.designerItem.Width -= deltaHorizontal;
break;
default:
break;
}
}
e.Handled = true;
}
private void ResizeThumb_DragCompleted(object sender, DragCompletedEventArgs e)
{
if (this.adorner != null)
{
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
if (adornerLayer != null)
{
adornerLayer.Remove(this.adorner);
}
this.adorner = null;
}
}
}
}

View File

@@ -0,0 +1,86 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
namespace Diagrams
{
public class RotateThumb : Thumb
{
private double initialAngle;
private RotateTransform rotateTransform;
private Vector startVector;
private Point centerPoint;
private ContentControl designerItem;
private Canvas canvas;
public RotateThumb()
{
DragDelta += new DragDeltaEventHandler(this.RotateThumb_DragDelta);
DragStarted += new DragStartedEventHandler(this.RotateThumb_DragStarted);
MouseRightButtonDown += RotateThumb_MouseLeftButtonDown;
}
private void RotateThumb_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.RightButton == MouseButtonState.Pressed)
{
this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
if (this.rotateTransform != null)
{
this.rotateTransform.Angle = 0;
this.designerItem.InvalidateMeasure();
}
}
}
private void RotateThumb_DragStarted(object sender, DragStartedEventArgs e)
{
this.designerItem = DataContext as ContentControl;
if (this.designerItem != null)
{
this.canvas = VisualTreeHelper.GetParent(this.designerItem) as Canvas;
if (this.canvas != null)
{
this.centerPoint = this.designerItem.TranslatePoint(
new Point(this.designerItem.ActualWidth * this.designerItem.RenderTransformOrigin.X,
this.designerItem.ActualHeight * this.designerItem.RenderTransformOrigin.Y),
this.canvas);
Point startPoint = Mouse.GetPosition(this.canvas);
this.startVector = Point.Subtract(startPoint, this.centerPoint);
this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
if (this.rotateTransform == null)
{
this.designerItem.RenderTransform = new RotateTransform(0);
this.initialAngle = 0;
}
else
{
this.initialAngle = this.rotateTransform.Angle;
}
}
}
}
private void RotateThumb_DragDelta(object sender, DragDeltaEventArgs e)
{
if (this.designerItem != null && this.canvas != null)
{
Point currentPoint = Mouse.GetPosition(this.canvas);
Vector deltaVector = Point.Subtract(currentPoint, this.centerPoint);
double angle = Vector.AngleBetween(this.startVector, deltaVector);
RotateTransform rotateTransform = this.designerItem.RenderTransform as RotateTransform;
rotateTransform.Angle = this.initialAngle + Math.Round(angle, 0);
this.designerItem.InvalidateMeasure();
}
}
}
}

View File

@@ -0,0 +1,140 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace BrightSharp.Extensions
{
public static class MarkupExtensionProperties
{
public static CornerRadius GetCornerRadius(DependencyObject obj)
{
return (CornerRadius)obj.GetValue(CornerRadiusProperty);
}
public static void SetCornerRadius(DependencyObject obj, CornerRadius value)
{
obj.SetValue(CornerRadiusProperty, value);
}
public static object GetHeader(DependencyObject obj)
{
return obj.GetValue(HeaderProperty);
}
public static void SetHeader(DependencyObject obj, object value)
{
obj.SetValue(HeaderProperty, value);
}
public static object GetLeadingElement(DependencyObject obj)
{
return obj.GetValue(CornerRadiusProperty);
}
public static void SetLeadingElement(DependencyObject obj, object value)
{
obj.SetValue(CornerRadiusProperty, value);
}
public static object GetTrailingElement(DependencyObject obj)
{
return obj.GetValue(CornerRadiusProperty);
}
public static void SetTrailingElement(DependencyObject obj, object value)
{
obj.SetValue(CornerRadiusProperty, value);
}
public static object GetIcon(DependencyObject obj)
{
return obj.GetValue(IconProperty);
}
public static void SetIcon(DependencyObject obj, object value)
{
obj.SetValue(IconProperty, value);
}
public static void SetHeaderHeight(DependencyObject obj, double value)
{
obj.SetValue(HeaderHeightProperty, value);
}
public static double GetHeaderHeight(DependencyObject obj)
{
return (double)obj.GetValue(HeaderHeightProperty);
}
public static void SetHeaderVerticalAlignment(DependencyObject obj, VerticalAlignment value)
{
obj.SetValue(HeaderVerticalAlignmentProperty, value);
}
public static VerticalAlignment GetHeaderVerticalAlignment(DependencyObject obj)
{
return (VerticalAlignment)obj.GetValue(HeaderVerticalAlignmentProperty);
}
public static void SetHeaderHorizontalAlignment(DependencyObject obj, HorizontalAlignment value)
{
obj.SetValue(HeaderHorizontalAlignmentProperty, value);
}
public static HorizontalAlignment GetHeaderHorizontalAlignment(DependencyObject obj)
{
return (HorizontalAlignment)obj.GetValue(HeaderHorizontalAlignmentProperty);
}
public static void SetSpecialHeight(DependencyObject obj, double value)
{
obj.SetValue(SpecialHeightProperty, value);
}
public static double GetSpecialHeight(DependencyObject obj)
{
return (double)obj.GetValue(SpecialHeightProperty);
}
public static void SetSpecialWidth(DependencyObject obj, double value)
{
obj.SetValue(SpecialWidthProperty, value);
}
public static double GetSpecialWidth(DependencyObject obj)
{
return (double)obj.GetValue(SpecialWidthProperty);
}
public static Dock GetDocking(DependencyObject obj)
{
return (Dock)obj.GetValue(DockingProperty);
}
public static void SetDocking(DependencyObject obj, Dock value)
{
obj.SetValue(DockingProperty, value);
}
public static Thickness GetHeaderPadding(DependencyObject obj)
{
return (Thickness)obj.GetValue(HeaderPaddingProperty);
}
public static void SetHeaderPadding(DependencyObject obj, Thickness value)
{
obj.SetValue(HeaderPaddingProperty, value);
}
public static bool GetIsDragHelperVisible(DependencyObject obj)
{
return (bool)obj.GetValue(IsDragHelperVisibleProperty);
}
public static void SetIsDragHelperVisible(DependencyObject obj, bool value)
{
obj.SetValue(IsDragHelperVisibleProperty, value);
}
public static Brush GetSpecialBrush(DependencyObject obj)
{
return (Brush)obj.GetValue(SpecialBrushProperty);
}
public static void SetSpecialBrush(DependencyObject obj, Brush value)
{
obj.SetValue(SpecialBrushProperty, value);
}
public static readonly DependencyProperty SpecialBrushProperty = DependencyProperty.RegisterAttached("SpecialBrush", typeof(Brush), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty IsDragHelperVisibleProperty = DependencyProperty.RegisterAttached("IsDragHelperVisible", typeof(bool), typeof(MarkupExtensionProperties), new FrameworkPropertyMetadata(true));
public static readonly DependencyProperty HeaderPaddingProperty = DependencyProperty.RegisterAttached("HeaderPadding", typeof(Thickness), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty LeadingElementProperty = DependencyProperty.RegisterAttached("LeadingElement", typeof(object), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty TrailingElementProperty = DependencyProperty.RegisterAttached("TrailingElement", typeof(object), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty HeaderProperty = DependencyProperty.RegisterAttached("Header", typeof(object), typeof(MarkupExtensionProperties), new FrameworkPropertyMetadata(null));
public static readonly DependencyProperty DockingProperty = DependencyProperty.RegisterAttached("Docking", typeof(Dock), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty IconProperty = DependencyProperty.RegisterAttached("Icon", typeof(object), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty HeaderHeightProperty = DependencyProperty.RegisterAttached("HeaderHeight", typeof(double), typeof(MarkupExtensionProperties), new PropertyMetadata(null));
public static readonly DependencyProperty HeaderVerticalAlignmentProperty = DependencyProperty.RegisterAttached("HeaderVerticalAlignment", typeof(VerticalAlignment), typeof(MarkupExtensionProperties), new PropertyMetadata(VerticalAlignment.Center));
public static readonly DependencyProperty HeaderHorizontalAlignmentProperty = DependencyProperty.RegisterAttached("HeaderHorizontalAlignment", typeof(HorizontalAlignment), typeof(MarkupExtensionProperties), new PropertyMetadata(HorizontalAlignment.Left));
public static readonly DependencyProperty SpecialHeightProperty = DependencyProperty.RegisterAttached("SpecialHeight", typeof(double), typeof(MarkupExtensionProperties), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure));
public static readonly DependencyProperty SpecialWidthProperty = DependencyProperty.RegisterAttached("SpecialWidth", typeof(double), typeof(MarkupExtensionProperties), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure));
}
}

View File

@@ -0,0 +1,72 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Media3D;
namespace BrightSharp.Extensions
{
public static class WpfExtensions
{
public static DependencyObject GetParent(this DependencyObject obj, bool useLogicalTree = false)
{
if (!useLogicalTree && (obj is Visual || obj is Visual3D))
return VisualTreeHelper.GetParent(obj) ?? LogicalTreeHelper.GetParent(obj);
else
return LogicalTreeHelper.GetParent(obj);
}
public static IEnumerable<T> Ancestors<T>(this DependencyObject obj, bool useLogicalTree = false) where T : DependencyObject
{
if (obj == null) yield break;
var x = GetParent(obj, useLogicalTree);
while (x != null && !(x is T))
{
x = GetParent(x, useLogicalTree);
}
if (x != null)
yield return x as T;
else
yield break;
foreach (var item in Ancestors<T>(x, useLogicalTree))
{
yield return item;
}
}
public static T FindAncestor<T>(this DependencyObject obj) where T : DependencyObject
{
return Ancestors<T>(obj).FirstOrDefault();
}
public static Panel GetItemsPanel(DependencyObject itemsControl)
{
if (itemsControl is Panel) return (Panel)itemsControl;
ItemsPresenter itemsPresenter = GetVisualChild<ItemsPresenter>(itemsControl);
var itemsPanel = VisualTreeHelper.GetChild(itemsPresenter, 0) as Panel;
return itemsPanel;
}
public static T GetVisualChild<T>(DependencyObject parent) where T : Visual
{
T child = default(T);
int numVisuals = VisualTreeHelper.GetChildrenCount(parent);
for (int i = 0; i < numVisuals; i++)
{
Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
child = v as T;
if (child == null)
{
child = GetVisualChild<T>(v);
}
if (child != null)
{
break;
}
}
return child;
}
}
}

26
BrightSharp/Generic.cs Normal file
View File

@@ -0,0 +1,26 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
namespace BrightSharp
{
internal partial class Generic
{
private const string StyleDictionaryPattern = @"(?<=.+style\.)(.*?)(?=\.xaml)";
public void CalendarPreviewMouseUp(object sender, MouseEventArgs e)
{
if (Mouse.Captured is CalendarItem) { Mouse.Capture(null); }
}
public void DatePickerUnloaded(object sender, RoutedEventArgs e)
{
if (sender == null) return;
DependencyObject child = ((Popup)((DatePicker)sender).Template.FindName("PART_Popup", (FrameworkElement)sender))?.Child;
while (child != null && !(child is AdornerDecorator))
child = VisualTreeHelper.GetParent(child) ?? LogicalTreeHelper.GetParent(child);
if (((AdornerDecorator)child)?.Child is Calendar) ((AdornerDecorator)child).Child = null;
}
}
}

5648
BrightSharp/Generic.xaml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Windows;
namespace BrightSharp.Mvvm
{
public class ObservableObject : INotifyPropertyChanged
{
static readonly DependencyObject designTimeObject = new DependencyObject();
public static bool IsInDesignTime
{
get
{
try
{
return DesignerProperties.GetIsInDesignMode(designTimeObject);
}
catch(Exception)
{
return true;
}
}
}
protected PropertyChangedEventHandler PropertyChangedHandler
{
get
{
return PropertyChanged;
}
}
public ObservableObject()
{
}
protected static string GetPropertyName<T>(Expression<Func<T>> propertyExpression)
{
if(propertyExpression == null)
{
throw new ArgumentNullException("propertyExpression");
}
MemberExpression body = propertyExpression.Body as MemberExpression;
if(body == null)
{
throw new ArgumentException("Invalid argument", "propertyExpression");
}
PropertyInfo property = body.Member as PropertyInfo;
if(property == null)
{
throw new ArgumentException("Argument is not a property", "propertyExpression");
}
return property.Name;
}
protected virtual void RaisePropertyChanged<T>(Expression<Func<T>> propertyExpression)
{
PropertyChangedEventHandler handler = PropertyChanged;
if(handler != null)
{
handler(this, new PropertyChangedEventArgs(GetPropertyName(propertyExpression)));
}
}
protected Boolean Set<T>(Expression<Func<T>> propertyExpression, ref T field, T newValue)
{
if(EqualityComparer<T>.Default.Equals(field, newValue))
{
return false;
}
field = newValue;
this.RaisePropertyChanged(propertyExpression);
return true;
}
protected bool Set<T>(string propertyName, ref T field, T newValue)
{
if(EqualityComparer<T>.Default.Equals(field, newValue))
{
return false;
}
field = newValue;
RaisePropertyChanged(propertyName);
return true;
}
protected void RaisePropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if(handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@@ -3,6 +3,7 @@ using System.Resources;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using System.Windows.Markup;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@@ -53,3 +54,7 @@ using System.Windows;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: XmlnsPrefix("http://schemas.brightsharp.com/developer", "bs")]
[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp")]
[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp.Extensions")]
[assembly: XmlnsDefinition("http://schemas.brightsharp.com/developer", "BrightSharp.Behaviors")]

286
BrightSharp/Style.Blue.xaml Normal file
View File

@@ -0,0 +1,286 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<sys:Boolean x:Key="IsInverseTheme">False</sys:Boolean>
<CornerRadius x:Key="DefaultRadiusSmall">1</CornerRadius>
<CornerRadius x:Key="DefaultRadiusNormal">3</CornerRadius>
<CornerRadius x:Key="TabItemRadius">0,8,0,0</CornerRadius>
<CornerRadius x:Key="TabRadiusTop">0,2,2,2</CornerRadius>
<CornerRadius x:Key="TabRadiusLeft">0,5,5,0</CornerRadius>
<CornerRadius x:Key="TabRadiusRight">5,0,0,5</CornerRadius>
<CornerRadius x:Key="TabRadiusBottom">5,5,0,0</CornerRadius>
<Color x:Key="ValidationErrorColor">Red</Color>
<LinearGradientBrush x:Key="NormalBrush" StartPoint="0,1" EndPoint="0,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="1.0"/>
<GradientStop Color="#FFC4C8E6" Offset="0.6"/>
<GradientStop Color="#FFC0C4DE" Offset="0.55"/>
<GradientStop Color="#FFC6DAFF" Offset="0.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalNormalBrush" StartPoint="1,0" EndPoint="0,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="1.0"/>
<GradientStop Color="#FFC4C8E6" Offset="0.6"/>
<GradientStop Color="#FFC0C4DE" Offset="0.55"/>
<GradientStop Color="#FFC6DAFF" Offset="0.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalProgressBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF3CCF37" Offset="0.0"/>
<GradientStop Color="#FF2FA22A" Offset="0.5"/>
<GradientStop Color="#FFA6C5A5" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#00ffffff"
Offset="0" />
<GradientStop Color="#c0ffffff"
Offset="0.3" />
<GradientStop Color="#d0ffffff"
Offset="0.8" />
<GradientStop Color="#00ffffff"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateRootBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#F6BCD5FF" Offset="0.046" />
<GradientStop Color="#96D4E4FF" Offset="0.18" />
<GradientStop Color="#4FFFFFFF" Offset="0.512" />
<GradientStop Color="#00D6D6D6" Offset="0.521" />
<GradientStop Color="#BABCD5FF" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateFillBrush" EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
<LinearGradientBrush.Transform>
<TransformGroup>
<SkewTransform AngleX="-10" />
</TransformGroup>
</LinearGradientBrush.Transform>
<GradientStop Color="#FFBCD5FF" Offset="0.088" />
<GradientStop Color="#006EA4FD" Offset="0.475" />
<GradientStop Color="#FFBCD5FF" Offset="0.899" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF605CBB" Offset="0.0"/>
<GradientStop Color="#FF5B4F4F" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFACA3D4" Offset="0.0"/>
<GradientStop Color="#FF4F2A2A" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="TopLevelMenuBackgroundHover" Color="#FFFCFFBD" />
<!-- Light Brush -->
<LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="0.0"/>
<GradientStop Color="#FFD9E1F9" Offset="0.5"/>
<GradientStop Color="#FFDDDDFB" Offset="0.85"/>
<GradientStop Color="#FF9B9B9B" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="0.0"/>
<GradientStop Color="#FFD9E1F9" Offset="0.5"/>
<GradientStop Color="#FFDDDDFB" Offset="0.85"/>
<GradientStop Color="#FF9B9B9B" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Dark Brush -->
<LinearGradientBrush x:Key="DarkBrush" StartPoint="0,1" EndPoint="0,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="1.0"/>
<GradientStop Color="#FFCCD0E8" Offset="0.6"/>
<GradientStop Color="#FFC4CAF1" Offset="0.55"/>
<GradientStop Color="#FFD1E1FF" Offset="0.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalDarkBrush" StartPoint="1,0" EndPoint="0,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFCDD6F5" Offset="1.0"/>
<GradientStop Color="#FF99A6E6" Offset="0.6"/>
<GradientStop Color="#FFB5B3EC" Offset="0.55"/>
<GradientStop Color="#FFD8E8FD" Offset="0.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Pressed Brush -->
<LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF6FBC5" Offset="0.0"/>
<GradientStop Color="#FFE2D231" Offset="0.2"/>
<GradientStop Color="#FFE5FFB9" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TogglePressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF6FBC5" Offset="0.0"/>
<GradientStop Color="#FFE2D231" Offset="0.2"/>
<GradientStop Color="#FFE5FFB9" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalPressedBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF6FBC5" Offset="0.0"/>
<GradientStop Color="#FFE2D231" Offset="0.2"/>
<GradientStop Color="#FFE5FFB9" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF870000" Offset="0.0"/>
<GradientStop Color="#FF5D5D5D" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Defaulted Brush -->
<LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#777" Offset="0.0"/>
<GradientStop Color="#000" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Disabled Brush -->
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#FF303030" />
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#FFB7B7B7" />
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#FF7E7070" />
<!-- Border Brushes -->
<SolidColorBrush x:Key="SolidBorderBrush" Color="#FF1D426E" />
<SolidColorBrush x:Key="LightBorderBrush" Color="#FF9E9E9E" />
<!-- Miscellaneous Brushes -->
<LinearGradientBrush x:Key="ScrollBarPageButtonVertBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStopCollection>
<GradientStop Offset="0" Color="#FFD3DBFF" />
<GradientStop Offset="0.3" Color="White" />
<GradientStop Offset="0.7" Color="White" />
<GradientStop Offset="1" Color="#FFD3DBFF" />
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ScrollBarPageButtonHorizBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStopCollection>
<GradientStop Offset="0" Color="#FFD3DBFF" />
<GradientStop Offset="0.3" Color="White" />
<GradientStop Offset="0.7" Color="White" />
<GradientStop Offset="1" Color="#FFD3DBFF" />
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TabItemSelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFE0FFC1" Offset="0.0"/>
<GradientStop Color="#FFBCE6B2" Offset="0.2"/>
<GradientStop Color="#FFE3FFD5" Offset="0.85"/>
<GradientStop Color="White" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="MainMenuForegroundBrush" Color="Black"/>
<!--Color STYLED Brush-->
<LinearGradientBrush x:Key="WindowBackgroundBrush">
<GradientStopCollection>
<GradientStop Offset="0" Color="#EFEBF8FF" />
<GradientStop Offset="1" Color="#EFF3F3F3" />
</GradientStopCollection>
</LinearGradientBrush>
<Color x:Key="WindowBackgroundHoverColor">#FFF</Color>
<LinearGradientBrush x:Key="SelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#CC9ACBFF" Offset="0" />
<GradientStop Color="#FF7DBAFF" Offset=".3" />
<GradientStop Color="#FF7DBAFF" Offset=".7" />
<GradientStop Color="#CC9ACBFF" Offset="1" />
</LinearGradientBrush>
<SolidColorBrush x:Key="GlyphBrush" Color="#FF2B1717" />
<SolidColorBrush x:Key="LightColorBrush" Color="#E9ECF8" />
<Color x:Key="OnWindowForegroundColor">#FF1B140F</Color>
<Color x:Key="SelectedUnfocusedColor">#FFB6B6B6</Color>
<SolidColorBrush x:Key="ScrollBarBackgroundBrush" Color="#F0F0F0" />
<SolidColorBrush x:Key="SynWindowBackgroundBrush" Color="#FFD1D1D1" />
<Color x:Key="SelectedBackgroundColor">#FFE6D745</Color>
<SolidColorBrush x:Key="OnWindowForegroundBrush" Color="{DynamicResource OnWindowForegroundColor}" />
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="#FF500000" />
<Color x:Key="UiForegroundColor">Black</Color>
<SolidColorBrush x:Key="AlternatingRowBackgroundBrush" Color="White" />
<SolidColorBrush x:Key="UiForegroundBrush" Color="{DynamicResource UiForegroundColor}" />
</ResourceDictionary>

View File

@@ -0,0 +1,277 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<sys:Boolean x:Key="IsInverseTheme">True</sys:Boolean>
<CornerRadius x:Key="DefaultRadiusSmall">1</CornerRadius>
<CornerRadius x:Key="DefaultRadiusNormal">3</CornerRadius>
<CornerRadius x:Key="TabItemRadius">0,8,0,0</CornerRadius>
<CornerRadius x:Key="TabRadiusTop">0,2,2,2</CornerRadius>
<CornerRadius x:Key="TabRadiusLeft">0,5,5,0</CornerRadius>
<CornerRadius x:Key="TabRadiusRight">5,0,0,5</CornerRadius>
<CornerRadius x:Key="TabRadiusBottom">5,5,0,0</CornerRadius>
<Color x:Key="SelectedBackgroundColor" >#99BDFF</Color>
<Color x:Key="SelectedUnfocusedColor" >#999999</Color>
<Color x:Key="ControlLightColor" >#FF2F596E</Color>
<Color x:Key="ControlMediumColor" >#FF10405B</Color>
<Color x:Key="ControlDarkColor" >#FF2B404B</Color>
<Color x:Key="ControlMouseOverColor" >#FFA5A7BA</Color>
<Color x:Key="ControlPressedColor" >#FF47909B</Color>
<Color x:Key="ValidationErrorColor" >#FF3333</Color>
<Color x:Key="UiForegroundColor">#ffffff</Color>
<SolidColorBrush x:Key="UiForegroundBrush" Color="White" />
<Color x:Key="WindowBackgroundHoverColor">#555555</Color>
<SolidColorBrush x:Key="TopLevelMenuBackgroundHover" Color="#FF414566" />
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#FF575757" />
<SolidColorBrush x:Key="SolidBorderBrush" Color="Black" />
<SolidColorBrush x:Key="LightBorderBrush" Color="DarkGray" />
<SolidColorBrush x:Key="MainMenuForegroundBrush" Color="White"/>
<LinearGradientBrush x:Key="WindowBackgroundBrush">
<GradientStop Color="#444444" />
</LinearGradientBrush>
<SolidColorBrush x:Key="GlyphBrush" Color="#ffffff" />
<SolidColorBrush x:Key="LightColorBrush" Color="#FF57575F" />
<Color x:Key="OnWindowForegroundColor">White</Color>
<SolidColorBrush x:Key="OnWindowForegroundBrush" Color="{DynamicResource OnWindowForegroundColor}" />
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#bbb" />
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#FF303030" />
<SolidColorBrush x:Key="ScrollBarBackgroundBrush" Color="#FF404040" />
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="AlternatingRowBackgroundBrush" Color="#555555" />
<LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF08547D" Offset="0.02"/>
<GradientStop Color="#FF2A546A" Offset="0.25"/>
<GradientStop Color="#FF1F3A49" Offset="0.75"/>
<GradientStop Color="#FF3A6F90" Offset="1"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalNormalBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF2F596E" Offset="0.02"/>
<GradientStop Color="#FF10405B" Offset="1"/>
<GradientStop Color="#FF2B404B" Offset="0.209"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF7A8DAA" Offset="0.0"/>
<GradientStop Color="#FF4B4B4B" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF6C6C6C" Offset="0.0"/>
<GradientStop Color="#FF8B8B8B" Offset=".5"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Light Brush -->
<LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF616161" Offset="0.0"/>
<GradientStop Color="#FF3F3E49" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF2F4249" Offset="0"/>
<GradientStop Color="#FF2D566C" Offset="1"/>
<GradientStop Color="#FF004161" Offset="0.507"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalDarkBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF5C7783" Offset="0.0"/>
<GradientStop Color="#FF47545B" Offset="1"/>
<GradientStop Color="#FF134B66" Offset="0.557"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Pressed Brush -->
<LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF7599AA" Offset="0.0"/>
<GradientStop Color="#FF37738F" Offset="1.0"/>
<GradientStop Color="#FF306178" Offset="0.55"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TogglePressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF7599AA" Offset="0.0"/>
<GradientStop Color="#FF37738F" Offset="1.0"/>
<GradientStop Color="#FF306178" Offset="0.55"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalPressedBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF7599AA" Offset="0.0"/>
<GradientStop Color="#FF37738F" Offset="1.0"/>
<GradientStop Color="#FF306178" Offset="0.55"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#444" Offset="0.0"/>
<GradientStop Color="#888" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Defaulted Brush -->
<LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#777" Offset="0.3"/>
<GradientStop Color="#000" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Disabled Brush -->
<!-- Border Brushes -->
<!-- Miscellaneous Brushes -->
<LinearGradientBrush x:Key="ScrollBarPageButtonVertBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStopCollection>
<GradientStop Offset="0" Color="#FF707070" />
<GradientStop Offset="0.3" Color="#FF494949" />
<GradientStop Offset="0.7" Color="#FF494949" />
<GradientStop Offset="1" Color="#FF707070" />
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ScrollBarPageButtonHorizBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStopCollection>
<GradientStop Offset="0" Color="#FF707070" />
<GradientStop Offset="0.3" Color="#FF494949" />
<GradientStop Offset="0.7" Color="#FF494949" />
<GradientStop Offset="1" Color="#FF707070" />
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TabItemSelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF3DE459" Offset="0"/>
<GradientStop Color="#FF0071A8" Offset="0.05"/>
<GradientStop Color="#FF0071A8" Offset="0.5"/>
<GradientStop Color="#FF0B374F" Offset="1"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!--Color STYLED Brush-->
<LinearGradientBrush x:Key="SelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#CC9ACBFF" Offset="0" />
<GradientStop Color="#FF7DBAFF" Offset=".3" />
<GradientStop Color="#FF7DBAFF" Offset=".7" />
<GradientStop Color="#CC9ACBFF" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF616161" Offset="0.0"/>
<GradientStop Color="#FF3F3E49" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ListViewFileItemBrush">
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateRootBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#F6BCD5FF" Offset="0.046" />
<GradientStop Color="#96D4E4FF" Offset="0.18" />
<GradientStop Color="#4FFFFFFF" Offset="0.512" />
<GradientStop Color="#00D6D6D6" Offset="0.521" />
<GradientStop Color="#BABCD5FF" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateFillBrush" EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
<LinearGradientBrush.Transform>
<TransformGroup>
<SkewTransform AngleX="-10" />
</TransformGroup>
</LinearGradientBrush.Transform>
<GradientStop Color="#FFBCD5FF" Offset="0.088" />
<GradientStop Color="#006EA4FD" Offset="0.475" />
<GradientStop Color="#FFBCD5FF" Offset="0.899" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalProgressBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF9BA8FD" Offset="0.0"/>
<GradientStop Color="#FF0B1C89" Offset="0.4"/>
<GradientStop Color="#FF4B678F" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#00eeeeee"
Offset="0" />
<GradientStop Color="#c0eeeeee"
Offset="0.3" />
<GradientStop Color="#d0eeeeee"
Offset="0.8" />
<GradientStop Color="#00eeeeee"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</ResourceDictionary>

View File

@@ -0,0 +1,236 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<system:Boolean x:Key="IsInverseTheme">False</system:Boolean>
<CornerRadius x:Key="DefaultRadiusSmall">0</CornerRadius>
<CornerRadius x:Key="DefaultRadiusNormal">1</CornerRadius>
<CornerRadius x:Key="TabRadiusTop">0</CornerRadius>
<CornerRadius x:Key="TabRadiusLeft">0</CornerRadius>
<CornerRadius x:Key="TabRadiusRight">0</CornerRadius>
<CornerRadius x:Key="TabRadiusBottom">0</CornerRadius>
<CornerRadius x:Key="TabItemRadius">0,2,0,0</CornerRadius>
<Color x:Key="ValidationErrorColor">Red</Color>
<SolidColorBrush x:Key="NormalBrush" Color="#FFDFE1EF" />
<SolidColorBrush x:Key="VerticalNormalBrush" Color="#FFDFE1EF" />
<LinearGradientBrush x:Key="ProgressBarIndeterminateRootBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#F6BCD5FF" Offset="0.046" />
<GradientStop Color="#96D4E4FF" Offset="0.18" />
<GradientStop Color="#4FFFFFFF" Offset="0.512" />
<GradientStop Color="#00D6D6D6" Offset="0.521" />
<GradientStop Color="#BABCD5FF" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateFillBrush" EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
<LinearGradientBrush.Transform>
<TransformGroup>
<SkewTransform AngleX="-10" />
</TransformGroup>
</LinearGradientBrush.Transform>
<GradientStop Color="#FFBCD5FF" Offset="0.088" />
<GradientStop Color="#006EA4FD" Offset="0.475" />
<GradientStop Color="#FFBCD5FF" Offset="0.899" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalProgressBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF678D66" Offset="0.0"/>
<GradientStop Color="#FF2FA22A" Offset="0.4"/>
<GradientStop Color="#FF576A56" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#00ffffff"
Offset="0" />
<GradientStop Color="#c0ffffff"
Offset="0.3" />
<GradientStop Color="#d0ffffff"
Offset="0.8" />
<GradientStop Color="#00ffffff"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#CCC" Offset="0.0"/>
<GradientStop Color="#444" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#CCC" Offset="0.0"/>
<GradientStop Color="#444" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="TopLevelMenuBackgroundHover" Color="White" />
<!-- Light Brush -->
<LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Dark Brush -->
<LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#FFD7DDFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalDarkBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#FFD7DDFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Pressed Brush -->
<LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="0.0"/>
<GradientStop Color="#FFFFBC8D" Offset="0.1"/>
<GradientStop Color="#FFFFB49E" Offset="0.796"/>
<GradientStop Color="#FFFFF4F4" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TogglePressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="0.0"/>
<GradientStop Color="#FFFFBC8D" Offset="0.1"/>
<GradientStop Color="#FFFFB49E" Offset="0.796"/>
<GradientStop Color="#FFFFF4F4" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalPressedBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="0.0"/>
<GradientStop Color="#FFFFBC8D" Offset="0.1"/>
<GradientStop Color="#FFFFB49E" Offset="0.796"/>
<GradientStop Color="#FFFFF4F4" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#444" Offset="0.0"/>
<GradientStop Color="#444" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Defaulted Brush -->
<SolidColorBrush x:Key="DefaultedBorderBrush" Color="Black"/>
<!-- Disabled Brush -->
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
<!-- Border Brushes -->
<SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
<SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />
<!-- Miscellaneous Brushes -->
<SolidColorBrush x:Key="ScrollBarPageButtonVertBrush" Color="#FFF3F3F3" />
<SolidColorBrush x:Key="ScrollBarPageButtonHorizBrush" Color="White" />
<SolidColorBrush x:Key="TabItemSelectedBackgroundBrush" Color="#FFF0E0FF"/>
<SolidColorBrush x:Key="MainMenuForegroundBrush" Color="Black"/>
<!--Color STYLED Brush-->
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="White" />
<Color x:Key="WindowBackgroundHoverColor">White</Color>
<SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#FFFFE0E0" />
<SolidColorBrush x:Key="GlyphBrush" Color="#444" />
<SolidColorBrush x:Key="LightColorBrush" Color="#FFF3F3F3" />
<Color x:Key="OnWindowForegroundColor">Black</Color>
<SolidColorBrush x:Key="OnWindowForegroundBrush" Color="{DynamicResource OnWindowForegroundColor}" />
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#FF4D4D4D" />
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
<LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="White" Offset="0.0"/>
<GradientStop Color="#FFF3F3F3" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="ScrollBarBackgroundBrush" Color="#F0F0F0" />
<SolidColorBrush x:Key="SynWindowBackgroundBrush" Color="#FFE4E4E4" />
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="#FF500000" />
<Color x:Key="UiForegroundColor">Black</Color>
<SolidColorBrush x:Key="UiForegroundBrush" Color="{DynamicResource UiForegroundColor}" />
<SolidColorBrush x:Key="AlternatingRowBackgroundBrush" Color="White" />
<Color x:Key="SelectedBackgroundColor">#C5C5C5</Color>
<Color x:Key="SelectedUnfocusedColor">#FFB6B6B6</Color>
<Color x:Key="ControlLightColor">#FFFFFFFF</Color>
<Color x:Key="ControlMediumColor">#FFC5C5C5</Color>
<Color x:Key="ControlDarkColor">#FF6B6B6B</Color>
<Color x:Key="ControlMouseOverColor">#FFA5A7BA</Color>
<Color x:Key="ControlPressedColor">#FF47909B</Color>
</ResourceDictionary>

View File

@@ -0,0 +1,284 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<sys:Boolean x:Key="IsInverseTheme">False</sys:Boolean>
<CornerRadius x:Key="DefaultRadiusSmall">1</CornerRadius>
<CornerRadius x:Key="DefaultRadiusNormal">3</CornerRadius>
<CornerRadius x:Key="TabItemRadius">0,8,0,0</CornerRadius>
<CornerRadius x:Key="TabRadiusTop">0,2,2,2</CornerRadius>
<CornerRadius x:Key="TabRadiusLeft">0,5,5,0</CornerRadius>
<CornerRadius x:Key="TabRadiusRight">5,0,0,5</CornerRadius>
<CornerRadius x:Key="TabRadiusBottom">5,5,0,0</CornerRadius>
<Color x:Key="ValidationErrorColor">Red</Color>
<LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#CCC" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalNormalBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#CCC" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateRootBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#F6BCD5FF" Offset="0.046" />
<GradientStop Color="#96D4E4FF" Offset="0.18" />
<GradientStop Color="#4FFFFFFF" Offset="0.512" />
<GradientStop Color="#00D6D6D6" Offset="0.521" />
<GradientStop Color="#BABCD5FF" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndeterminateFillBrush" EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
<LinearGradientBrush.Transform>
<TransformGroup>
<SkewTransform AngleX="-10" />
</TransformGroup>
</LinearGradientBrush.Transform>
<GradientStop Color="#FFBCD5FF" Offset="0.088" />
<GradientStop Color="#006EA4FD" Offset="0.475" />
<GradientStop Color="#FFBCD5FF" Offset="0.899" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalProgressBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FF9B9B9B" Offset="0"/>
<GradientStop Color="#FFB9B9B9" Offset="0.5"/>
<GradientStop Color="#FFE8E8E8" Offset="1"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#00ffffff"
Offset="0" />
<GradientStop Color="#c0ffffff"
Offset="0.3" />
<GradientStop Color="#d0ffffff"
Offset="0.8" />
<GradientStop Color="#00ffffff"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#CCC" Offset="0.0"/>
<GradientStop Color="#444" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#CCC" Offset="0.0"/>
<GradientStop Color="#444" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="TopLevelMenuBackgroundHover" Color="Pink" />
<!-- Light Brush -->
<LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Dark Brush -->
<LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#AAA" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalDarkBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#AAA" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Pressed Brush -->
<LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#BBB" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="0.1"/>
<GradientStop Color="#EEE" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TogglePressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#E8D4D4" Offset="0.0"/>
<GradientStop Color="#E3E8A6" Offset="0.1"/>
<GradientStop Color="#ECF699" Offset="0.796"/>
<GradientStop Color="#F3F3F3" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="VerticalPressedBrush" StartPoint="0,0" EndPoint="1,0">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#BBB" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="0.1"/>
<GradientStop Color="#EEE" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#444" Offset="0.0"/>
<GradientStop Color="#888" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Defaulted Brush -->
<LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#777" Offset="0.3"/>
<GradientStop Color="#000" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Disabled Brush -->
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
<!-- Border Brushes -->
<SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
<SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />
<!-- Miscellaneous Brushes -->
<LinearGradientBrush x:Key="ScrollBarPageButtonVertBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStopCollection>
<GradientStop Offset="0" Color="#FFD3DBFF" />
<GradientStop Offset="0.3" Color="White" />
<GradientStop Offset="0.7" Color="White" />
<GradientStop Offset="1" Color="#FFD3DBFF" />
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ScrollBarPageButtonHorizBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStopCollection>
<GradientStop Offset="0" Color="#FFD3DBFF" />
<GradientStop Offset="0.3" Color="White" />
<GradientStop Offset="0.7" Color="White" />
<GradientStop Offset="1" Color="#FFD3DBFF" />
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TabItemSelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#BBB" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="0.1"/>
<GradientStop Color="#EEE" Offset="0.85"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="MainMenuForegroundBrush" Color="Black"/>
<!--Color STYLED Brush-->
<LinearGradientBrush x:Key="WindowBackgroundBrush">
<GradientStop Color="#EEE" />
</LinearGradientBrush>
<Color x:Key="WindowBackgroundHoverColor">#FFF</Color>
<LinearGradientBrush x:Key="SelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#CC9ACBFF" Offset="0" />
<GradientStop Color="#FF7DBAFF" Offset=".3" />
<GradientStop Color="#FF7DBAFF" Offset=".7" />
<GradientStop Color="#CC9ACBFF" Offset="1" />
</LinearGradientBrush>
<SolidColorBrush x:Key="GlyphBrush" Color="#444" />
<SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />
<Color x:Key="OnWindowForegroundColor">Black</Color>
<SolidColorBrush x:Key="OnWindowForegroundBrush" Color="{DynamicResource OnWindowForegroundColor}" />
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#FF4D4D4D" />
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
<SolidColorBrush x:Key="AlternatingRowBackgroundBrush" Color="White" />
<LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFF" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="ScrollBarBackgroundBrush" Color="#F0F0F0" />
<SolidColorBrush x:Key="SynWindowBackgroundBrush" Color="#FFE4E4E4" />
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="DarkRed" />
<Color x:Key="UiForegroundColor">Black</Color>
<SolidColorBrush x:Key="UiForegroundBrush" Color="{DynamicResource UiForegroundColor}" />
<Color x:Key="SelectedBackgroundColor">SkyBlue</Color>
<Color x:Key="SelectedUnfocusedColor">#FFB6B6B6</Color>
<Color x:Key="ControlLightColor">#FFFFFFFF</Color>
<Color x:Key="ControlMediumColor">#FFC5C5C5</Color>
<Color x:Key="ControlDarkColor">#FF6B6B6B</Color>
<Color x:Key="ControlMouseOverColor">#FFA5A7BA</Color>
<Color x:Key="ControlPressedColor">#FF47909B</Color>
</ResourceDictionary>

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
namespace BrightSharp
{
public enum ColorThemes
{
Classic,
DevLab,
Silver,
Blue,
DarkBlue
}
public static class ThemeManager
{
private const string StyleDictionaryPattern = @"(?<=.+style\.)(.*?)(?=\.xaml)";
public static ColorThemes Theme
{
get
{
var curStyleRes = Resources.Where(r => r.Source != null &&
Regex.IsMatch(r.Source.OriginalString, StyleDictionaryPattern, RegexOptions.IgnoreCase)).FirstOrDefault();
if (curStyleRes == null) return ColorThemes.Classic;
var match = Regex.Match(curStyleRes.Source.OriginalString, StyleDictionaryPattern, RegexOptions.IgnoreCase);
return (ColorThemes)Enum.Parse(typeof(ColorThemes), match.Value, true);
}
set
{
var curStyleRes = Resources.Where(r => r.Source != null &&
Regex.IsMatch(r.Source.OriginalString, StyleDictionaryPattern, RegexOptions.IgnoreCase)).FirstOrDefault();
if (curStyleRes != null)
Resources.Remove(curStyleRes);
if (value == ColorThemes.Classic)
return;
Resources.Add(new ResourceDictionary()
{
Source = new Uri($"/brightsharp;component/style.{value}.xaml", UriKind.RelativeOrAbsolute)
});
}
}
private static ICollection<ResourceDictionary> Resources
{
get { return Application.Current.Resources.MergedDictionaries; }
}
}
}

View File

@@ -1,12 +0,0 @@
<UserControl x:Class="BrightSharp.UserControl1"
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"
xmlns:local="clr-namespace:BrightSharp"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>

View File

@@ -1,28 +0,0 @@
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 BrightSharp
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
}
}

210
BrightSharp/ZoomControl.cs Normal file
View File

@@ -0,0 +1,210 @@
using BrightSharp.Extensions;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media.Animation;
using BrightSharp.Diagrams;
namespace BrightSharp
{
public partial class ZoomControl : ItemsControl
{
public ZoomControl()
{
Loaded += ZoomControl_Loaded;
}
private void ZoomControl_Loaded(object sender, RoutedEventArgs e)
{
SelectionBehavior.Attach(this);
}
public ContentControl SelectedControl
{
get { return (ContentControl)GetValue(SelectedControlProperty); }
set { SetValue(SelectedControlProperty, value); }
}
public static readonly DependencyProperty SelectedControlProperty =
DependencyProperty.Register("SelectedControl", typeof(ContentControl), typeof(ZoomControl), new PropertyMetadata(null));
protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
{
base.OnPreviewMouseDown(e);
if (e.MiddleButton == MouseButtonState.Pressed)
{
_panPoint = e.GetPosition(this);
}
}
private Point? _panPoint;
#region Props
public double TranslateX
{
get { return (double)GetValue(TranslateXProperty); }
set { SetValue(TranslateXProperty, value); }
}
public static readonly DependencyProperty TranslateXProperty =
DependencyProperty.Register("TranslateX", typeof(double), typeof(ZoomControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsArrange, TranslateChangedHandler));
public double TranslateY
{
get { return (double)GetValue(TranslateYProperty); }
set { SetValue(TranslateYProperty, value); }
}
public static readonly DependencyProperty TranslateYProperty =
DependencyProperty.Register("TranslateY", typeof(double), typeof(ZoomControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsArrange, TranslateChangedHandler));
public double RenderZoom
{
get { return (double)GetValue(RenderZoomProperty); }
set { SetValue(RenderZoomProperty, value); }
}
public static readonly DependencyProperty RenderZoomProperty =
DependencyProperty.Register("RenderZoom", typeof(double), typeof(ZoomControl), new FrameworkPropertyMetadata(1.0, FrameworkPropertyMetadataOptions.AffectsArrange, ZoomChangedHandler));
private static void ZoomChangedHandler(DependencyObject d, DependencyPropertyChangedEventArgs baseValue)
{
ZoomControl zc = (ZoomControl)d;
}
private static void TranslateChangedHandler(DependencyObject d, DependencyPropertyChangedEventArgs baseValue)
{
ZoomControl zc = (ZoomControl)d;
}
#endregion
private static readonly RoutedEvent ZoomChangedEvent = EventManager.RegisterRoutedEvent("ZoomChanged", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ZoomControl));
public event RoutedEventHandler ZoomChanged
{
add { AddHandler(ZoomChangedEvent, value); }
remove { RemoveHandler(ZoomChangedEvent, value); }
}
private void RaiseZoomChangedEvent()
{
var newEventArgs = new RoutedEventArgs(ZoomChangedEvent);
RaiseEvent(newEventArgs);
}
static ZoomControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ZoomControl), new FrameworkPropertyMetadata(typeof(ZoomControl)));
}
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
{
if (CheckMouseOverControlWheelHandle(_panPoint.HasValue))
return;
var point = e.GetPosition(this);
var oldValue = RenderZoom;
const double zoomPower = 1.25;
var newValue = RenderZoom * (e.Delta > 0 ? zoomPower : 1 / zoomPower);
if (UseAnimation)
{
DoubleAnimation anim = new DoubleAnimation(newValue, TimeSpan.FromSeconds(.3));
anim.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseInOut };
this.BeginAnimation(ZoomControl.RenderZoomProperty, anim);
}
else
{
RenderZoom = newValue;
}
RaiseZoomChangedEvent();
var translateXTo = CoercePanTranslate(TranslateX, point.X, oldValue, newValue);
var translateYTo = CoercePanTranslate(TranslateY, point.Y, oldValue, newValue);
if (UseAnimation)
{
DoubleAnimation anim = new DoubleAnimation(translateXTo, TimeSpan.FromSeconds(.3));
anim.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseInOut };
this.BeginAnimation(ZoomControl.TranslateXProperty, anim);
anim = new DoubleAnimation(translateYTo, TimeSpan.FromSeconds(.3));
anim.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseInOut };
this.BeginAnimation(ZoomControl.TranslateYProperty, anim);
}
else
{
TranslateX = translateXTo; TranslateY = translateYTo;
}
e.Handled = true;
base.OnPreviewMouseWheel(e);
}
public bool UseAnimation { get; set; }
private static bool CheckMouseOverControlWheelHandle(bool checkFlowDoc = false)
{
if (Keyboard.IsKeyDown(Key.LeftCtrl)) return false;
var element = Mouse.DirectlyOver as DependencyObject;
if (element is ScrollViewer) return true;
var scrollViewer = element.FindAncestor<ScrollViewer>();
if (scrollViewer != null)
{
return scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Visible
|| scrollViewer.ComputedHorizontalScrollBarVisibility == Visibility.Visible;
}
if (checkFlowDoc)
{
var flowDocument = element.FindAncestor<FlowDocument>();
if (flowDocument != null)
{
return true;
}
}
return false;
}
private static double CoercePanTranslate(double oldTranslate, double mousePos, double oldZoom, double newZoom)
{
return Math.Round(oldTranslate + (oldTranslate - mousePos) * (newZoom - oldZoom) / oldZoom);
}
protected override void OnMouseUp(MouseButtonEventArgs e)
{
base.OnMouseUp(e);
if (e.MiddleButton == MouseButtonState.Released)
{
_panPoint = null;
ReleaseMouseCapture();
}
}
protected override void OnPreviewMouseMove(MouseEventArgs e)
{
base.OnPreviewMouseMove(e);
if (e.MiddleButton == MouseButtonState.Pressed && _panPoint.HasValue)
{
//PAN MODE
var vector = e.GetPosition(this) - _panPoint.Value;
_panPoint = _panPoint + vector;
CaptureMouse();
TranslateX += vector.X;
TranslateY += vector.Y;
BeginAnimation(TranslateXProperty, null);
BeginAnimation(TranslateYProperty, null);
}
}
}
}

BIN
BrightSharp/icons/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

BIN
BrightSharp/icons/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

BIN
BrightSharp/icons/cut.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

BIN
BrightSharp/icons/paste.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

BIN
BrightSharp/icons/undo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="JetFrames.AppleJobs.Editor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="Default" providerName="MySql.Data.MySqlClient" connectionString="server=138.201.230.158;user id=admin_applejobs;pwd=dPARP0etzx;database=admin_applejobs_dev;CharSet=utf8;" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider></providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data><userSettings>
<JetFrames.AppleJobs.Editor.Properties.Settings>
<setting name="Grid01LayoutX" serializeAs="String">
<value>0</value>
</setting>
<setting name="Grid01LayoutY" serializeAs="String">
<value>0</value>
</setting>
<setting name="Grid01LayoutWidth" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid01LayoutHeight" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid02LayoutX" serializeAs="String">
<value>100</value>
</setting>
<setting name="Grid03LayoutX" serializeAs="String">
<value>200</value>
</setting>
<setting name="Grid04LayoutX" serializeAs="String">
<value>300</value>
</setting>
<setting name="Grid02LayoutY" serializeAs="String">
<value>100</value>
</setting>
<setting name="Grid03LayoutY" serializeAs="String">
<value>200</value>
</setting>
<setting name="Grid04LayoutY" serializeAs="String">
<value>300</value>
</setting>
<setting name="Grid02LayoutWidth" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid03LayoutWidth" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid04LayoutWidth" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid02LayoutHeight" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid03LayoutHeight" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid04LayoutHeight" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid01Expanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="Grid02Expanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="Grid03Expanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="Grid04Expanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="ZoomPadX" serializeAs="String">
<value>0</value>
</setting>
<setting name="ZoomPadY" serializeAs="String">
<value>0</value>
</setting>
<setting name="Zoom" serializeAs="String">
<value>1</value>
</setting>
<setting name="Grid05Expanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="Grid05LayoutX" serializeAs="String">
<value>400</value>
</setting>
<setting name="Grid05LayoutY" serializeAs="String">
<value>0</value>
</setting>
<setting name="Grid05LayoutWidth" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="Grid05LayoutHeight" serializeAs="String">
<value>NaN</value>
</setting>
</JetFrames.AppleJobs.Editor.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -0,0 +1,14 @@
<Application x:Class="JetFrames.AppleJobs.Editor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/brightsharp;component/generic.xaml" />
</ResourceDictionary.MergedDictionaries>
<local:ViewModelLocator x:Key="ViewModelLocator" />
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace JetFrames.AppleJobs.Editor
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
}
public static ViewModelLocator Locator { get { return (ViewModelLocator)Current.TryFindResource("ViewModelLocator"); } }
}
}

View File

@@ -0,0 +1,27 @@
using AppleJobs.Data.Models.ModelsJobs;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace JetFrames.AppleJobs.Editor.Converters
{
public class ModelFilterConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var initCollection = (IEnumerable<ModelJob>)values[0];
var modelJob = (ModelJob)values[1];
if (modelJob == null) return initCollection;
return initCollection.Where(mj => mj.Models_Id == modelJob.Models_Id);
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,334 @@
using BrightSharp.Mvvm;
using System.Collections.Generic;
using System.Linq;
using AppleJobs.Data;
using AppleJobs.Data.Models.ModelsJobs;
using System.Windows.Input;
using BrightSharp.Commands;
using System.Data.Entity;
using System.Windows;
using BrightSharp.Extensions;
using System.Windows.Controls;
using System.Windows.Data;
using System;
using AppleJobs.Data.Models;
using JetFrames.AppleJobs.Editor.Views;
using JetFrames.AppleJobs.Editor.ViewModels;
using System.Collections;
namespace JetFrames.AppleJobs.Editor
{
public class EditorViewModel : ObservableObject
{
private AppleJobsContext context;
public EditorViewModel(AppleJobsContext context)
{
this.context = context;
}
public string Name { get; set; }
public string Email { get; set; }
List<Model> _models;
public IEnumerable<Model> Models
{
get
{
return _models ?? (_models = context.Models.ToList());
}
}
List<ModelCategory> _categories;
public IEnumerable<ModelCategory> Categories
{
get
{
return _categories ?? (_categories = context.ModelCategories.ToList());
}
}
public void OnLoaded()
{
}
public bool CanAdd(object item)
{
if (item is ModelJobPriceTemplate)
{
var mjpt = (ModelJobPriceTemplate)item;
return mjpt.Customers_Id != default(int) &&
mjpt.ModelJobs_Id != default(int);
}
else if (item is ModelJob)
{
var mj = (ModelJob)item;
return !string.IsNullOrWhiteSpace(mj.Name) &&
mj.Models_Id != default(int);
}
else if (item is Model)
{
var m = (Model)item;
return !string.IsNullOrWhiteSpace(m.Name) &&
m.ModelCategories_Id != default(int);
}
else if (item is ModelCategory)
{
var mc = (ModelCategory)item;
return !string.IsNullOrWhiteSpace(mc.Name);
}
return true;
}
List<ModelJobPriceTemplate> _modelJobPriceTemplates;
public IEnumerable<ModelJobPriceTemplate> ModelJobPriceTemplates
{
get
{
if (ModelJobs == null) throw new InvalidOperationException();
return _modelJobPriceTemplates ?? (_modelJobPriceTemplates = context.ModelJobPriceTemplates.ToList());
}
}
List<ModelJob> _modelJobs;
public IEnumerable<ModelJob> ModelJobs
{
get
{
return _modelJobs ?? (_modelJobs = context.ModelJobs.ToList());
}
}
List<Order> _orders;
public IEnumerable<Order> Orders
{
get
{
return _orders ?? (_orders = context.Orders.Take(1000).ToList());
}
}
List<OrderStatus> _orderStatuses;
public IEnumerable<OrderStatus> OrderStatuses
{
get
{
return _orderStatuses ?? (_orderStatuses = context.OrderStatuses.ToList());
}
}
List<Accessories> _accessories;
public IEnumerable<Accessories> Accessories
{
get
{
return _accessories ?? (_accessories = context.Accessories.ToList());
}
}
List<Employee> _employees;
public IEnumerable<Employee> Employees
{
get
{
return _employees ?? (_employees = context.Employees.ToList());
}
}
public ICommand SaveCommand
{
get
{
return new AsyncCommand(p =>
{
var dg = (Keyboard.FocusedElement as UIElement).FindAncestor<DataGrid>();
if (dg != null)
{
dg.CommitEdit(DataGridEditingUnit.Row, true);
}
return context.SaveChangesAsync();
})
.OnComplete(() => ShowMessage("Сохранено"))
.OnFail(ex => ShowMessage("Ошибка при сохранении.", "Red"));
}
}
public ICommand RefreshCommand
{
get
{
return new RelayCommand(p =>
{
_categories = null;
_modelJobPriceTemplates = null;
_models = null;
_modelJobs = null;
_accessories = null;
_employees = null;
_orders = null;
_orderStatuses = null;
foreach (var entity in context.ChangeTracker.Entries())
{
entity.State = EntityState.Detached;
}
RaisePropertyChanged(nameof(Categories));
RaisePropertyChanged(nameof(ModelJobPriceTemplates));
RaisePropertyChanged(nameof(Models));
RaisePropertyChanged(nameof(ModelJobs));
RaisePropertyChanged(nameof(Accessories));
RaisePropertyChanged(nameof(Employees));
RaisePropertyChanged(nameof(Orders));
RaisePropertyChanged(nameof(OrderStatuses));
ShowMessage("Обновлено из базы данных");
OnLoaded();
});
}
}
public ICommand AddNewPriceTemplateCommand
{
get
{
return new RelayCommand(p =>
{
var vm = new NewPriceTemplateVm(Models, ModelJobs, ModelJobPriceTemplates, CreateNewModelJobPriceTemplate);
var dialog = new NewPriceTemplateDialog
{
DataContext = vm,
Owner = Application.Current.MainWindow
};
if (dialog.ShowDialog() == true)
{
CreateNewModelJobPriceTemplate(vm);
}
});
}
}
private void CreateNewModelJobPriceTemplate(NewPriceTemplateVm vm)
{
var item = new ModelJobPriceTemplate
{
Price = vm.NewPrice,
Customers_Id = 1,
ModelJobs_Id = vm.SelectedModelJob.Id,
IsPriceFrom = true
};
_modelJobPriceTemplates.Add(item);
context.Entry(item).State = EntityState.Added;
CollectionViewSource.GetDefaultView(ModelJobPriceTemplates).Refresh();
}
private object _currentRow;
public object CurrentRow
{
get { return _currentRow; }
set { _currentRow = value; RaisePropertyChanged(nameof(CurrentRow)); }
}
public ICommand ModelJobDropDownLoadedCommand
{
get
{
return new RelayCommand<int>(mId =>
{
var view = (CollectionViewSource)Application.Current.MainWindow.FindResource("modelJobsViewSource");
view.View.Filter = o =>
{
var mj = (ModelJob)o;
return mj.Models_Id == mId;
};
});
}
}
public ICommand ModelJobDropDownUnLoadedCommand
{
get
{
return new RelayCommand(p =>
{
var cb = (ComboBox)p;
cb.ItemsSource = null;
var view = (CollectionViewSource)Application.Current.MainWindow.FindResource("modelJobsViewSource");
view.View.Filter = null;
});
}
}
public bool DeleteEntity(object entity, bool promt)
{
if (entity != null && (entity.GetType().IsPublic || entity is IEnumerable))
{
if (promt)
if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButton.OKCancel, MessageBoxImage.Question) != MessageBoxResult.OK)
return true;
if (entity is IEnumerable)
foreach (var item in (IEnumerable)entity)
DeleteEntityInt(item);
else
DeleteEntityInt(entity);
}
return false;
}
private void DeleteEntityInt(object entity)
{
var currentState = context.Entry(entity).State;
if (currentState == EntityState.Added)
{
context.Entry(entity).State = EntityState.Detached;
}
else if (currentState != EntityState.Detached)
{
context.Entry(entity).State = EntityState.Deleted;
}
}
public void AddEntity(object entity)
{
if (entity != null)
{
context.Entry(entity).State = EntityState.Added;
}
}
#region Message
private string _message;
public string Message
{
get { return _message; }
set { _message = value; RaisePropertyChanged(nameof(Message)); }
}
private string _messageForeground;
public string MessageForeground
{
get { return _messageForeground; }
set { _messageForeground = value; RaisePropertyChanged(nameof(MessageForeground)); }
}
private string _messageAnimationState;
public string MessageAnimationState
{
get { return _messageAnimationState; }
set { _messageAnimationState = value; RaisePropertyChanged(nameof(MessageAnimationState)); }
}
private void ShowMessage(string message, string foreground = "DarkGreen")
{
Message = message;
MessageForeground = foreground;
MessageAnimationState = ""; MessageAnimationState = "New";
}
#endregion
}
}

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FD3E36B5-444A-4115-B288-6C924BEA0BD3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>JetFrames.AppleJobs.Editor</RootNamespace>
<AssemblyName>JetFrames.AppleJobs.Editor</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Expression.Interactions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.Entity.6.9.9\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<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.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Converters\ModelFilterConverter.cs" />
<Compile Include="EditorViewModel.cs" />
<Compile Include="Settings.cs" />
<Compile Include="ViewModelLocator.cs" />
<Compile Include="ViewModels\NewPriceTemplateVm.cs" />
<Compile Include="Views\ModelCategories.xaml.cs">
<DependentUpon>ModelCategories.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ModelJobPriceTemplates.xaml.cs">
<DependentUpon>ModelJobPriceTemplates.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ModelJobs.xaml.cs">
<DependentUpon>ModelJobs.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Models.xaml.cs">
<DependentUpon>Models.xaml</DependentUpon>
</Compile>
<Compile Include="Views\NewPriceTemplateDialog.xaml.cs">
<DependentUpon>NewPriceTemplateDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Orders.xaml.cs">
<DependentUpon>Orders.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Views\ModelCategories.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ModelJobPriceTemplates.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ModelJobs.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Models.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\NewPriceTemplateDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Orders.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<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="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AppleJobs.Data\AppleJobs.Data.csproj">
<Project>{b4695c76-31ff-4bf1-9dc6-1bc62d374091}</Project>
<Name>AppleJobs.Data</Name>
</ProjectReference>
<ProjectReference Include="..\BrightSharp\BrightSharp.csproj">
<Project>{acc3c556-f8e4-4f2a-a23d-8e8749679a1b}</Project>
<Name>BrightSharp</Name>
</ProjectReference>
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,117 @@
<Window x:Class="JetFrames.AppleJobs.Editor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:int="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:conv="clr-namespace:JetFrames.AppleJobs.Editor.Converters"
xmlns:view="clr-namespace:JetFrames.AppleJobs.Editor.Views"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:bs="http://schemas.brightsharp.com/developer"
mc:Ignorable="d"
Title="MainWindow" Height="700" Width="1000">
<Window.Resources>
<conv:ModelFilterConverter x:Key="ModelFilterConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Menu VerticalAlignment="Top">
<MenuItem Header="Данные">
<MenuItem Header="Обновить" Command="{Binding Editor.RefreshCommand}" />
</MenuItem>
<MenuItem Header="Сайт"></MenuItem>
<MenuItem Header="Сохранить" Command="{Binding Editor.SaveCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"></MenuItem>
<TextBlock IsHitTestVisible="False" Text="{Binding Editor.Message}" Foreground="{Binding Editor.MessageForeground}" Opacity="0">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding Editor.MessageAnimationState}" Value="New">
<DataTrigger.EnterActions>
<BeginStoryboard Name="NewAnimation">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
<LinearDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<LinearDoubleKeyFrame KeyTime="0:0:.3" Value="1" />
<LinearDoubleKeyFrame KeyTime="0:0:4" Value="1" />
<LinearDoubleKeyFrame KeyTime="0:0:5" Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Menu>
<TabControl Grid.Row="1" SelectionChanged="TabControl_SelectionChanged" DataContext="{x:Null}">
<TabItem Header="Категории моделей">
<Grid>
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
<i:Interaction.Behaviors>
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Categories}" />
</i:Interaction.Behaviors>
</TextBox>
<view:ModelCategories Margin="0,50,0,0" />
</Grid>
</TabItem>
<TabItem Header="Модели">
<Grid>
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
<i:Interaction.Behaviors>
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}" />
</i:Interaction.Behaviors>
</TextBox>
<view:Models Margin="0,50,0,0" />
</Grid>
</TabItem>
<TabItem Header="Виды работ">
<Grid>
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
<i:Interaction.Behaviors>
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.ModelJobs}" />
</i:Interaction.Behaviors>
</TextBox>
<view:ModelJobs Margin="0,50,0,0" />
</Grid>
</TabItem>
<TabItem Header="Расценки">
<Grid>
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
<i:Interaction.Behaviors>
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.ModelJobPriceTemplates}" />
</i:Interaction.Behaviors>
</TextBox>
<Button VerticalAlignment="Top" HorizontalAlignment="Left" Command="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.AddNewPriceTemplateCommand}">+Добавить</Button>
<view:ModelJobPriceTemplates Margin="0,50,0,0" />
</Grid>
</TabItem>
<TabItem Header="Заказы">
<Grid>
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
<i:Interaction.Behaviors>
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Orders}" />
</i:Interaction.Behaviors>
</TextBox>
<view:Orders Margin="0,50,0,0" />
</Grid>
</TabItem>
</TabControl>
</Grid>
</Window>

View File

@@ -0,0 +1,50 @@
using AppleJobs.Data.Models.ModelsJobs;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace JetFrames.AppleJobs.Editor
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
DataContext = App.Locator;
InitializeComponent();
Loaded += (s, e) => App.Locator.Editor.OnLoaded();
}
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
var dg = (DataGrid)sender;
if (e.Command == DataGrid.DeleteCommand)
e.Handled = App.Locator.Editor.DeleteEntity(dg.SelectedValue, true);
}
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
{
if (e.NewItem is ModelJobPriceTemplate)
{
var mjpt = (ModelJobPriceTemplate)e.NewItem;
mjpt.Customers_Id = 1;
}
App.Locator.Editor.AddEntity(e.NewItem);
}
protected override void OnClosing(CancelEventArgs e)
{
Properties.Settings.Default.Save();
base.OnClosing(e);
}
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
((TabItem)((TabControl)sender).SelectedItem).DataContext = App.Locator;
}
}
}

View File

@@ -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("JetFrames.AppleJobs.Editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JetFrames.AppleJobs.Editor")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace JetFrames.AppleJobs.Editor.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("JetFrames.AppleJobs.Editor.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;
}
}
}
}

View File

@@ -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>

View File

@@ -0,0 +1,362 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace JetFrames.AppleJobs.Editor.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
public 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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public double Grid01LayoutX {
get {
return ((double)(this["Grid01LayoutX"]));
}
set {
this["Grid01LayoutX"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public double Grid01LayoutY {
get {
return ((double)(this["Grid01LayoutY"]));
}
set {
this["Grid01LayoutY"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid01LayoutWidth {
get {
return ((double)(this["Grid01LayoutWidth"]));
}
set {
this["Grid01LayoutWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid01LayoutHeight {
get {
return ((double)(this["Grid01LayoutHeight"]));
}
set {
this["Grid01LayoutHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("100")]
public double Grid02LayoutX {
get {
return ((double)(this["Grid02LayoutX"]));
}
set {
this["Grid02LayoutX"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("200")]
public double Grid03LayoutX {
get {
return ((double)(this["Grid03LayoutX"]));
}
set {
this["Grid03LayoutX"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("300")]
public double Grid04LayoutX {
get {
return ((double)(this["Grid04LayoutX"]));
}
set {
this["Grid04LayoutX"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("100")]
public double Grid02LayoutY {
get {
return ((double)(this["Grid02LayoutY"]));
}
set {
this["Grid02LayoutY"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("200")]
public double Grid03LayoutY {
get {
return ((double)(this["Grid03LayoutY"]));
}
set {
this["Grid03LayoutY"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("300")]
public double Grid04LayoutY {
get {
return ((double)(this["Grid04LayoutY"]));
}
set {
this["Grid04LayoutY"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid02LayoutWidth {
get {
return ((double)(this["Grid02LayoutWidth"]));
}
set {
this["Grid02LayoutWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid03LayoutWidth {
get {
return ((double)(this["Grid03LayoutWidth"]));
}
set {
this["Grid03LayoutWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid04LayoutWidth {
get {
return ((double)(this["Grid04LayoutWidth"]));
}
set {
this["Grid04LayoutWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid02LayoutHeight {
get {
return ((double)(this["Grid02LayoutHeight"]));
}
set {
this["Grid02LayoutHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid03LayoutHeight {
get {
return ((double)(this["Grid03LayoutHeight"]));
}
set {
this["Grid03LayoutHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid04LayoutHeight {
get {
return ((double)(this["Grid04LayoutHeight"]));
}
set {
this["Grid04LayoutHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool Grid01Expanded {
get {
return ((bool)(this["Grid01Expanded"]));
}
set {
this["Grid01Expanded"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool Grid02Expanded {
get {
return ((bool)(this["Grid02Expanded"]));
}
set {
this["Grid02Expanded"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool Grid03Expanded {
get {
return ((bool)(this["Grid03Expanded"]));
}
set {
this["Grid03Expanded"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool Grid04Expanded {
get {
return ((bool)(this["Grid04Expanded"]));
}
set {
this["Grid04Expanded"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public double ZoomPadX {
get {
return ((double)(this["ZoomPadX"]));
}
set {
this["ZoomPadX"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public double ZoomPadY {
get {
return ((double)(this["ZoomPadY"]));
}
set {
this["ZoomPadY"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public double Zoom {
get {
return ((double)(this["Zoom"]));
}
set {
this["Zoom"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool Grid05Expanded {
get {
return ((bool)(this["Grid05Expanded"]));
}
set {
this["Grid05Expanded"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("400")]
public double Grid05LayoutX {
get {
return ((double)(this["Grid05LayoutX"]));
}
set {
this["Grid05LayoutX"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public double Grid05LayoutY {
get {
return ((double)(this["Grid05LayoutY"]));
}
set {
this["Grid05LayoutY"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid05LayoutWidth {
get {
return ((double)(this["Grid05LayoutWidth"]));
}
set {
this["Grid05LayoutWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double Grid05LayoutHeight {
get {
return ((double)(this["Grid05LayoutHeight"]));
}
set {
this["Grid05LayoutHeight"] = value;
}
}
}
}

View File

@@ -0,0 +1,90 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="JetFrames.AppleJobs.Editor.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="Grid01LayoutX" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="Grid01LayoutY" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="Grid01LayoutWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid01LayoutHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid02LayoutX" Type="System.Double" Scope="User">
<Value Profile="(Default)">100</Value>
</Setting>
<Setting Name="Grid03LayoutX" Type="System.Double" Scope="User">
<Value Profile="(Default)">200</Value>
</Setting>
<Setting Name="Grid04LayoutX" Type="System.Double" Scope="User">
<Value Profile="(Default)">300</Value>
</Setting>
<Setting Name="Grid02LayoutY" Type="System.Double" Scope="User">
<Value Profile="(Default)">100</Value>
</Setting>
<Setting Name="Grid03LayoutY" Type="System.Double" Scope="User">
<Value Profile="(Default)">200</Value>
</Setting>
<Setting Name="Grid04LayoutY" Type="System.Double" Scope="User">
<Value Profile="(Default)">300</Value>
</Setting>
<Setting Name="Grid02LayoutWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid03LayoutWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid04LayoutWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid02LayoutHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid03LayoutHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid04LayoutHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid01Expanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Grid02Expanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Grid03Expanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Grid04Expanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ZoomPadX" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="ZoomPadY" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="Zoom" Type="System.Double" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="Grid05Expanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Grid05LayoutX" Type="System.Double" Scope="User">
<Value Profile="(Default)">400</Value>
</Setting>
<Setting Name="Grid05LayoutY" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="Grid05LayoutWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="Grid05LayoutHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,28 @@
namespace JetFrames.AppleJobs.Editor.Properties {
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
public sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}

View File

@@ -0,0 +1,33 @@
using AppleJobs.Data;
using BrightSharp.Mvvm;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data.Entity.Core.EntityClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JetFrames.AppleJobs.Editor
{
public class ViewModelLocator
{
AppleJobsContext context;
public ViewModelLocator()
{
if (ObservableObject.IsInDesignTime)
{
context = new AppleJobsContext("server=138.201.230.158;user id=admin_applejobs;pwd=dPARP0etzx;database=admin_applejobs_dev;CharSet=utf8;");
}
else
{
context = new AppleJobsContext();
}
Editor = new EditorViewModel(context);
}
public EditorViewModel Editor { get; private set; }
public Properties.Settings Settings { get { return Properties.Settings.Default; } }
}
}

View File

@@ -0,0 +1,64 @@
using AppleJobs.Data.Models.ModelsJobs;
using BrightSharp.Commands;
using BrightSharp.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
namespace JetFrames.AppleJobs.Editor.ViewModels
{
public class NewPriceTemplateVm : ObservableObject
{
private readonly IEnumerable<ModelJobPriceTemplate> modelJobPriceTemplates;
private readonly IEnumerable<ModelJob> modelJobs;
public NewPriceTemplateVm(IEnumerable<Model> models, IEnumerable<ModelJob> modelJobs, IEnumerable<ModelJobPriceTemplate> modelJobPriceTemplates,
Action<NewPriceTemplateVm> createFunc)
{
this.modelJobs = modelJobs;
this.modelJobPriceTemplates = modelJobPriceTemplates;
Models = models;
CreateCommand = new RelayCommand(p => { createFunc?.Invoke(this); RaisePropertyChanged(nameof(FreeModelJobs)); }, p => SelectedModelJob != null);
}
private Model _selectedModel;
public Model SelectedModel
{
get { return _selectedModel; }
set { _selectedModel = value; RaisePropertyChanged(nameof(SelectedModel)); RaisePropertyChanged(nameof(FreeModelJobs)); }
}
public IEnumerable<Model> Models { get; private set; }
public IEnumerable<ModelJob> FreeModelJobs
{
get
{
if (SelectedModel == null) return null;
var res = modelJobs.Where(mj => mj.Model.Id == SelectedModel.Id && modelJobPriceTemplates.All(p => p.ModelJobs_Id != mj.Id));
return res;
}
}
private ModelJob _selectedModelJob;
public ModelJob SelectedModelJob
{
get { return _selectedModelJob; }
set { _selectedModelJob = value; RaisePropertyChanged(nameof(SelectedModelJob)); }
}
private int? _newPrice;
public int? NewPrice
{
get { return _newPrice; }
set { _newPrice = value; RaisePropertyChanged(nameof(NewPrice)); }
}
public ICommand CreateCommand
{
get; set;
}
}
}

View File

@@ -0,0 +1,18 @@
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.ModelCategories"
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"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.Categories}"
InitializingNewItem="DataGrid_InitializingNewItem"
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name, ValidatesOnNotifyDataErrors=True}" Header="Название" Width="100" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,27 @@
using System.Windows.Controls;
using System.Windows.Input;
namespace JetFrames.AppleJobs.Editor.Views
{
/// <summary>
/// Interaction logic for ModelCategories.xaml
/// </summary>
public partial class ModelCategories : UserControl
{
public ModelCategories()
{
InitializeComponent();
}
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (e.Command == DataGrid.DeleteCommand)
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
}
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
{
App.Locator.Editor.AddEntity(e.NewItem);
}
}
}

View File

@@ -0,0 +1,29 @@
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.ModelJobPriceTemplates"
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"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
d:DesignHeight="300" d:DesignWidth="774">
<Grid>
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.ModelJobPriceTemplates}"
CanUserAddRows="False" AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ModelJob.Name}" Header="Работа" Width="120" SortMemberPath="ModelJob.Name"
ClipboardContentBinding="{Binding ModelJob.Name}"
IsReadOnly="True" />
<DataGridTextColumn Binding="{Binding ModelJob.Model.Name}" Header="Модель" Width="120" SortMemberPath="ModelJob.Model.Name"
ClipboardContentBinding="{Binding ModelJob.Model.Name}"
IsReadOnly="True" />
<DataGridTextColumn Binding="{Binding ModelJob.Model.ModelCategory.Name}"
IsReadOnly="True" Header="Категория" Width="120" SortMemberPath="ModelJob.Model.ModelCategory.Name"
ClipboardContentBinding="{Binding ModelJob.Model.ModelCategory.Name}" />
<DataGridTextColumn Binding="{Binding Price, TargetNullValue=''}" Header="Цена" Width="100" ClipboardContentBinding="{Binding Price}" />
<DataGridCheckBoxColumn Binding="{Binding IsPriceFrom}" Header="Цена от" Width="80"
EditingElementStyle="{StaticResource {x:Type CheckBox}}" ClipboardContentBinding="{Binding IsPriceFrom}" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,32 @@
using AppleJobs.Data.Models.ModelsJobs;
using System.Windows.Controls;
using System.Windows.Input;
namespace JetFrames.AppleJobs.Editor.Views
{
/// <summary>
/// Interaction logic for ModelJobPriceTemplates.xaml
/// </summary>
public partial class ModelJobPriceTemplates : UserControl
{
public ModelJobPriceTemplates()
{
InitializeComponent();
}
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (e.Command == DataGrid.DeleteCommand)
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
}
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
{
if (e.NewItem is ModelJobPriceTemplate)
{
var mjpt = (ModelJobPriceTemplate)e.NewItem;
mjpt.Customers_Id = 1;
}
App.Locator.Editor.AddEntity(e.NewItem);
}
}
}

View File

@@ -0,0 +1,26 @@
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.ModelJobs"
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"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
d:DesignHeight="300" d:DesignWidth="527">
<Grid>
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.ModelJobs}"
InitializingNewItem="DataGrid_InitializingNewItem"
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="Название" Width="150" />
<DataGridComboBoxColumn SelectedValueBinding="{Binding Model}"
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}"
DisplayMemberPath="Name" Header="Модель" Width="120" SortMemberPath="Model.Name"
EditingElementStyle="{StaticResource {x:Type ComboBox}}"/>
<DataGridTextColumn Binding="{Binding Description}" Header="Описание" Width="200" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,38 @@
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 JetFrames.AppleJobs.Editor.Views
{
/// <summary>
/// Interaction logic for ModelJobs.xaml
/// </summary>
public partial class ModelJobs : UserControl
{
public ModelJobs()
{
InitializeComponent();
}
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (e.Command == DataGrid.DeleteCommand)
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
}
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
{
App.Locator.Editor.AddEntity(e.NewItem);
}
}
}

View File

@@ -0,0 +1,22 @@
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.Models"
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"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute"
ItemsSource="{Binding Editor.Models}"
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}" InitializingNewItem="DataGrid_InitializingNewItem">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="Модель" Width="120" />
<DataGridComboBoxColumn SelectedValueBinding="{Binding ModelCategory, ValidatesOnExceptions=True}"
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Categories}"
DisplayMemberPath="Name" Header="Категория" Width="120" SortMemberPath="ModelCategory.Name"
EditingElementStyle="{StaticResource {x:Type ComboBox}}" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,38 @@
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 JetFrames.AppleJobs.Editor.Views
{
/// <summary>
/// Interaction logic for Models.xaml
/// </summary>
public partial class Models : UserControl
{
public Models()
{
InitializeComponent();
}
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (e.Command == DataGrid.DeleteCommand)
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
}
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
{
App.Locator.Editor.AddEntity(e.NewItem);
}
}
}

View File

@@ -0,0 +1,29 @@
<Window x:Class="JetFrames.AppleJobs.Editor.Views.NewPriceTemplateDialog"
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"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d" WindowStyle="ToolWindow" ShowInTaskbar="False" Title="Новая расценка"
Height="239" Width="324">
<Grid>
<DockPanel Margin="10" LastChildFill="False">
<Label DockPanel.Dock="Top">Модель*</Label>
<ComboBox DockPanel.Dock="Top" Name="modCb" VerticalAlignment="Top" ItemsSource="{Binding Models}" SelectedItem="{Binding SelectedModel, Mode=OneWayToSource}"
DisplayMemberPath="Name" />
<Label DockPanel.Dock="Top">Работа*</Label>
<ComboBox DockPanel.Dock="Top" DisplayMemberPath="Name" VerticalAlignment="Top" ItemsSource="{Binding FreeModelJobs}" SelectedItem="{Binding SelectedModelJob}" />
<Label DockPanel.Dock="Top">Цена (руб)</Label>
<TextBox DockPanel.Dock="Top" Text="{Binding NewPrice, TargetNullValue=''}"></TextBox>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="Создать" Margin="5,5,0,5" IsDefault="True" Padding="20,7" Command="{Binding CreateCommand}" />
<Button Content="Закрыть" Margin="5,5,0,5" IsCancel="True" Padding="7" />
</StackPanel>
</DockPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,12 @@
using System.Windows;
namespace JetFrames.AppleJobs.Editor.Views
{
public partial class NewPriceTemplateDialog : Window
{
public NewPriceTemplateDialog()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,55 @@
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.Orders"
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"
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
d:DesignHeight="300" d:DesignWidth="1084">
<Grid>
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.Orders}"
InitializingNewItem="DataGrid_InitializingNewItem"
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Contact}" Header="Контакт" Width="200" />
<DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.OrderStatuses}"
SelectedValueBinding="{Binding OrderStatus}"
DisplayMemberPath="Name" SortMemberPath="OrderStatus.Name" ClipboardContentBinding="{Binding Name}"
EditingElementStyle="{StaticResource {x:Type ComboBox}}" Header="Статус" Width="80" />
<DataGridComboBoxColumn SelectedValueBinding="{Binding Model, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}"
DisplayMemberPath="Name" Header="Модель" Width="120" SortMemberPath="Model.Name"
EditingElementStyle="{StaticResource {x:Type ComboBox}}"/>
<DataGridTextColumn Binding="{Binding Comment}" Header="Коментарий" Width="100" />
<DataGridCheckBoxColumn Binding="{Binding IsFast}" Header="Быстро" Width="60" />
<DataGridCheckBoxColumn Binding="{Binding IsDrive}" Header="Доставка" Width="60" />
<DataGridTextColumn Binding="{Binding Price}" Header="Цена" Width="80" />
<DataGridTemplateColumn Header="Работа" Width="80" ClipboardContentBinding="{Binding JobModel.Name}" SortMemberPath="JobModel.Name">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding JobModel.Name}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding Model.ModelJobs}" DisplayMemberPath="Name"
SelectedItem="{Binding JobModel, UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridComboBoxColumn SelectedValueBinding="{Binding Accessories}"
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Accessories}"
DisplayMemberPath="Name" SortMemberPath="Accessories.Name"
EditingElementStyle="{StaticResource {x:Type ComboBox}}" Header="Инвентарь" Width="80" />
<DataGridComboBoxColumn SelectedValueBinding="{Binding Employee}"
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Employees}"
DisplayMemberPath="Name" SortMemberPath="Employee.Name"
EditingElementStyle="{StaticResource {x:Type ComboBox}}"
Header="Мастер" Width="80" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,33 @@
using AppleJobs.Data.Models;
using AppleJobs.Data.Models.ModelsJobs;
using System.Windows.Controls;
using System.Windows.Input;
namespace JetFrames.AppleJobs.Editor.Views
{
/// <summary>
/// Interaction logic for Orders.xaml
/// </summary>
public partial class Orders : UserControl
{
public Orders()
{
InitializeComponent();
}
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (e.Command == DataGrid.DeleteCommand)
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
}
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
{
if (e.NewItem is Order)
{
var mjpt = (Order)e.NewItem;
mjpt.Customers_Id = 1;
}
App.Locator.Editor.AddEntity(e.NewItem);
}
}
}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.0" targetFramework="net452" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net452" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net452" />
<package id="MySql.Data" version="6.9.9" targetFramework="net452" />
<package id="MySql.Data.Entity" version="6.9.9" targetFramework="net452" />
</packages>