file reorganization #2
@@ -5,7 +5,7 @@
|
|||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="/brightsharp;component/generic.xaml" />
|
<ResourceDictionary Source="/brightsharp;component/themes/theme.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using BrightSharp.Diagrams;
|
using BrightSharp.Diagrams;
|
||||||
|
using BrightSharp.Themes;
|
||||||
using System;
|
using System;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
<Compile Include="Behaviors\SelectAllTextOnFocusBehavior.cs" />
|
<Compile Include="Behaviors\SelectAllTextOnFocusBehavior.cs" />
|
||||||
<Compile Include="Commands\AsyncCommand.cs" />
|
<Compile Include="Commands\AsyncCommand.cs" />
|
||||||
<Compile Include="Commands\RelayCommand.cs" />
|
<Compile Include="Commands\RelayCommand.cs" />
|
||||||
|
<Compile Include="Controls\PropertyGrid.cs" />
|
||||||
<Compile Include="Converters\InverseBooleanToVisibilityConverter.cs" />
|
<Compile Include="Converters\InverseBooleanToVisibilityConverter.cs" />
|
||||||
<Compile Include="Diagrams\Adorners\ResizeRotateAdorner.cs" />
|
<Compile Include="Diagrams\Adorners\ResizeRotateAdorner.cs" />
|
||||||
<Compile Include="Diagrams\Adorners\ResizeRotateChrome.cs" />
|
<Compile Include="Diagrams\Adorners\ResizeRotateChrome.cs" />
|
||||||
@@ -67,45 +68,57 @@
|
|||||||
<Compile Include="Diagrams\Thumbs\ResizeThumb.cs" />
|
<Compile Include="Diagrams\Thumbs\ResizeThumb.cs" />
|
||||||
<Compile Include="Diagrams\Thumbs\RotateThumb.cs" />
|
<Compile Include="Diagrams\Thumbs\RotateThumb.cs" />
|
||||||
<Compile Include="Extensions\WpfExtensions.cs" />
|
<Compile Include="Extensions\WpfExtensions.cs" />
|
||||||
<Compile Include="ThemeManager.cs" />
|
<Compile Include="Themes\ThemeManager.cs" />
|
||||||
<Compile Include="ZoomControl.cs">
|
<Compile Include="Diagrams\ZoomControl.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Page Include="Generic.xaml">
|
<Page Include="Themes\Controls\PropertyGrid.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Themes\Controls\ZoomControl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Themes\Generic.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Compile Include="Converters\ThicknessConverter.cs" />
|
<Compile Include="Converters\ThicknessConverter.cs" />
|
||||||
<Compile Include="Extensions\MarkupExtensionProperties.cs" />
|
<Compile Include="Extensions\MarkupExtensionProperties.cs" />
|
||||||
<Compile Include="Generic.cs" />
|
<Compile Include="Themes\Theme.cs" />
|
||||||
<Page Include="Diagrams\Resources\DesignerItem.xaml">
|
<Page Include="Themes\Diagrams\DesignerItem.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Diagrams\Resources\ResizeRotateChrome.xaml">
|
<Page Include="Themes\Diagrams\ResizeRotateChrome.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Diagrams\Resources\SizeChrome.xaml">
|
<Page Include="Themes\Diagrams\SizeChrome.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Style.Blue.xaml">
|
<Page Include="Themes\Style.Blue.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Style.DarkBlue.xaml">
|
<Page Include="Themes\Style.DarkBlue.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Style.Silver.xaml">
|
<Page Include="Themes\Style.Silver.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Style.DevLab.xaml">
|
<Page Include="Themes\Style.DevLab.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Themes\Theme.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
@@ -132,14 +145,15 @@
|
|||||||
<AppDesigner Include="Properties\" />
|
<AppDesigner Include="Properties\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="icons\app.png" />
|
<Resource Include="Themes\icons\app.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="icons\copy.png" />
|
<Resource Include="Themes\icons\copy.png" />
|
||||||
<Resource Include="icons\cut.png" />
|
<Resource Include="Themes\icons\cut.png" />
|
||||||
<Resource Include="icons\paste.png" />
|
<Resource Include="Themes\icons\paste.png" />
|
||||||
<Resource Include="icons\undo.png" />
|
<Resource Include="Themes\icons\undo.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<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.
|
||||||
|
|||||||
53
BrightSharp/Controls/PropertyGrid.cs
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
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.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
|
||||||
|
///
|
||||||
|
/// Step 1a) Using this custom control in a XAML file that exists in the current project.
|
||||||
|
/// Add this XmlNamespace attribute to the root element of the markup file where it is
|
||||||
|
/// to be used:
|
||||||
|
///
|
||||||
|
/// xmlns:MyNamespace="clr-namespace:BrightSharp.Controls"
|
||||||
|
///
|
||||||
|
///
|
||||||
|
/// Step 1b) Using this custom control in a XAML file that exists in a different project.
|
||||||
|
/// Add this XmlNamespace attribute to the root element of the markup file where it is
|
||||||
|
/// to be used:
|
||||||
|
///
|
||||||
|
/// xmlns:MyNamespace="clr-namespace:BrightSharp.Controls;assembly=BrightSharp.Controls"
|
||||||
|
///
|
||||||
|
/// You will also need to add a project reference from the project where the XAML file lives
|
||||||
|
/// to this project and Rebuild to avoid compilation errors:
|
||||||
|
///
|
||||||
|
/// Right click on the target project in the Solution Explorer and
|
||||||
|
/// "Add Reference"->"Projects"->[Browse to and select this project]
|
||||||
|
///
|
||||||
|
///
|
||||||
|
/// Step 2)
|
||||||
|
/// Go ahead and use your control in the XAML file.
|
||||||
|
///
|
||||||
|
/// <MyNamespace:PropertyGrid/>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class PropertyGrid : Control
|
||||||
|
{
|
||||||
|
static PropertyGrid() {
|
||||||
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertyGrid), new FrameworkPropertyMetadata(typeof(PropertyGrid)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
BrightSharp/Themes/Controls/PropertyGrid.xaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:BrightSharp.Controls">
|
||||||
|
|
||||||
|
|
||||||
|
<Style TargetType="{x:Type local:PropertyGrid}">
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type local:PropertyGrid}">
|
||||||
|
<Border Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}">
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
38
BrightSharp/Themes/Controls/ZoomControl.xaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:diag="clr-namespace:BrightSharp.Diagrams">
|
||||||
|
|
||||||
|
<Style TargetType="{x:Type diag:ZoomControl}">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="ClipToBounds" Value="True" />
|
||||||
|
<Setter Property="Focusable" Value="False" />
|
||||||
|
<Setter Property="ItemsPanel">
|
||||||
|
<Setter.Value>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<Canvas Background="Transparent" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type diag:ZoomControl}">
|
||||||
|
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}">
|
||||||
|
<Grid>
|
||||||
|
<ItemsPresenter>
|
||||||
|
<ItemsPresenter.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<ScaleTransform ScaleX="{Binding RenderZoom, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
|
ScaleY="{Binding ScaleX, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<TranslateTransform X="{Binding TranslateX, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
|
Y="{Binding TranslateY, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
|
</TransformGroup>
|
||||||
|
</ItemsPresenter.RenderTransform>
|
||||||
|
</ItemsPresenter>
|
||||||
|
<Border x:Name="PART_SelectionBorder" />
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
5
BrightSharp/Themes/Generic.xaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
<sys:Boolean x:Key="IsInverseTheme">False</sys:Boolean>
|
<s:Boolean x:Key="IsInverseTheme">False</s:Boolean>
|
||||||
|
|
||||||
<CornerRadius x:Key="DefaultRadiusSmall">1</CornerRadius>
|
<CornerRadius x:Key="DefaultRadiusSmall">1</CornerRadius>
|
||||||
<CornerRadius x:Key="DefaultRadiusNormal">3</CornerRadius>
|
<CornerRadius x:Key="DefaultRadiusNormal">3</CornerRadius>
|
||||||
@@ -1,14 +1,20 @@
|
|||||||
using System.Windows;
|
using System;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace BrightSharp
|
namespace BrightSharp.Themes
|
||||||
{
|
{
|
||||||
internal partial class Generic
|
internal partial class Theme
|
||||||
{
|
{
|
||||||
|
public Theme() {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void CalendarPreviewMouseUp(object sender, MouseEventArgs e)
|
public void CalendarPreviewMouseUp(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (Mouse.Captured is CalendarItem) { Mouse.Capture(null); }
|
if (Mouse.Captured is CalendarItem) { Mouse.Capture(null); }
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<ResourceDictionary x:Class="BrightSharp.Generic"
|
<ResourceDictionary x:Class="BrightSharp.Themes.Theme" x:ClassModifier="internal"
|
||||||
x:ClassModifier="internal"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:conv="clr-namespace:BrightSharp.Converters"
|
xmlns:conv="clr-namespace:BrightSharp.Converters"
|
||||||
xmlns:bs="clr-namespace:BrightSharp.Extensions"
|
xmlns:bs="clr-namespace:BrightSharp.Extensions">
|
||||||
xmlns:diag="clr-namespace:BrightSharp.Diagrams">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Diagrams/Resources/DesignerItem.xaml" />
|
<ResourceDictionary Source="Diagrams/DesignerItem.xaml" />
|
||||||
|
<ResourceDictionary Source="Controls/ZoomControl.xaml" />
|
||||||
|
<ResourceDictionary Source="Controls/PropertyGrid.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<!--Converters-->
|
<!--Converters-->
|
||||||
@@ -5898,39 +5898,6 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style TargetType="{x:Type diag:ZoomControl}">
|
|
||||||
<Setter Property="Background" Value="Transparent" />
|
|
||||||
<Setter Property="ClipToBounds" Value="True" />
|
|
||||||
<Setter Property="Focusable" Value="False" />
|
|
||||||
<Setter Property="ItemsPanel">
|
|
||||||
<Setter.Value>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<Canvas Background="Transparent" />
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type diag:ZoomControl}">
|
|
||||||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}">
|
|
||||||
<Grid>
|
|
||||||
<ItemsPresenter>
|
|
||||||
<ItemsPresenter.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform ScaleX="{Binding RenderZoom, RelativeSource={RelativeSource TemplatedParent}}"
|
|
||||||
ScaleY="{Binding ScaleX, RelativeSource={RelativeSource Self}}" />
|
|
||||||
<TranslateTransform X="{Binding TranslateX, RelativeSource={RelativeSource TemplatedParent}}"
|
|
||||||
Y="{Binding TranslateY, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
||||||
</TransformGroup>
|
|
||||||
</ItemsPresenter.RenderTransform>
|
|
||||||
</ItemsPresenter>
|
|
||||||
<Border x:Name="PART_SelectionBorder" />
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- Window (Beta) Style -->
|
<!-- Window (Beta) Style -->
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace BrightSharp
|
namespace BrightSharp.Themes
|
||||||
{
|
{
|
||||||
public enum ColorThemes
|
public enum ColorThemes
|
||||||
{
|
{
|
||||||
@@ -38,7 +38,7 @@ namespace BrightSharp
|
|||||||
return;
|
return;
|
||||||
Resources.Add(new ResourceDictionary()
|
Resources.Add(new ResourceDictionary()
|
||||||
{
|
{
|
||||||
Source = new Uri($"/brightsharp;component/style.{value}.xaml", UriKind.RelativeOrAbsolute)
|
Source = new Uri($"/brightsharp;component/themes/style.{value}.xaml", UriKind.RelativeOrAbsolute)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |
|
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |