This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- MINIMIZE -->
<Border x:Key="WindowButtonMinimizeIcon" Width="12" Height="5" Margin="0,5,0,0" BorderBrush="#535666" BorderThickness="1" Background="#FFFFFF" />
<!-- MINIMIZE (disabled) -->
<Border x:Key="WindowButtonMinimizeIconDisabled" Width="12" Height="5" Margin="0,5,0,0"
BorderBrush="#535666" BorderThickness="1" Background="#9FA5B2" />
<!-- RESTORE -->
<Canvas x:Key="WindowButtonRestoreIcon">
<Rectangle Stroke="#535666" Fill="White" Width="10" Height="10" Canvas.Top="-4" Canvas.Left="7" />
<Rectangle Stroke="#535666" Fill="White" Width="4" Height="4" Canvas.Top="-1" Canvas.Left="10" />
<Rectangle Stroke="#535666" Fill="White" Width="10" Height="10" Canvas.Top="-2" Canvas.Left="5" />
<Rectangle Stroke="#535666" Fill="White" Width="4" Height="4" Canvas.Top="1" Canvas.Left="8" />
</Canvas>
<!-- RESTORE (disabled) -->
<Canvas x:Key="WindowButtonRestoreIconDisabled">
<Rectangle Stroke="#535666" Fill="#9FA5B2" Width="10" Height="10" Canvas.Top="-4" Canvas.Left="7" />
<Rectangle Stroke="#535666" Fill="#9FA5B2" Width="4" Height="4" Canvas.Top="-1" Canvas.Left="10" />
<Rectangle Stroke="#535666" Fill="#9FA5B2" Width="10" Height="10" Canvas.Top="-2" Canvas.Left="5" />
<Rectangle Stroke="#535666" Fill="#9FA5B2" Width="4" Height="4" Canvas.Top="1" Canvas.Left="8" />
</Canvas>
<!-- MAXIMIZE -->
<Border x:Key="WindowButtonMaximizeIcon" BorderBrush="#535666" BorderThickness="1" Width="12" Height="10">
<Border BorderBrush="#FCFCFC" BorderThickness="2">
<Border BorderBrush="#535666" BorderThickness="1" />
</Border>
</Border>
<!-- MAXIMIZE (disabled) -->
<Border x:Key="WindowButtonMaximizeIconDisabled" BorderBrush="#535666" BorderThickness="1" Width="12" Height="10">
<Border BorderBrush="#9FA5B2" BorderThickness="2">
<Border BorderBrush="#535666" BorderThickness="1" />
</Border>
</Border>
<!-- CLOSE -->
<Image Source="/CustomWindow;component/Images/buttonX.png" Width="12" Height="10" x:Key="WindowButtonCloseIcon" />
<Image Source="/CustomWindow;component/Images/buttonXDisabled.png" Width="12" Height="10" x:Key="WindowButtonCloseIconDisabled" />
<!-- Background colors for red button (e.g close button) -->
<LinearGradientBrush x:Key="RedButtonBackground" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#F89C8C" />
<GradientStop Offset="0.45" Color="#D47F75" />
<GradientStop Offset="0.45" Color="#C04C3C" />
<GradientStop Offset="1" Color="#C98172" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="RedButtonMouseOverBackground" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#F89C8C" />
<GradientStop Offset="0.45" Color="#E36A53" />
<GradientStop Offset="0.45" Color="#C72B0E" />
<GradientStop Offset="0.75" Color="#D44310" />
<GradientStop Offset="1" Color="#F5E478" />
</LinearGradientBrush>
</ResourceDictionary>

View File

@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2E8EFE10-ADF4-4B4F-B324-AA79021E39BD}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomWindow</RootNamespace>
<AssemblyName>CustomWindow</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Resource Include="ButtonIcons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Resource>
<Page Include="WindowButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Others.cs" />
<Compile Include="WindowRestoreButton.cs" />
<Compile Include="WindowMaximizeButton.cs" />
<Compile Include="WindowMinimizeButton.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>
<Compile Include="WindowButton.xaml.cs">
<DependentUpon>WindowButton.xaml</DependentUpon>
</Compile>
<Compile Include="WindowCloseButton.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Design\CustomWindowClassDiagram.cd" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Folder Include="obj\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\buttonX.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\buttonXDisabled.png" />
</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,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</StartProgram>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartProgram>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</StartProgram>
<StartAction>Program</StartAction>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<StartProgram>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</StartProgram>
<StartAction>Program</StartAction>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="CustomWindow.TypeConverterStringToUIElement" Collapsed="true">
<Position X="9.75" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Others.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="CustomWindow.WindowButton" Collapsed="true">
<Position X="3.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAkAACAUAAAAAAAAAAAIAAAAAAQAAFgAAAAA=</HashCode>
<FileName>WindowButton.xaml.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="CustomWindow.WindowCloseButton" Collapsed="true">
<Position X="0.5" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>WindowCloseButton.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="CustomWindow.WindowMaximizeButton" Collapsed="true">
<Position X="5" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>WindowMaximizeButton.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="CustomWindow.WindowMinimizeButton" Collapsed="true">
<Position X="7.25" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>WindowMinimizeButton.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="CustomWindow.WindowRestoreButton" Collapsed="true">
<Position X="2.75" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>WindowRestoreButton.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="CustomWindow.Properties.Resources" Collapsed="true">
<Position X="9.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAABEAAAAQAAAAAAAAAAAAAAAIA=</HashCode>
</TypeIdentifier>
</Class>
<Class Name="CustomWindow.Properties.Settings" Collapsed="true">
<Position X="11.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAIAAAAAABAAAAAAAAAAAAAAA=</HashCode>
</TypeIdentifier>
</Class>
<Enum Name="CustomWindow.WindowButtonState" Collapsed="true">
<Position X="9.75" Y="2.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAACAAAAAAAAIAAAAAAAAAAEAAAA=</HashCode>
<FileName>Others.cs</FileName>
</TypeIdentifier>
</Enum>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,34 @@
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
namespace CustomWindow
{
public enum WindowButtonState { Normal, Disabled, None }
// This is converter of 'Caption' property. It enables to simply set Caption="string value"
// in the Xaml definition and the convertor then converts the text into a TextBlock
public class TypeConverterStringToUIElement : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return sourceType == typeof(string) ? true : false;
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
// unsupported type
if (value.GetType() != typeof(string))
return base.ConvertFrom(context, culture, value);
// string
var textBlock = new TextBlock();
textBlock.Text = (string)value;
textBlock.VerticalAlignment = VerticalAlignment.Center;
textBlock.Margin = new Thickness(3, 0, 0, 0);
return textBlock;
}
}
}

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("CustomWindow")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomWindow")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[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,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CustomWindow.Properties {
using System;
/// <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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomWindow.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,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CustomWindow.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.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,36 @@
<Button x:Class="CustomWindow.WindowButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
SnapsToDevicePixels="True"
x:Name="myUcName">
<Button.Resources>
<SolidColorBrush x:Key="DefaultBackgroundBrush" Color="#66000000" />
</Button.Resources>
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="MainBorder" BorderBrush="#000000"
BorderThickness="0" CornerRadius="{Binding ElementName=myUcName, Path=CornerRadius}"
Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}">
<Grid>
<Border x:Name="HighlightBorder" CornerRadius="{Binding ElementName=myUcName, Path=CornerRadius}">
<ContentControl x:Name="ContentPlaceHolder" VerticalAlignment="Center" Content="{Binding ElementName=myUcName, Path=ActiveContent}" Margin="0" />
</Border>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="HighlightBorder" Property="Background" Value="{Binding Path=Foreground, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
<Button.Style>
<Style TargetType="Button">
<Setter Property="Width" Value="30" />
<Setter Property="Height" Value="35" />
<Setter Property="Background" Value="{StaticResource DefaultBackgroundBrush}" />
<Setter Property="Foreground" Value="#AFAFAF">
</Setter>
</Style>
</Button.Style>
</Button>

View File

@@ -0,0 +1,89 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace CustomWindow
{
public partial class WindowButton : Button
{
#region DependencyProperties
/// <summary>
/// Button content
/// <remarks>Base button's content property is hidden</remarks>
/// </summary>
public new object Content
{
get => GetValue(ContentProperty);
set { SetValue(ContentProperty, value); RefreshContent(); }
}
public new static readonly DependencyProperty ContentProperty =
DependencyProperty.Register("Content", typeof(object), typeof(WindowButton), new UIPropertyMetadata());
/// <summary>
/// Disabled button content
/// </summary>
public object ContentDisabled
{
get => GetValue(ContentDisabledProperty);
set { SetValue(ContentDisabledProperty, value); RefreshContent(); }
}
public static readonly DependencyProperty ContentDisabledProperty =
DependencyProperty.Register("ContentDisabled", typeof(object), typeof(WindowButton), new UIPropertyMetadata());
/// <summary>
/// Corner radius of the button
/// </summary>
public CornerRadius CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusDPProperty);
set => SetValue(CornerRadiusDPProperty, value);
}
public static readonly DependencyProperty CornerRadiusDPProperty =
DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(WindowButton), new UIPropertyMetadata(new CornerRadius()));
[System.ComponentModel.Bindable(true)]
public object ActiveContent
{
get => GetValue(ActiveContentProperty);
set => SetValue(ActiveContentProperty, value);
}
public static readonly DependencyProperty ActiveContentProperty =
DependencyProperty.Register("ActiveContent", typeof(object), typeof(WindowButton), new UIPropertyMetadata());
#endregion
/// <summary>
/// Button default Background
/// </summary>
public virtual Brush BackgroundDefaultValue => (Brush)FindResource("DefaultBackgroundBrush");
/// <summary>
/// Instantiate WindowButton class
/// </summary>
public WindowButton()
{
InitializeComponent();
IsEnabledChanged += (s, e) => RefreshContent();
}
/// <summary>
/// Set's the content of the button according to the current 'IsEnabled' state of the button
/// </summary>
protected void RefreshContent()
{
// Button is enabled
if (IsEnabled)
ActiveContent = Content;
else
ActiveContent = ContentDisabled;
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Globalization;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Media;
namespace CustomWindow
{
public class WindowCloseButton : WindowButton
{
public WindowCloseButton()
{
// open resource where in XAML are defined some required stuff such as icons and colors
var resourceStream = Application.GetResourceStream(new Uri("pack://application:,,,/CustomWindow;component/ButtonIcons.xaml")).Stream;
var resourceDictionary = (ResourceDictionary)XamlReader.Load(resourceStream);
// set icon
Content = resourceDictionary["WindowButtonCloseIcon"];
ContentDisabled = resourceDictionary["WindowButtonCloseIconDisabled"];
// radius
//this.CornerRadius = new CornerRadius(0, 0, 3, 0);
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.IO;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Controls;
using System.Globalization;
namespace CustomWindow
{
public class WindowMaximizeButton : WindowButton
{
public WindowMaximizeButton()
{
// open resource where in XAML are defined icons and colors
var resourceStream = Application.GetResourceStream(new Uri("pack://application:,,,/CustomWindow;component/ButtonIcons.xaml")).Stream;
var resourceDictionary = (ResourceDictionary)XamlReader.Load(resourceStream);
Content = resourceDictionary["WindowButtonMaximizeIcon"];
ContentDisabled = resourceDictionary["WindowButtonMaximizeIconDisabled"];
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.IO;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Controls;
using System.Globalization;
namespace CustomWindow
{
public class WindowMinimizeButton : WindowButton
{
public WindowMinimizeButton()
{
// open resource where in XAML are defined some required stuff such as icons and colors
var resourceStream = Application.GetResourceStream(new Uri("pack://application:,,,/CustomWindow;component/ButtonIcons.xaml")).Stream;
var resourceDictionary = (ResourceDictionary)XamlReader.Load(resourceStream);
Content = resourceDictionary["WindowButtonMinimizeIcon"];
ContentDisabled = resourceDictionary["WindowButtonMinimizeIconDisabled"];
//this.CornerRadius = new CornerRadius(0, 0, 0, 3);
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.IO;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Controls;
using System.Globalization;
namespace CustomWindow
{
public class WindowRestoreButton : WindowButton
{
public WindowRestoreButton()
{
// open resource where in XAML are defined some required stuff such as icons and colors
var resourceStream = Application.GetResourceStream(new Uri("pack://application:,,,/CustomWindow;component/ButtonIcons.xaml")).Stream;
var resourceDictionary = (ResourceDictionary)XamlReader.Load(resourceStream);
Content = resourceDictionary["WindowButtonRestoreIcon"];
ContentDisabled = resourceDictionary["WindowButtonRestoreIconDisabled"];
}
}
}