mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 02:21:15 +00:00
Ver 2.0. Fixes and improvements.
This commit is contained in:
@@ -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
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" />
|
||||
<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,13 +188,29 @@
|
||||
</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">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<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}" />
|
||||
@@ -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
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
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
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
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 476 KiB |
Reference in New Issue
Block a user