mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 02:21:15 +00:00
improvements and fixes
This commit is contained in:
@@ -6,11 +6,12 @@
|
|||||||
xmlns:ex="http://schemas.brightsharp.com/developer"
|
xmlns:ex="http://schemas.brightsharp.com/developer"
|
||||||
xmlns:viewModel="clr-namespace:BrightSharp.Ui.Tests"
|
xmlns:viewModel="clr-namespace:BrightSharp.Ui.Tests"
|
||||||
xmlns:local="clr-namespace:BrightSharp.Ui.Tests"
|
xmlns:local="clr-namespace:BrightSharp.Ui.Tests"
|
||||||
|
xmlns:bsDiag="http://schemas.brightsharp.com/diagrams"
|
||||||
ex:MarkupExtensionProperties.UseMinMaxSizeBehavior="True"
|
ex:MarkupExtensionProperties.UseMinMaxSizeBehavior="True"
|
||||||
Style="{DynamicResource BrightSharpWindowStyle}"
|
Style="{DynamicResource BrightSharpWindowStyle}"
|
||||||
ResizeMode="CanResizeWithGrip"
|
ResizeMode="CanResizeWithGrip"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="BrightSharp In DevLab" Height="450" Width="800">
|
Title="BrightSharp In DevLab" Height="555" Width="800">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<x:Array x:Key="coll" Type="{x:Type viewModel:CustomerViewModel}">
|
<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="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" />
|
||||||
@@ -62,12 +63,15 @@
|
|||||||
<Button Style="{DynamicResource GlassButtonStyle}" Content="GlassButton" HorizontalAlignment="Left" Width="70" Height="70" VerticalAlignment="Top" />
|
<Button Style="{DynamicResource GlassButtonStyle}" Content="GlassButton" HorizontalAlignment="Left" Width="70" Height="70" VerticalAlignment="Top" />
|
||||||
<Button Style="{DynamicResource GlassButtonStyle}" Content="Style" HorizontalAlignment="Left" Width="50" Height="50" VerticalAlignment="Top" Background="#FFFF6868"/>
|
<Button Style="{DynamicResource GlassButtonStyle}" Content="Style" HorizontalAlignment="Left" Width="50" Height="50" VerticalAlignment="Top" Background="#FFFF6868"/>
|
||||||
<Separator></Separator>
|
<Separator></Separator>
|
||||||
|
<GroupBox Style="{StaticResource ExpandrStyleGroupBox}" Header="ExpandrStyleGroupBox">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Left" Content="CheckBox Left Allign"/>
|
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Left" Content="CheckBox Left Allign"/>
|
||||||
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Right" Content="CheckBox Right Allign"/>
|
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Right" Content="CheckBox Right Allign"/>
|
||||||
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Top" Width="137" Content="CheckBox Top Allign"/>
|
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Top" Width="137" Content="CheckBox Top Allign"/>
|
||||||
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Bottom" Content="CheckBox Bottom Allign" />
|
<CheckBox Margin="5" IsThreeState="True" ex:MarkupExtensionProperties.Docking="Bottom" Content="CheckBox Bottom Allign" />
|
||||||
|
<CheckBox Margin="5" Style="{StaticResource SwitchCheckBoxStyle}" Content="SwitchCheckBoxStyle" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</GroupBox>
|
||||||
<Separator></Separator>
|
<Separator></Separator>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<RadioButton Margin="5" IsChecked="True" Content="RadioButton"/>
|
<RadioButton Margin="5" IsChecked="True" Content="RadioButton"/>
|
||||||
@@ -112,32 +116,20 @@
|
|||||||
<ex:MarkupExtensionProperties.TrailingElement>***</ex:MarkupExtensionProperties.TrailingElement>
|
<ex:MarkupExtensionProperties.TrailingElement>***</ex:MarkupExtensionProperties.TrailingElement>
|
||||||
<ex:MarkupExtensionProperties.Header>Enter your password :)</ex:MarkupExtensionProperties.Header>
|
<ex:MarkupExtensionProperties.Header>Enter your password :)</ex:MarkupExtensionProperties.Header>
|
||||||
</PasswordBox>
|
</PasswordBox>
|
||||||
|
<RichTextBox Margin="5" Height="100" BorderThickness="1" BorderBrush="AliceBlue">
|
||||||
|
<FlowDocument>
|
||||||
|
<Paragraph>
|
||||||
|
<Run>
|
||||||
|
Rich Text Box
|
||||||
|
</Run>
|
||||||
|
</Paragraph>
|
||||||
|
</FlowDocument>
|
||||||
|
</RichTextBox>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Lists">
|
<TabItem Header="Lists">
|
||||||
<WrapPanel ItemWidth="200" ItemHeight="250">
|
<WrapPanel ItemWidth="200" ItemHeight="250">
|
||||||
<ListBox Margin="5">
|
<ListBox Margin="5" ItemsSource="{Binding Source={StaticResource coll1}}" DisplayMemberPath="ContactNameCN">
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
<ListBoxItem Content="123"/>
|
|
||||||
<ListBoxItem Content="456"/>
|
|
||||||
<ListBoxItem Content="789"/>
|
|
||||||
</ListBox>
|
</ListBox>
|
||||||
<TreeView Margin="5">
|
<TreeView Margin="5">
|
||||||
<TreeViewItem IsExpanded="True" Header="First" Foreground="Black" Background="AliceBlue">
|
<TreeViewItem IsExpanded="True" Header="First" Foreground="Black" Background="AliceBlue">
|
||||||
@@ -178,7 +170,20 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Grids">
|
<TabItem Header="Grids">
|
||||||
|
<WrapPanel Orientation="Vertical">
|
||||||
|
<Label>ListView - GridView</Label>
|
||||||
|
<ListView Margin="5" ItemsSource="{Binding Source={StaticResource coll1}}" SelectedIndex="5">
|
||||||
|
<ListView.View>
|
||||||
|
<GridView >
|
||||||
|
<GridViewColumn Header="Customer" Width="100" DisplayMemberBinding="{Binding CustomerID}" />
|
||||||
|
<GridViewColumn Header="Company" Width="180" DisplayMemberBinding="{Binding CompanyName}" />
|
||||||
|
<GridViewColumn Header="Country" Width="100" DisplayMemberBinding="{Binding Country}" />
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
<Label>DataGrid</Label>
|
||||||
|
<DataGrid SelectedIndex="2" Margin="5" AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}" AutoGenerateColumns="True" ItemsSource="{Binding Source={StaticResource coll2}}" AutoGeneratedColumns="DataGrid_AutoGeneratedColumns" />
|
||||||
|
</WrapPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Special Controls">
|
<TabItem Header="Special Controls">
|
||||||
<WrapPanel>
|
<WrapPanel>
|
||||||
@@ -190,6 +195,26 @@
|
|||||||
<TextBlock HorizontalAlignment="Center" Foreground="DarkBlue"><Run Text="Leading Region"/></TextBlock>
|
<TextBlock HorizontalAlignment="Center" Foreground="DarkBlue"><Run Text="Leading Region"/></TextBlock>
|
||||||
</ex:MarkupExtensionProperties.LeadingElement>
|
</ex:MarkupExtensionProperties.LeadingElement>
|
||||||
</Calendar>
|
</Calendar>
|
||||||
|
<bsDiag:ZoomControl Margin="5" x:Name="zc" UseAnimation="True" ClipToBounds="True" Width="500" Height="500" Background="White" GridSize="5">
|
||||||
|
<ContentControl Style="{DynamicResource DesignerItemStyle}">
|
||||||
|
<Expander>
|
||||||
|
<Expander.Header>
|
||||||
|
<Label Content="Diagram Item (Draggable, Resizable, Rotatable)"/>
|
||||||
|
</Expander.Header>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock>Right Click on visual element - Reset to Auto size</TextBlock>
|
||||||
|
<TextBlock>Right Click on rotation element - Reset to 0 deg</TextBlock>
|
||||||
|
<TextBlock>bsDiag:VisualExtensions.LODZoom - [A][From]-[To] (A - animation)</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>
|
||||||
|
</Expander>
|
||||||
|
</ContentControl>
|
||||||
|
</bsDiag:ZoomControl>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
@@ -39,5 +40,13 @@ namespace BrightSharp.Ui.Tests
|
|||||||
cal.BlackoutDates.Add(new CalendarDateRange(DateTime.Now.AddDays(-10), DateTime.Now.AddDays(-8)));
|
cal.BlackoutDates.Add(new CalendarDateRange(DateTime.Now.AddDays(-10), DateTime.Now.AddDays(-8)));
|
||||||
cal.DisplayDateStart = DateTime.Now.AddDays(-400);
|
cal.DisplayDateStart = DateTime.Now.AddDays(-400);
|
||||||
}
|
}
|
||||||
|
private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var dg = (DataGrid)sender;
|
||||||
|
foreach (var col in dg.Columns)
|
||||||
|
{
|
||||||
|
col.Header = Regex.Replace(col.Header.ToString(), "([a-z])([A-Z])", "$1 $2");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,10 @@ namespace BrightSharp.Diagrams
|
|||||||
{
|
{
|
||||||
Point dragDelta = new Point(e.HorizontalChange, e.VerticalChange);
|
Point dragDelta = new Point(e.HorizontalChange, e.VerticalChange);
|
||||||
|
|
||||||
var zoomControl = designerItem.Parent as dynamic;
|
double gridSize = 0;
|
||||||
double.TryParse(zoomControl.Tag as string, out var gridSize);
|
|
||||||
|
var zoomControl = designerItem.Parent as ZoomControl;
|
||||||
|
if (zoomControl != null) gridSize = zoomControl.GridSize;
|
||||||
|
|
||||||
if (rotateTransform != null)
|
if (rotateTransform != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ namespace BrightSharp.Diagrams
|
|||||||
{
|
{
|
||||||
public LodInfo(string lod)
|
public LodInfo(string lod)
|
||||||
{
|
{
|
||||||
|
lod = lod.TrimStart();
|
||||||
UseAnimation = lod.StartsWith("a", true, CultureInfo.InvariantCulture);
|
UseAnimation = lod.StartsWith("a", true, CultureInfo.InvariantCulture);
|
||||||
lod = lod.TrimStart('a', 'A').Trim();
|
lod = lod.TrimStart('a', 'A').Trim();
|
||||||
|
|
||||||
|
|||||||
@@ -3796,7 +3796,9 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="{x:Type TextBoxBase}">
|
<ControlTemplate TargetType="{x:Type TextBoxBase}">
|
||||||
|
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||||
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||||
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsEnabled" Value="false">
|
<Trigger Property="IsEnabled" Value="false">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user