Ver 2.0. Fixes and improvements.
@@ -1,8 +1,6 @@
|
||||
<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>
|
||||
|
||||
@@ -38,8 +38,10 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationFramework.Aero2" />
|
||||
<Reference Include="System" />
|
||||
<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" />
|
||||
@@ -58,6 +60,12 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="TestPage2.xaml.cs">
|
||||
<DependentUpon>TestPage2.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestPage.xaml.cs">
|
||||
<DependentUpon>TestPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="CustomWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -70,6 +78,7 @@
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BrushesMapList.cs" />
|
||||
<Compile Include="CustomWindow.xaml.cs">
|
||||
<DependentUpon>CustomWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -78,6 +87,14 @@
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="TestPage2.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TestPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
|
||||
27
BrightSharp.Ui.Tests/BrushesMapList.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace BrightSharp.Ui.Tests
|
||||
{
|
||||
public class BrushesMapList : Dictionary<string, object>
|
||||
{
|
||||
public BrushesMapList() {
|
||||
var dic = Application.Current.Resources.MergedDictionaries.First();
|
||||
foreach (string key in dic.Keys.OfType<string>().OrderBy(x => x)) {
|
||||
var value = Application.Current.TryFindResource(key);
|
||||
if (value != null) {
|
||||
bool isBorder = key.Contains("Border");
|
||||
if (value is Color col) {
|
||||
Add(key, new { Type = "C", Brush = new SolidColorBrush(col), IsBorder = isBorder });
|
||||
}
|
||||
else if (value is Brush br) {
|
||||
Add(key, new { Type = "Br", Brush = br, IsBorder = isBorder });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,18 +4,78 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:bs="http://schemas.brightsharp.com/developer"
|
||||
xmlns:conv="http://schemas.brightsharp.com/developer"
|
||||
xmlns:local="clr-namespace:BrightSharp.Ui.Tests"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
mc:Ignorable="d" ResizeMode="CanResizeWithGrip"
|
||||
WindowStyle="ToolWindow"
|
||||
Height="640" Width="1000" Style="{DynamicResource BrightSharpWindowStyle}">
|
||||
WindowStyle="ToolWindow" Title="Brushes Explorer"
|
||||
Height="800" Width="600" Style="{DynamicResource BrightSharpWindowStyle}">
|
||||
<Window.Resources>
|
||||
<local:BrushesMapList x:Key="Brushes" />
|
||||
|
||||
<BooleanToVisibilityConverter x:Key="btvc" />
|
||||
<conv:InverseBooleanToVisibilityConverter x:Key="ibtvc" />
|
||||
</Window.Resources>
|
||||
<bs:MarkupExtensionProperties.Header>
|
||||
<Grid>
|
||||
<TextBlock>Custom WINDOW (BrightSharpWindowStyle)</TextBlock>
|
||||
<TextBlock>Brushes Explorer</TextBlock>
|
||||
</Grid>
|
||||
</bs:MarkupExtensionProperties.Header>
|
||||
<Window.Resources>
|
||||
</Window.Resources>
|
||||
<Label>
|
||||
TEST (Dev) WINDOW STYLE (CONTENT)
|
||||
</Label>
|
||||
<Grid>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding Source={StaticResource Brushes}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid HorizontalAlignment="Left" Margin="0,1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Rectangle Stroke="#444" StrokeThickness="1" Width="80" Height="24">
|
||||
<Rectangle.Fill>
|
||||
<DrawingBrush TileMode="Tile" Viewport="0,0,30,30"
|
||||
ViewportUnits="Absolute">
|
||||
<DrawingBrush.Drawing>
|
||||
<GeometryDrawing Brush="#BDBDBD"
|
||||
Geometry="M5,5 L0,5 0,10 5,10 5,5 10,5 10,0 5,0 Z"/>
|
||||
</DrawingBrush.Drawing>
|
||||
</DrawingBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Rectangle Stroke="#444" StrokeThickness="1" Fill="{Binding Path=Value.Brush}" Visibility="{Binding Path=Value.IsBorder, Converter={StaticResource ibtvc}}" >
|
||||
<Rectangle.ToolTip>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle Margin="5" Fill="{Binding Path=Value.Brush}" Width="250" Height="50" Visibility="{Binding Path=Value.IsBorder, Converter={StaticResource ibtvc}}" />
|
||||
|
||||
</StackPanel>
|
||||
</Rectangle.ToolTip>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="#4444" StrokeThickness="2" Margin="3" Stroke="{Binding Path=Value.Brush}" Visibility="{Binding Path=Value.IsBorder, Converter={StaticResource btvc}}" >
|
||||
<Rectangle.ToolTip>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle Margin="5" Stroke="{Binding Path=Value.Brush}" Width="250" Height="50" Visibility="{Binding Path=Value.IsBorder, Converter={StaticResource btvc}}" />
|
||||
</StackPanel>
|
||||
</Rectangle.ToolTip>
|
||||
</Rectangle>
|
||||
|
||||
|
||||
|
||||
<TextBlock IsHitTestVisible="False" Margin="2,2,0,0" Foreground="{DynamicResource WindowBackgroundBrush}" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Path=Value.Type}" />
|
||||
<TextBlock IsHitTestVisible="False" VerticalAlignment="Center" Foreground="{DynamicResource OnWindowForegroundBrush}" HorizontalAlignment="Center" Text="{Binding Path=Value.Type}" />
|
||||
<TextBox VerticalContentAlignment="Center" Grid.Column="1" Text="{Binding Path=Key, Mode=OneTime}" BorderThickness="0" Background="Transparent">
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:SelectAllTextOnFocusBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using BrightSharp.Mvvm;
|
||||
using System;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace BrightSharp.Ui.Tests
|
||||
{
|
||||
public class CustomerViewModel : ObservableObject
|
||||
public class CustomerViewModel : INotifyPropertyChanged
|
||||
{
|
||||
static Random rnd = new Random();
|
||||
private string _customerId;
|
||||
@@ -19,6 +19,9 @@ namespace BrightSharp.Ui.Tests
|
||||
private string _phone;
|
||||
private string _fax;
|
||||
private string _color;
|
||||
private int? _numberProperty;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public CustomerViewModel()
|
||||
{
|
||||
@@ -30,57 +33,58 @@ namespace BrightSharp.Ui.Tests
|
||||
public string CustomerID
|
||||
{
|
||||
get { return _customerId; }
|
||||
set { _customerId = value; RaisePropertyChanged(nameof(CustomerID)); }
|
||||
set { _customerId = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
public string CompanyName
|
||||
{
|
||||
get { return _companyName; }
|
||||
set { _companyName = value; RaisePropertyChanged(nameof(CompanyName)); }
|
||||
set { _companyName = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
public string ContactNameCN
|
||||
{
|
||||
get { return _contactName; }
|
||||
set { _contactName = value; RaisePropertyChanged(nameof(ContactNameCN)); }
|
||||
set { _contactName = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
public string ContactTitle
|
||||
{
|
||||
get { return _contactTitle; }
|
||||
set { _contactTitle = value; RaisePropertyChanged(nameof(ContactTitle)); }
|
||||
set { _contactTitle = value; RaisePropertyChanged(); }
|
||||
}
|
||||
[Category("Location")]
|
||||
public string Address
|
||||
{
|
||||
get { return _address; }
|
||||
set { _address = value; RaisePropertyChanged(nameof(Address)); }
|
||||
set { _address = value; RaisePropertyChanged(); }
|
||||
}
|
||||
[Category("Location")]
|
||||
public string City
|
||||
{
|
||||
get { return _city; }
|
||||
set { _city = value; RaisePropertyChanged(nameof(City)); }
|
||||
set { _city = value; RaisePropertyChanged(); }
|
||||
}
|
||||
[Category("Location")]
|
||||
public string Region
|
||||
{
|
||||
get { return _region; }
|
||||
set { _region = value; RaisePropertyChanged(nameof(Region)); }
|
||||
set { _region = value; RaisePropertyChanged(); }
|
||||
}
|
||||
[Category("Contact Information")]
|
||||
[Description("Postal code for Customer")]
|
||||
public string PostalCode
|
||||
{
|
||||
get { return _postalCode; }
|
||||
set { _postalCode = value; RaisePropertyChanged(nameof(PostalCode)); }
|
||||
set { _postalCode = value; RaisePropertyChanged(); }
|
||||
}
|
||||
[Category("Location")]
|
||||
[Description("Country for Customer")]
|
||||
public string Country
|
||||
{
|
||||
get { return _country; }
|
||||
set { _country = value; RaisePropertyChanged(nameof(Country)); }
|
||||
set { _country = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
[Category("Contact Information")]
|
||||
@@ -88,7 +92,7 @@ namespace BrightSharp.Ui.Tests
|
||||
public string Phone
|
||||
{
|
||||
get { return _phone; }
|
||||
set { _phone = value; RaisePropertyChanged(nameof(Phone)); }
|
||||
set { _phone = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
[Category("Contact Information")]
|
||||
@@ -96,16 +100,21 @@ namespace BrightSharp.Ui.Tests
|
||||
public string Fax
|
||||
{
|
||||
get { return _fax; }
|
||||
set { _fax = value; RaisePropertyChanged(nameof(Fax)); }
|
||||
set { _fax = value; RaisePropertyChanged(); }
|
||||
}
|
||||
[Category("Appearance")]
|
||||
public string Color
|
||||
{
|
||||
get { return _color; }
|
||||
set { _color = value; RaisePropertyChanged(nameof(Color)); }
|
||||
set { _color = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
public int? NumberProperty
|
||||
{
|
||||
get { return _numberProperty; }
|
||||
set { _numberProperty = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
public int NumberProperty { get; set; }
|
||||
public double DoubleNumberProperty { get; set; }
|
||||
|
||||
|
||||
@@ -117,5 +126,12 @@ namespace BrightSharp.Ui.Tests
|
||||
[Description("Indicates that Customer is has active state or it absent")]
|
||||
[DisplayName("Is Active Or Not Exists")]
|
||||
public bool? IsActiveOrEmpty { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
private void RaisePropertyChanged([CallerMemberName]string memeberName = null) {
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(memeberName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
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"
|
||||
Style="{DynamicResource BrightSharpWindowStyle}"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
xmlns:ex="http://schemas.brightsharp.com/developer"
|
||||
xmlns:bsDiag="http://schemas.brightsharp.com/diagrams"
|
||||
Style="{DynamicResource BrightSharpWindowStyle}"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
x:Class="BrightSharp.Ui.Tests.MainWindow"
|
||||
mc:Ignorable="d" Background="{DynamicResource WindowBackgroundBrush}"
|
||||
mc:Ignorable="d"
|
||||
ex:MarkupExtensionProperties.HeaderHorizontalAlignment="Center"
|
||||
Title="BrightSharp.Ui.Tests" Height="750" Width="1600">
|
||||
Title="BrightSharp.Ui.Tests" Height="750" Width="1900">
|
||||
<Window.Resources>
|
||||
<ex:StringHelpConverter x:Key="StringHelpConverter" />
|
||||
<x:Array x:Key="coll" Type="{x:Type viewModel:CustomerViewModel}">
|
||||
<viewModel:CustomerViewModel CustomerID="ALFKI" CompanyName="Alfreds Futterkiste" ContactNameCN="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" ContactNameCN="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" />
|
||||
@@ -26,35 +24,73 @@
|
||||
</x:Array>
|
||||
<CollectionViewSource Source="{StaticResource coll}" x:Key="coll1" />
|
||||
<CollectionViewSource Source="{StaticResource coll}" x:Key="coll2" />
|
||||
|
||||
</Window.Resources>
|
||||
<ex:MarkupExtensionProperties.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Foreground="Red">❖</Label>
|
||||
<Label Foreground="White">BrightSharp.Toolkit Presentation ver.2</Label>
|
||||
<Label Foreground="Blue">❖</Label>
|
||||
</StackPanel>
|
||||
</ex:MarkupExtensionProperties.Header>
|
||||
<Grid>
|
||||
|
||||
<Grid Margin="2" ClipToBounds="True">
|
||||
<bsDiag:ZoomControl x:Name="zc" UseAnimation="True" ClipToBounds="False">
|
||||
<ContentControl Style="{StaticResource DesignerItemStyle}"
|
||||
Canvas.Left="1600" Canvas.Top="20" Width="300">
|
||||
<GroupBox Style="{StaticResource ExpandrStyleGroupBox}">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label>Extended Frame</Label>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Slider Minimum="20" Maximum="50" Value="35" x:Name="FrameHeightSlider" />
|
||||
<Frame Source="TestPage.xaml" Style="{DynamicResource DevLabFrameStyle}" Grid.Row="1"
|
||||
ex:MarkupExtensionProperties.HeaderHeight="{Binding ElementName=FrameHeightSlider, Path=Value}"
|
||||
>
|
||||
<ex:MarkupExtensionProperties.Header>
|
||||
<Label VerticalContentAlignment="Center">
|
||||
Additional Header Content
|
||||
</Label>
|
||||
</ex:MarkupExtensionProperties.Header>
|
||||
|
||||
</Frame>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</ContentControl>
|
||||
<ContentControl Style="{StaticResource DesignerItemStyle}"
|
||||
Canvas.Left="10" Canvas.Top="20" Width="330">
|
||||
<GroupBox Header="Common">
|
||||
<GroupBox Header="Common" Background="{DynamicResource GradientWindowBackgroundBrush}">
|
||||
<Grid>
|
||||
<Button IsDefault="True" Content="Change Theme" Click="Button_Click" HorizontalAlignment="Left" Width="108" Height="32" VerticalAlignment="Top" Margin="10,10,0,0"/>
|
||||
<Button ex:MarkupExtensionProperties.CornerRadius="25" FocusVisualStyle="{DynamicResource ButtonEllipseFocusVisual}" Content="Round" HorizontalAlignment="Left" Width="50" Height="50" VerticalAlignment="Top" Margin="10,84,0,0"/>
|
||||
<ToggleButton IsChecked="True" ex:MarkupExtensionProperties.CornerRadius="25" FocusVisualStyle="{DynamicResource ButtonEllipseFocusVisual}" Content="Round" HorizontalAlignment="Left" Width="50" Height="50" VerticalAlignment="Top" Margin="70,84,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" Content="CheckBox" IsThreeState="True" IsChecked="{x:Null}"/>
|
||||
<CheckBox IsThreeState="True" ex:MarkupExtensionProperties.Docking="Right" Margin="10,105,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="CheckBox Right Allign"/>
|
||||
<CheckBox Margin="10,140,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="CheckBox" IsThreeState="True" IsChecked="{x:Null}"/>
|
||||
<CheckBox IsThreeState="True" ex:MarkupExtensionProperties.Docking="Right" Margin="10,161,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="CheckBox Right Allign"/>
|
||||
<CheckBox HorizontalContentAlignment="Center" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Top" Margin="151,35,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="137" Content="CheckBox Top Allign"/>
|
||||
<RadioButton IsChecked="True" Margin="10,130,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="RadioButton"/>
|
||||
<RadioButton Margin="10,151,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="RadioButton"/>
|
||||
<RadioButton IsChecked="True" Margin="10,183,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="RadioButton"/>
|
||||
<RadioButton Margin="10,204,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="RadioButton"/>
|
||||
<TextBox x:Name="tb" Canvas.Left="10" Canvas.Top="269" Margin="151,10,10,0" VerticalAlignment="Top" />
|
||||
<TabControl BorderThickness="1" 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}" VerticalAlignment="Top" Margin="37,204,0,0" Content="SwitchCheckBoxStyle" Width="213" RenderTransformOrigin="0.5,0.5" Height="Auto" />
|
||||
<TextBox Margin="35,236,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="246">
|
||||
<CheckBox HorizontalAlignment="Left" Style="{StaticResource SwitchCheckBoxStyle}" VerticalAlignment="Top" Margin="40,275,0,0" Content="SwitchCheckBoxStyle" Width="213" RenderTransformOrigin="0.5,0.5" Height="Auto" />
|
||||
<TextBox Margin="40,304,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="246" Padding="3">
|
||||
<ex:MarkupExtensionProperties.LeadingElement>L.El.</ex:MarkupExtensionProperties.LeadingElement>
|
||||
<ex:MarkupExtensionProperties.TrailingElement>T.El.</ex:MarkupExtensionProperties.TrailingElement>
|
||||
<ex:MarkupExtensionProperties.Header>Watermark</ex:MarkupExtensionProperties.Header>
|
||||
</TextBox>
|
||||
<Button Content="Test Custom Window" Margin="93,266,0,0" HorizontalAlignment="Left" Width="134" Height="25" VerticalAlignment="Top" Click="Button_Click_ShowCustomWindow"></Button>
|
||||
<Calendar Margin="10,295,10,0" VerticalAlignment="Top" Loaded="Calendar_Loaded">
|
||||
<Button Content="Brushes Explorer" Margin="97,416,0,0" HorizontalAlignment="Left" Width="134" Height="25" VerticalAlignment="Top" Click="Button_Click_ShowCustomWindow"/>
|
||||
<Calendar Margin="10,441,10,0" VerticalAlignment="Top" Loaded="Calendar_Loaded">
|
||||
<ex:MarkupExtensionProperties.TrailingElement>
|
||||
<TextBlock HorizontalAlignment="Center" Foreground="DarkRed"><Run Text="Trailing Region"/></TextBlock>
|
||||
</ex:MarkupExtensionProperties.TrailingElement>
|
||||
@@ -62,7 +98,7 @@
|
||||
<TextBlock HorizontalAlignment="Center" Foreground="DarkBlue"><Run Text="Leading Region"/></TextBlock>
|
||||
</ex:MarkupExtensionProperties.LeadingElement>
|
||||
</Calendar>
|
||||
<ComboBox IsEditable="True" Margin="10,172,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" SelectedIndex="0" Width="136">
|
||||
<ComboBox IsEditable="True" Margin="10,225,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" SelectedIndex="0" Width="136">
|
||||
<ComboBoxItem Content="Item 1"/>
|
||||
<ComboBoxItem Content="Item 2"/>
|
||||
<ComboBoxItem Content="Item 3"/>
|
||||
@@ -70,6 +106,54 @@
|
||||
<ComboBoxItem Content="Item 4"/>
|
||||
<ComboBoxItem Content="Item 5"/>
|
||||
</ComboBox>
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource coll1}}" TextSearch.TextPath="ContactNameCN" IsEditable="True" Margin="10,250,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" SelectedIndex="0" Width="136">
|
||||
<ex:MarkupExtensionProperties.LeadingElement>
|
||||
<ToolBar Style="{DynamicResource FlatToolBar}" Margin="0,2" ex:MarkupExtensionProperties.CornerRadius="3,3,0,0">
|
||||
<Button Content="Press me" />
|
||||
<Button Content="Press me" />
|
||||
</ToolBar>
|
||||
</ex:MarkupExtensionProperties.LeadingElement>
|
||||
<ex:MarkupExtensionProperties.TrailingElement>
|
||||
<Button HorizontalAlignment="Left" Content="Trailing"/>
|
||||
</ex:MarkupExtensionProperties.TrailingElement>
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="0,0,0,1" BorderBrush="{DynamicResource SolidBorderBrush}" MinWidth="140">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding ContactNameCN}" FontWeight="DemiBold" />
|
||||
<Label Background="White" BorderBrush="Black" BorderThickness="1" Padding="3,0" Margin="0,-14,3,0" HorizontalAlignment="Right">
|
||||
<Label.ToolTip>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding ContactNameCN}" FontWeight="DemiBold" />
|
||||
<TextBlock Text="{Binding Address}" FontStyle="Italic" />
|
||||
<TextBlock Text="{Binding City}" />
|
||||
<TextBlock Text="{Binding CompanyName}" />
|
||||
<TextBlock Text="{Binding ContactTitle}" />
|
||||
<TextBlock Text="{Binding Phone}" />
|
||||
</StackPanel>
|
||||
</Label.ToolTip>
|
||||
<TextBlock Foreground="Black"><Run Text="i"/></TextBlock>
|
||||
</Label>
|
||||
|
||||
<TextBlock Text="{Binding Address}" FontStyle="Italic" MaxWidth="130" TextTrimming="CharacterEllipsis" HorizontalAlignment="Left" ToolTip="{Binding Address}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<Button Style="{DynamicResource GlassButtonStyle}" Content="GlassButton" HorizontalAlignment="Left" Width="70" Height="70" VerticalAlignment="Top" Margin="161,199,0,0"/>
|
||||
<Button Style="{DynamicResource GlassButtonStyle}" Content="Style" HorizontalAlignment="Left" Width="50" Height="50" VerticalAlignment="Top" Margin="248,209,0,0" Background="#FFFF6868"/>
|
||||
<TextBox Padding="3" Margin="40,332,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="246"
|
||||
Text="{Binding Source={StaticResource coll}, Path=[0].NumberProperty, UpdateSourceTrigger=PropertyChanged}">
|
||||
<ex:MarkupExtensionProperties.LeadingElement>LD</ex:MarkupExtensionProperties.LeadingElement>
|
||||
<ex:MarkupExtensionProperties.TrailingElement>TR</ex:MarkupExtensionProperties.TrailingElement>
|
||||
<ex:MarkupExtensionProperties.Header>Check Validation Style (Number)</ex:MarkupExtensionProperties.Header>
|
||||
</TextBox>
|
||||
<PasswordBox Padding="3" Margin="40,375,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="246">
|
||||
<ex:MarkupExtensionProperties.LeadingElement>Password</ex:MarkupExtensionProperties.LeadingElement>
|
||||
<ex:MarkupExtensionProperties.TrailingElement>***</ex:MarkupExtensionProperties.TrailingElement>
|
||||
<ex:MarkupExtensionProperties.Header>Enter your password :)</ex:MarkupExtensionProperties.Header>
|
||||
</PasswordBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</ContentControl>
|
||||
@@ -104,8 +188,24 @@
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<ToolBar ToolBar.OverflowMode="Never">
|
||||
<Button Content="EXEC" />
|
||||
<Button Content="View" />
|
||||
<Button Content="BUTTON" />
|
||||
<ToggleButton Margin="5,0,0,0" Content="TBUTTON" />
|
||||
<Separator />
|
||||
<Menu Background="Transparent" Foreground="{DynamicResource UiForegroundBrush}">
|
||||
<MenuItem Header="Menu ▼">
|
||||
<MenuItem Header="MenuItem1"/>
|
||||
<MenuItem Header="MenuItem2"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<TextBox Margin="5,0,0,0" Width="60" />
|
||||
<ComboBox Margin="5,0,0,0" Width="60" SelectedIndex="0">
|
||||
<ComboBoxItem>1 Combobox Item</ComboBoxItem>
|
||||
<ComboBoxItem>2 Combobox Item</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Separator />
|
||||
<RadioButton Content="R1" IsChecked="True" />
|
||||
<RadioButton Content="R2" />
|
||||
<RadioButton Content="R3" />
|
||||
</ToolBar>
|
||||
</StackPanel>
|
||||
<ListView ItemsSource="{Binding Source={StaticResource coll1}}" SelectedIndex="5" Margin="2,54,10,190">
|
||||
@@ -123,11 +223,18 @@
|
||||
<ListBoxItem Content="789"/>
|
||||
</ListBox>
|
||||
<TreeView Margin="204,0,10,10" Height="175" VerticalAlignment="Bottom">
|
||||
<TreeViewItem Header="1">
|
||||
<TreeViewItem Header="12">
|
||||
<TreeViewItem Header="123"/>
|
||||
<TreeViewItem Header="123"/>
|
||||
<TreeViewItem Header="123"/>
|
||||
<TreeViewItem IsExpanded="True" Header="First" Foreground="Black" Background="AliceBlue">
|
||||
<TreeViewItem Header="F-12" IsExpanded="True" Background="Pink">
|
||||
<TreeViewItem Header="F-123" />
|
||||
<TreeViewItem Header="F-123" IsSelected="True" />
|
||||
<TreeViewItem Header="F-123" />
|
||||
</TreeViewItem>
|
||||
</TreeViewItem>
|
||||
<TreeViewItem Header="Second">
|
||||
<TreeViewItem Header="S-12" ex:MarkupExtensionProperties.SpecialWidth="50">
|
||||
<TreeViewItem Header="S-123"/>
|
||||
<TreeViewItem Header="S-123"/>
|
||||
<TreeViewItem Header="S-123"/>
|
||||
</TreeViewItem>
|
||||
</TreeViewItem>
|
||||
</TreeView>
|
||||
@@ -137,7 +244,7 @@
|
||||
<ContentControl Style="{StaticResource DesignerItemStyle}" bsDiag:VisualExtensions.CanRotate="False"
|
||||
Padding="2,27,2,2"
|
||||
Canvas.Left="850"
|
||||
Canvas.Top="20" Width="733" Height="475">
|
||||
Canvas.Top="20" Width="700" Height="450">
|
||||
<GroupBox Margin="0,-25,0,0" Style="{StaticResource ExpandrStyleGroupBox}" >
|
||||
<GroupBox.Header>
|
||||
<Label Content="Xaml RichTextBox (CanRotate=false)"/>
|
||||
@@ -150,6 +257,8 @@
|
||||
<Paragraph TextAlignment="Justify">
|
||||
<Run Text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."/>
|
||||
<Run Text=" "/>
|
||||
<Run Text=" "/>
|
||||
<Run Text=" "/>
|
||||
<Figure HorizontalAnchor="ColumnRight" Width="205">
|
||||
<BlockUIContainer>
|
||||
<Image UseLayoutRounding="True" d:DesignUseLayoutRounding="True">
|
||||
@@ -160,6 +269,8 @@
|
||||
</BlockUIContainer>
|
||||
</Figure>
|
||||
<Run Text=" "/>
|
||||
<Run Text=" "/>
|
||||
<Run Text=" "/>
|
||||
<Figure HorizontalAnchor="ColumnRight" Width="230">
|
||||
<BlockUIContainer>
|
||||
<Image UseLayoutRounding="True" d:DesignUseLayoutRounding="True">
|
||||
@@ -201,7 +312,7 @@
|
||||
Padding="2,27,2,2"
|
||||
Canvas.Left="350"
|
||||
Canvas.Top="550">
|
||||
<Expander Margin="0,-25,0,0">
|
||||
<Expander Margin="0,-25,0,0" IsExpanded="True">
|
||||
<Expander.Header>
|
||||
<Label Background="Transparent" Content="Grid (MaxWidth,MaxHeight)"/>
|
||||
</Expander.Header>
|
||||
@@ -209,26 +320,25 @@
|
||||
</Expander>
|
||||
</ContentControl>
|
||||
|
||||
<ContentControl Width="294" Height="133" Background="Pink" Canvas.Left="1050" Canvas.Top="550" Style="{StaticResource DesignerItemStyle}">
|
||||
<ContentControl Width="294" Height="133" Background="{DynamicResource LightBrush}" Canvas.Left="850" Canvas.Top="550" Style="{StaticResource DesignerItemStyle}">
|
||||
<Border>
|
||||
<StackPanel>
|
||||
<TextBlock FontStyle="Italic">(Some elements hidden by LODZoom extension)</TextBlock>
|
||||
<TextBlock FontStyle="Italic"><Run Text="(Some elements hidden by LODZoom extension)"/></TextBlock>
|
||||
<Separator />
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom=" A1-5">1. Element use LODZoom Functionality A1-5</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="A -5.1">2. Element use LODZoom Functionality A -5.1</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="a 2-8.3">3. Element use LODZoom Functionality a 2-8.3</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="a 1.5-">4. Element use LODZoom Functionality a 1.5-</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="1-5">5. Element use LODZoom Functionality 1-5</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom=" A1-5"><Run Text="1. Element use LODZoom Functionality A1-5"/></TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="A -5.1"><Run Text="2. Element use LODZoom Functionality A -5.1"/></TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="a 2-8.3"><Run Text="3. Element use LODZoom Functionality a 2-8.3"/></TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="a 1.5-"><Run Text="4. Element use LODZoom Functionality a 1.5-"/></TextBlock>
|
||||
<TextBlock TextWrapping="Wrap" bsDiag:VisualExtensions.LODZoom="1-5"><Run Text="5. Element use LODZoom Functionality 1-5"/></TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</ContentControl>
|
||||
|
||||
</bsDiag:ZoomControl>
|
||||
<CheckBox VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,20" IsChecked="{Binding ElementName=zc, Path=UseAnimation}">UseAnimation</CheckBox>
|
||||
<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Left">
|
||||
<Run>RenderZoom: </Run><Run Text="{Binding ElementName=zc, Path=RenderZoom}" />
|
||||
</TextBlock>
|
||||
<Label VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,40">Middle Mouse Button To Pan. Hold Ctrl to force zoom.</Label>
|
||||
<CheckBox VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,20" IsChecked="{Binding UseAnimation, ElementName=zc}" Content="UseAnimation"/>
|
||||
<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Left"><Run Text="RenderZoom:"/><Run Text="{Binding RenderZoom, ElementName=zc, StringFormat={} {0:N2}}" /></TextBlock>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using BrightSharp.Converters;
|
||||
using Diagrams;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
@@ -15,6 +16,7 @@ namespace BrightSharp.Ui.Tests
|
||||
{
|
||||
InitializeComponent();
|
||||
SelectionBehavior.Attach(innerCanvas);
|
||||
//ThemeManager.Theme = ColorThemes.DarkBlue;
|
||||
tb.Text = ThemeManager.Theme.ToString();
|
||||
}
|
||||
|
||||
@@ -46,11 +48,11 @@ namespace BrightSharp.Ui.Tests
|
||||
private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e)
|
||||
{
|
||||
var dg = (DataGrid)sender;
|
||||
var stringHelper = new StringHelpConverter();
|
||||
foreach (var col in dg.Columns)
|
||||
{
|
||||
col.Header = stringHelper.Convert(col.Header, null, "SpaceBetweenCaps", null);
|
||||
col.Header = Regex.Replace(col.Header.ToString(), "([a-z])([A-Z])", "$1 $2");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
22
BrightSharp.Ui.Tests/TestPage.xaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<Page x:Class="BrightSharp.Ui.Tests.TestPage"
|
||||
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.Ui.Tests"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300"
|
||||
Title="TestPage">
|
||||
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<Label>
|
||||
Hello World!
|
||||
</Label>
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="TestPage2.xaml">Go to TestPage2</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
28
BrightSharp.Ui.Tests/TestPage.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BrightSharp.Ui.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for TestPage.xaml
|
||||
/// </summary>
|
||||
public partial class TestPage : Page
|
||||
{
|
||||
public TestPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
16
BrightSharp.Ui.Tests/TestPage2.xaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<Page x:Class="BrightSharp.Ui.Tests.TestPage2"
|
||||
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.Ui.Tests"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300"
|
||||
Title="TestPage">
|
||||
|
||||
<Grid>
|
||||
<Label>
|
||||
Hello World From Test 2!!!
|
||||
</Label>
|
||||
</Grid>
|
||||
</Page>
|
||||
28
BrightSharp.Ui.Tests/TestPage2.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BrightSharp.Ui.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for TestPage.xaml
|
||||
/// </summary>
|
||||
public partial class TestPage2 : Page
|
||||
{
|
||||
public TestPage2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 476 KiB |
@@ -1,12 +1,34 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26730.10
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightSharp", "BrightSharp\BrightSharp.csproj", "{ACC3C556-F8E4-4F2A-A23D-8E8749679A1B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightSharp.Ui.Tests", "BrightSharp.Ui.Tests\BrightSharp.Ui.Tests.csproj", "{0D6E1828-8D07-4701-B98A-65DBF1604D3F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Subitems", "Subitems", "{D7917F1F-55F7-440E-82BF-1F5ADE0AAD3C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
docs\logo-small.png = docs\logo-small.png
|
||||
README.md = README.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{21BBA955-8560-43B2-8ED7-275861A2DF11}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
docs\BrushesList.png = docs\BrushesList.png
|
||||
docs\classic-theme.png = docs\classic-theme.png
|
||||
docs\htmleditor.png = docs\htmleditor.png
|
||||
docs\logo.png = docs\logo.png
|
||||
docs\help\zoomcontrol.md = docs\help\zoomcontrol.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Help", "Help", "{8097BF6E-FB5B-4DF3-BB75-DCA1A7313D33}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
docs\help\apply-themes.md = docs\help\apply-themes.md
|
||||
docs\help\brushes.md = docs\help\brushes.md
|
||||
docs\help\htmleditor.md = docs\help\htmleditor.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -25,4 +47,11 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{21BBA955-8560-43B2-8ED7-275861A2DF11} = {D7917F1F-55F7-440E-82BF-1F5ADE0AAD3C}
|
||||
{8097BF6E-FB5B-4DF3-BB75-DCA1A7313D33} = {21BBA955-8560-43B2-8ED7-275861A2DF11}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8F1E742F-10FA-44EA-999B-66B79F991220}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
<Compile Include="Commands\AsyncCommand.cs" />
|
||||
<Compile Include="Commands\RelayCommand.cs" />
|
||||
<Compile Include="Converters\InverseBooleanToVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\StringHelpConverter.cs" />
|
||||
<Compile Include="Diagrams\Adorners\ResizeRotateAdorner.cs" />
|
||||
<Compile Include="Diagrams\Adorners\ResizeRotateChrome.cs" />
|
||||
<Compile Include="Diagrams\Adorners\SizeAdorner.cs" />
|
||||
@@ -68,7 +67,6 @@
|
||||
<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>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace BrightSharp.Converters
|
||||
{
|
||||
public class StringHelpConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (parameter is string && value is string)
|
||||
{
|
||||
var parStr = (string)parameter;
|
||||
switch (parStr)
|
||||
{
|
||||
case "SpaceBetweenCaps":
|
||||
var src = (value ?? string.Empty).ToString();
|
||||
return Regex.Replace(src, "([a-z])([A-Z])", "$1 $2");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace Diagrams
|
||||
{
|
||||
if (e.Source is DependencyObject)
|
||||
{
|
||||
var clickedElement = ((DependencyObject)e.OriginalSource).Ancestors<ContentControl>().FirstOrDefault(el => el.Style == designerStyle && WpfExtensions.GetItemsPanel(el.GetParent(true)) == fe);
|
||||
var clickedElement = ((DependencyObject)e.OriginalSource).GetAncestors<ContentControl>().FirstOrDefault(el => el.Style == designerStyle && WpfExtensions.GetItemsPanel(el.GetParent(true)) == fe);
|
||||
if (clickedElement == null)
|
||||
{
|
||||
foreach (DependencyObject item in fePanel.Children)
|
||||
@@ -49,7 +49,7 @@ namespace Diagrams
|
||||
{
|
||||
if (e.Source is DependencyObject)
|
||||
{
|
||||
var clickedElement = ((DependencyObject)e.Source).Ancestors<ContentControl>().FirstOrDefault(el => el.Style == designerStyle && el.Parent == fe);
|
||||
var clickedElement = ((DependencyObject)e.Source).GetAncestors<ContentControl>().FirstOrDefault(el => el.Style == designerStyle && el.Parent == fe);
|
||||
if (clickedElement == null)
|
||||
{
|
||||
foreach (DependencyObject item in feItemsControl.Items)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.ComponentModel;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Diagrams
|
||||
@@ -12,32 +12,35 @@ namespace Diagrams
|
||||
{
|
||||
private RotateTransform rotateTransform;
|
||||
private ContentControl designerItem;
|
||||
private static int? zIndex = null;
|
||||
|
||||
public MoveThumb()
|
||||
{
|
||||
DragStarted += new DragStartedEventHandler(this.MoveThumb_DragStarted);
|
||||
DragDelta += new DragDeltaEventHandler(this.MoveThumb_DragDelta);
|
||||
public MoveThumb() {
|
||||
DragStarted += MoveThumb_DragStarted;
|
||||
DragDelta += MoveThumb_DragDelta;
|
||||
DragCompleted += MoveThumb_DragCompleted;
|
||||
}
|
||||
|
||||
private void MoveThumb_DragCompleted(object sender, DragCompletedEventArgs e) {
|
||||
//TODO Need think about ZIndex changes
|
||||
}
|
||||
|
||||
private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
|
||||
{
|
||||
private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e) {
|
||||
this.designerItem = DataContext as ContentControl;
|
||||
|
||||
if (this.designerItem != null)
|
||||
{
|
||||
if (this.designerItem != null) {
|
||||
this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
|
||||
if (designerItem.GetBindingExpression(Panel.ZIndexProperty) == null) {
|
||||
zIndex = Math.Max(zIndex ?? 0, Panel.GetZIndex(designerItem));
|
||||
Panel.SetZIndex(designerItem, zIndex.Value + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
|
||||
{
|
||||
if (this.designerItem != null)
|
||||
{
|
||||
private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e) {
|
||||
if (this.designerItem != null) {
|
||||
Point dragDelta = new Point(e.HorizontalChange, e.VerticalChange);
|
||||
|
||||
if (this.rotateTransform != null)
|
||||
{
|
||||
if (this.rotateTransform != null) {
|
||||
dragDelta = this.rotateTransform.Transform(dragDelta);
|
||||
}
|
||||
if (double.IsNaN(Canvas.GetLeft(this.designerItem))) Canvas.SetLeft(this.designerItem, 0);
|
||||
@@ -45,6 +48,8 @@ namespace Diagrams
|
||||
|
||||
Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + dragDelta.X);
|
||||
Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + dragDelta.Y);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@ namespace BrightSharp.Extensions
|
||||
{
|
||||
public static class WpfExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns Parent item of DependencyObject
|
||||
/// </summary>
|
||||
/// <param name="obj">Child object</param>
|
||||
/// <param name="useLogicalTree">Prefer LogicalTree when need.</param>
|
||||
/// <returns>Found item</returns>
|
||||
public static DependencyObject GetParent(this DependencyObject obj, bool useLogicalTree = false)
|
||||
{
|
||||
if (!useLogicalTree && (obj is Visual || obj is Visual3D))
|
||||
@@ -16,7 +22,8 @@ namespace BrightSharp.Extensions
|
||||
else
|
||||
return LogicalTreeHelper.GetParent(obj);
|
||||
}
|
||||
public static IEnumerable<T> Ancestors<T>(this DependencyObject obj, bool useLogicalTree = false) where T : DependencyObject
|
||||
|
||||
public static IEnumerable<T> GetAncestors<T>(this DependencyObject obj, bool useLogicalTree = false) where T : DependencyObject
|
||||
{
|
||||
if (obj == null) yield break;
|
||||
|
||||
@@ -30,7 +37,7 @@ namespace BrightSharp.Extensions
|
||||
yield return x as T;
|
||||
else
|
||||
yield break;
|
||||
foreach (var item in Ancestors<T>(x, useLogicalTree))
|
||||
foreach (var item in GetAncestors<T>(x, useLogicalTree))
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
@@ -38,34 +45,97 @@ namespace BrightSharp.Extensions
|
||||
|
||||
public static T FindAncestor<T>(this DependencyObject obj) where T : DependencyObject
|
||||
{
|
||||
return Ancestors<T>(obj).FirstOrDefault();
|
||||
return GetAncestors<T>(obj).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try find ItemsPanel of ItemsControl
|
||||
/// </summary>
|
||||
/// <param name="itemsControl">Where to search</param>
|
||||
/// <returns>Panel of ItemsControl</returns>
|
||||
public static Panel GetItemsPanel(DependencyObject itemsControl)
|
||||
{
|
||||
if (itemsControl is Panel) return (Panel)itemsControl;
|
||||
ItemsPresenter itemsPresenter = GetVisualChild<ItemsPresenter>(itemsControl);
|
||||
ItemsPresenter itemsPresenter = FindVisualChildren<ItemsPresenter>(itemsControl).FirstOrDefault();
|
||||
if (itemsPresenter == null) return null;
|
||||
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);
|
||||
/// <summary>
|
||||
/// Check if object is valid (no errors found in logical children)
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to search</param>
|
||||
/// <returns>True if no errors found</returns>
|
||||
public static bool IsValid(this DependencyObject obj) {
|
||||
if (obj == null) return true;
|
||||
if (Validation.GetHasError(obj)) return false;
|
||||
foreach (var child in LogicalTreeHelper.GetChildren(obj).OfType<DependencyObject>()) {
|
||||
if (child == null) continue;
|
||||
if (child is UIElement ui) {
|
||||
if (!ui.IsVisible || !ui.IsEnabled) continue;
|
||||
}
|
||||
if (!IsValid(child)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search all textboxes to update invalid with UpdateSource(). For ex. when need update validation messages.
|
||||
/// </summary>
|
||||
/// <param name="obj">Object where to search TextBoxes</param>
|
||||
public static void UpdateSources(this DependencyObject obj) {
|
||||
if (obj == null) return;
|
||||
if (Validation.GetHasError(obj)) {
|
||||
//TODO Any types?
|
||||
if (obj is TextBox tb) tb.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
|
||||
}
|
||||
foreach (var item in FindLogicalChildren<DependencyObject>(obj)) {
|
||||
UpdateSources(item);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find all visual children of type T
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type to search</typeparam>
|
||||
/// <param name="depObj">Object where to search</param>
|
||||
/// <returns>Enumerator for items</returns>
|
||||
public static IEnumerable<T> FindVisualChildren<T>(this DependencyObject depObj) where T : DependencyObject {
|
||||
if (depObj != null && (depObj is Visual || depObj is Visual3D)) {
|
||||
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++) {
|
||||
DependencyObject child = VisualTreeHelper.GetChild(depObj, i);
|
||||
if (child != null && child is T) {
|
||||
yield return (T)child;
|
||||
}
|
||||
|
||||
foreach (T childOfChild in FindVisualChildren<T>(child)) {
|
||||
yield return childOfChild;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find all logical children of type T
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type to search</typeparam>
|
||||
/// <param name="depObj">Object where to search</param>
|
||||
/// <returns>Enumerator for items</returns>
|
||||
public static IEnumerable<T> FindLogicalChildren<T>(this DependencyObject depObj) where T : DependencyObject {
|
||||
if (depObj != null) {
|
||||
foreach (object rawChild in LogicalTreeHelper.GetChildren(depObj)) {
|
||||
if (rawChild is DependencyObject child) {
|
||||
if (child is T) {
|
||||
yield return (T)child;
|
||||
}
|
||||
|
||||
foreach (T childOfChild in FindLogicalChildren<T>(child)) {
|
||||
yield return childOfChild;
|
||||
}
|
||||
}
|
||||
if (child != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
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)
|
||||
{
|
||||
PropertyChanged?.Invoke(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([CallerMemberName]string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
protected void RaisePropertyChangedAll()
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(null));
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
}
|
||||
}
|
||||
@@ -52,8 +52,8 @@ using System.Windows.Markup;
|
||||
// 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")]
|
||||
[assembly: AssemblyVersion("2.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.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")]
|
||||
|
||||
2
BrightSharp/Properties/Resources.Designer.cs
generated
@@ -19,7 +19,7 @@ namespace BrightSharp.Properties {
|
||||
// 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
2
BrightSharp/Properties/Settings.Designer.cs
generated
@@ -12,7 +12,7 @@ namespace BrightSharp.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarBackgroundBrush" Color="#F0F0F0" />
|
||||
<SolidColorBrush x:Key="SynWindowBackgroundBrush" Color="#FFD1D1D1" />
|
||||
<Color x:Key="SelectedBackgroundColor">#FFE6D745</Color>
|
||||
<Color x:Key="SelectedBackgroundColor">#FFFFF8B8</Color>
|
||||
<SolidColorBrush x:Key="OnWindowForegroundBrush" Color="{DynamicResource OnWindowForegroundColor}" />
|
||||
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="#FF500000" />
|
||||
<Color x:Key="UiForegroundColor">Black</Color>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<Color x:Key="ControlMediumColor" >#FF10405B</Color>
|
||||
<Color x:Key="ControlDarkColor" >#FF2B404B</Color>
|
||||
|
||||
<Color x:Key="ControlMouseOverColor" >#FFA5A7BA</Color>
|
||||
<Color x:Key="ControlMouseOverColor" >#FF414888</Color>
|
||||
<Color x:Key="ControlPressedColor" >#FF47909B</Color>
|
||||
|
||||
<Color x:Key="ValidationErrorColor" >#FF3333</Color>
|
||||
@@ -36,10 +36,36 @@
|
||||
<SolidColorBrush x:Key="LightBorderBrush" Color="DarkGray" />
|
||||
<SolidColorBrush x:Key="MainMenuForegroundBrush" Color="White"/>
|
||||
|
||||
<LinearGradientBrush x:Key="WindowBackgroundBrush">
|
||||
<GradientStop Color="#444444" />
|
||||
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="#444444" />
|
||||
|
||||
<LinearGradientBrush x:Key="GradientWindowBackgroundBrush" EndPoint="1,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FF35373C" Offset="0"/>
|
||||
<GradientStop Color="#FF32353C" Offset="0.2"/>
|
||||
<GradientStop Color="#FF242629" Offset="0.75"/>
|
||||
<GradientStop Color="#FF222326" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="WindowHeaderBrush" EndPoint="0,1">
|
||||
<GradientStop Color="#FF556176" />
|
||||
<GradientStop Color="#FF282B32" Offset="0.2" />
|
||||
<GradientStop Color="#FF262634" Offset="0.8" />
|
||||
<GradientStop Color="#FF15212C" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="WindowBorderBrush" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FF2E2E2E" Offset="0"/>
|
||||
<GradientStop Color="#FF1B1B1B" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="WindowInnerBorderBrush" StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="#181818" Offset="1" />
|
||||
<GradientStop Color="#1D1C21" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="WindowHeaderInactiveBrush" EndPoint="0,1">
|
||||
<GradientStop Color="#5E5E5E" />
|
||||
<GradientStop Color="#FF3B3B3B" Offset="0.2" />
|
||||
<GradientStop Color="#FF3B3B3B" Offset="0.8" />
|
||||
<GradientStop Color="#5E5E5E" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<SolidColorBrush x:Key="GlyphBrush" Color="#ffffff" />
|
||||
<SolidColorBrush x:Key="LightColorBrush" Color="#FF57575F" />
|
||||
@@ -124,27 +150,28 @@
|
||||
<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="#FF368BB4" Offset="0.0"/>
|
||||
<GradientStop Color="#FF306178" Offset="0.55"/>
|
||||
<GradientStop Color="#FF37738F" Offset="1.0"/>
|
||||
</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"/>
|
||||
<GradientStop Color="#FF156489" Offset="0.0"/>
|
||||
<GradientStop Color="#FF2B86B2" Offset="0.2"/>
|
||||
<GradientStop Color="#FF2187B8" Offset="0.55"/>
|
||||
<GradientStop Color="#FF358FB9" Offset="1.0"/>
|
||||
</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="#FF368BB4" Offset="0.0"/>
|
||||
<GradientStop Color="#FF306178" Offset="0.55"/>
|
||||
<GradientStop Color="#FF37738F" Offset="1.0"/>
|
||||
</GradientStopCollection>
|
||||
</GradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
|
||||
@@ -222,13 +222,13 @@
|
||||
<SolidColorBrush x:Key="AlternatingRowBackgroundBrush" Color="White" />
|
||||
|
||||
|
||||
<Color x:Key="SelectedBackgroundColor">#C5C5C5</Color>
|
||||
<Color x:Key="SelectedBackgroundColor">#E3E3E3</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="ControlMouseOverColor">#FFEEEEEE</Color>
|
||||
<Color x:Key="ControlPressedColor">#FF47909B</Color>
|
||||
|
||||
|
||||
|
||||
@@ -260,9 +260,14 @@
|
||||
</LinearGradientBrush>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarBackgroundBrush" Color="#F0F0F0" />
|
||||
<SolidColorBrush x:Key="SynWindowBackgroundBrush" Color="#FFE4E4E4" />
|
||||
<LinearGradientBrush x:Key="GradientWindowBackgroundBrush" EndPoint="1,1" StartPoint="0,0">
|
||||
<GradientStop Color="White" Offset="0"/>
|
||||
<GradientStop Color="#FFF8F8F8" Offset="0.2"/>
|
||||
<GradientStop Color="#FFE3E3E3" Offset="0.75"/>
|
||||
<GradientStop Color="White" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="DarkRed" />
|
||||
<SolidColorBrush x:Key="HighLightForegroundBrush" Color="#410000" />
|
||||
|
||||
<Color x:Key="UiForegroundColor">Black</Color>
|
||||
<SolidColorBrush x:Key="UiForegroundBrush" Color="{DynamicResource UiForegroundColor}" />
|
||||
@@ -270,13 +275,13 @@
|
||||
|
||||
|
||||
|
||||
<Color x:Key="SelectedBackgroundColor">SkyBlue</Color>
|
||||
<Color x:Key="SelectedBackgroundColor">#DEDEDE</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="ControlMouseOverColor">#FFCED0E1</Color>
|
||||
<Color x:Key="ControlPressedColor">#FF47909B</Color>
|
||||
|
||||
|
||||
|
||||
@@ -125,7 +125,9 @@ namespace Diagrams
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderZoom = newValue;
|
||||
DoubleAnimation anim = new DoubleAnimation(newValue, TimeSpan.FromSeconds(0));
|
||||
anim.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseInOut };
|
||||
this.BeginAnimation(ZoomControl.RenderZoomProperty, anim);
|
||||
}
|
||||
|
||||
RaiseZoomChangedEvent();
|
||||
@@ -144,7 +146,13 @@ namespace Diagrams
|
||||
}
|
||||
else
|
||||
{
|
||||
TranslateX = translateXTo; TranslateY = translateYTo;
|
||||
DoubleAnimation anim = new DoubleAnimation(translateXTo, TimeSpan.FromSeconds(0));
|
||||
anim.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseInOut };
|
||||
this.BeginAnimation(ZoomControl.TranslateXProperty, anim);
|
||||
|
||||
anim = new DoubleAnimation(translateYTo, TimeSpan.FromSeconds(0));
|
||||
anim.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseInOut };
|
||||
this.BeginAnimation(ZoomControl.TranslateYProperty, anim);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
|
||||
44
README.md
@@ -3,32 +3,46 @@
|
||||
------------------------
|
||||
|
||||
# BrightSharp.Toolkit
|
||||
## Free WPF Professional Themes and User Controls
|
||||
|
||||
### version 1.0.0
|
||||
Professional WPF Themes and User Controls. It requires `.NET 4.5`.
|
||||
|
||||
|
||||
### Install **basic** from nuget package manager (requires .NET 4.0 AnyCPU)
|
||||
### Current Version 2.0
|
||||
|
||||
|
||||
### Nuget
|
||||
```batch
|
||||
PM > Install-Package BrightSharp.Toolkit
|
||||
> Install-Package BrightSharp.Toolkit
|
||||
```
|
||||
|
||||
### Install **extra** from nuget package manager (requires .NET 4.5.2 - x86 or x64)
|
||||
```batch
|
||||
PM > Install-Package BrightSharp.Toolkit.Extra.64
|
||||
```
|
||||
NOTE: Extra controls use [CefSharp package](https://github.com/cefsharp/CefSharp) (x86 or x64 architecture required).
|
||||
In future we will add many different controls, that use HTML5 technologies. Extra package does not depend on basic.
|
||||
|
||||
## How To
|
||||
|
||||
1. [How to Apply Themes](docs/help/apply-themes.md)
|
||||
2. [How to Use HtmlEditor](docs/help/htmleditor.md)
|
||||
3. [Brushes/Colors List](docs/help/brushes.md)
|
||||
3. [Brushes List](docs/help/brushes.md)
|
||||
|
||||
## See presentation screenshots
|
||||
Classic:
|
||||
|
||||
## Classic Theme
|
||||

|
||||
|
||||
DevLab:
|
||||
|
||||
## HtmlEditor (CKEditor) Screenshot (Extra package)
|
||||

|
||||

|
||||
|
||||
Silver:
|
||||
|
||||

|
||||
|
||||
Blue:
|
||||
|
||||

|
||||
|
||||
DarkBlue:
|
||||
|
||||

|
||||
|
||||
____________
|
||||
|
||||
|
||||
#### Created by Vitaly.S (Minsk, Skype)
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 51 KiB |
BIN
docs/blue-theme.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 132 KiB |
BIN
docs/darkblue-theme.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 71 KiB |
BIN
docs/devlab-theme.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
@@ -13,23 +13,22 @@
|
||||
|
||||
# Change themes by ThemeManager
|
||||
|
||||
Change by static property
|
||||
Change by `ThemeManager`
|
||||
```c#
|
||||
ThemeManager.CurrentTheme = ColorThemes.Classic;
|
||||
```
|
||||
|
||||
# Change themes by ResourceDictionary
|
||||
|
||||
Also you can change theme by adding resource dictionary after generic.xaml. Use one of them:
|
||||
As default we use Classic theme.
|
||||
You also can change theme by adding resource dictionary after generic.xaml. Use one of them:
|
||||
```xml
|
||||
<ResourceDictionary Source="/brightsharp;component/style.devlab.xaml" />
|
||||
or
|
||||
<ResourceDictionary Source="/brightsharp;component/style.blue.xaml" />
|
||||
or
|
||||
<ResourceDictionary Source="/brightsharp;component/style.darkblue.xaml" />
|
||||
or
|
||||
<ResourceDictionary Source="/brightsharp;component/style.silver.xaml" />
|
||||
```
|
||||
|
||||
## NOTE
|
||||
It is recommended use `Background="{DynamicResource WindowBackgroundBrush}"` for Window markup
|
||||
You can use custom window style named `BrightSharpWindowStyle`.
|
||||
Also defined additional useful styles and extensions. For more info see Demo source code.
|
||||
@@ -1,109 +1,5 @@
|
||||
## Brushes List
|
||||
|
||||

|
||||
Here you can see set of brushes and colors we are use (Classic set). In demo application you can press `Brushes Explorer` button to see theme-specific brushes.
|
||||
|
||||
## List of names
|
||||
|
||||
AlternatingRowBackgroundBrush<br/>
|
||||
BorderGapMaskConverter<br/>
|
||||
ButtonEllipseFocusVisual<br/>
|
||||
ButtonFocusVisual<br/>
|
||||
CalendarButtonStyle<br/>
|
||||
CalendarDayButtonStyle<br/>
|
||||
CalendarItemStyle<br/>
|
||||
CFocusVisual<br/>
|
||||
ComboBoxFocusVisual<br/>
|
||||
ComboBoxToggleButton<br/>
|
||||
DarkBrush<br/>
|
||||
DecoPasswordBoxContextMenu<br/>
|
||||
DecoTextBoxContextMenu<br/>
|
||||
DefaultedBorderBrush<br/>
|
||||
DefaultRadiusNormal<br/>
|
||||
DefaultRadiusSmall<br/>
|
||||
DevLabFrameStyle<br/>
|
||||
DisabledBackgroundBrush<br/>
|
||||
DisabledBorderBrush<br/>
|
||||
DisabledForegroundBrush<br/>
|
||||
ExpandCollapseToggleStyle<br/>
|
||||
ExpanderToggleButton<br/>
|
||||
Expandr2StyleGroupBox<br/>
|
||||
ExpandrStyleGroupBox<br/>
|
||||
FileItemStyle<br/>
|
||||
GlassButton<br/>
|
||||
GlyphBrush<br/>
|
||||
GridViewColumnHeaderGripper<br/>
|
||||
HighLightForegroundBrush<br/>
|
||||
HorizontalLightBrush<br/>
|
||||
HorizontalNormalBorderBrush<br/>
|
||||
HorizontalScrollBar<br/>
|
||||
HorizontalSlider<br/>
|
||||
JournalEntryUnifiedViewConverter<br/>
|
||||
LightBorderBrush<br/>
|
||||
LightBrush<br/>
|
||||
LightColorBrush<br/>
|
||||
MainMenuForegroundBrush<br/>
|
||||
NormalBorderBrush<br/>
|
||||
NormalBrush<br/>
|
||||
NormalProgressBrush<br/>
|
||||
OnWindowForegroundBrush<br/>
|
||||
OptionMarkFocusVisualBottom<br/>
|
||||
OptionMarkFocusVisualLeft<br/>
|
||||
OptionMarkFocusVisualRight<br/>
|
||||
OptionMarkFocusVisualTop<br/>
|
||||
OptionRadioButtonStyle<br/>
|
||||
PressedBorderBrush<br/>
|
||||
PressedBrush<br/>
|
||||
ProgressBarIndeterminateFillBrush<br/>
|
||||
ProgressBarIndeterminateRootBrush<br/>
|
||||
ProgressBarIndicatorAnimatedFill<br/>
|
||||
RadioButtonFocusVisual<br/>
|
||||
RoundedTabItemStyle<br/>
|
||||
RowBackgroundBrush<br/>
|
||||
ScrollBarBackgroundBrush<br/>
|
||||
ScrollBarLineButton<br/>
|
||||
ScrollBarPageButtonHoriz<br/>
|
||||
ScrollBarPageButtonHorizBrush<br/>
|
||||
ScrollBarPageButtonVert<br/>
|
||||
ScrollBarPageButtonVertBrush<br/>
|
||||
ScrollBarThumb<br/>
|
||||
SelectedBackgroundBrush<br/>
|
||||
SliderButtonStyle<br/>
|
||||
SliderThumbStyle<br/>
|
||||
SliderThumbStyleDirected<br/>
|
||||
SliderThumbStyleDirectedHor<br/>
|
||||
SolidBorderBrush<br/>
|
||||
SubMenuItemRadioButtonTemplate<br/>
|
||||
SwitchButtonFocusVisual<br/>
|
||||
SwitchCheckBoxStyle<br/>
|
||||
SynWindowBackgroundBrush<br/>
|
||||
TabItemRadius<br/>
|
||||
TabItemSelectedBackgroundBrush<br/>
|
||||
TabRadiusBottom<br/>
|
||||
TabRadiusLeft<br/>
|
||||
TabRadiusRight<br/>
|
||||
TabRadiusTop<br/>
|
||||
TestWindowStyle<br/>
|
||||
TextBoxBorder<br/>
|
||||
ThickConv<br/>
|
||||
TogglePressedBrush<br/>
|
||||
TopLevelMenuBackgroundHover<br/>
|
||||
UiForegroundBrush<br/>
|
||||
VerticalDarkBrush<br/>
|
||||
VerticalNormalBrush<br/>
|
||||
VerticalPressedBrush<br/>
|
||||
VerticalScrollBar<br/>
|
||||
VerticalScrollBarThumb<br/>
|
||||
VerticalSlider<br/>
|
||||
WindowBackgroundBrush<br/>
|
||||
WindowSolidBrush<br/>
|
||||
ControlDarkColor<br/>
|
||||
ControlLightColor<br/>
|
||||
ControlMediumColor<br/>
|
||||
ControlMouseOverColor<br/>
|
||||
ControlPressedColor<br/>
|
||||
OnWindowForegroundColor<br/>
|
||||
SelectedBackgroundColor<br/>
|
||||
SelectedUnfocusedColor<br/>
|
||||
UiForegroundColor<br/>
|
||||
ValidationErrorColor<br/>
|
||||
WindowBackgroundHoverColor<br/>
|
||||

|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# CKEditor (HtmlEditor) usage example
|
||||
|
||||
Documentation in progress...
|
||||
Extra package contains first experimental HtmlEditor
|
||||
|
||||
For more info see `BrightSharp.Demo` project. How to setup video https://youtu.be/fQvdY69fQDw
|
||||
|
||||
|
||||
BIN
docs/silver-theme.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 74 KiB |