Shun 2 лет назад
Родитель
Сommit
5a3d1ef128
100 измененных файлов с 303 добавлено и 2820 удалено
  1. 0 41
      src/YSAI.Controls/YSAI.Controls.csproj
  2. 0 32
      src/YSAI.Controls/tabcontrol/Converters.cs
  3. 0 87
      src/YSAI.Controls/tabcontrol/Helper.cs
  4. 0 788
      src/YSAI.Controls/tabcontrol/TabControl.xaml
  5. 0 774
      src/YSAI.Controls/tabcontrol/TabControl.xaml.cs
  6. 0 32
      src/YSAI.Controls/tabcontrol/TabEventArgs.cs
  7. 0 86
      src/YSAI.Controls/tabcontrol/TabItem.cs
  8. 0 742
      src/YSAI.Controls/tabcontrol/TabPanel.cs
  9. 2 1
      src/YSAI.Converters/YSAI.Converters.csproj
  10. 10 11
      src/YSAI.WindowMessage/Window.xaml
  11. 19 0
      src/YSAI.Core.Wpf/MWindow.xaml.cs
  12. 82 83
      src/YSAI.WindowMessage/WindowController.cs
  13. 6 7
      src/YSAI.WindowMessage/MessageBox.cs
  14. 5 10
      src/YSAI.Window/WindowBase.cs
  15. 12 2
      src/YSAI.Window/WindowHelper.cs
  16. 47 0
      src/YSAI.Core.Wpf/YSAI.Core.Wpf.csproj
  17. 2 3
      src/YSAI.Controls/badge/BadgeControl.xaml
  18. 2 3
      src/YSAI.Controls/badge/BadgeControl.xaml.cs
  19. 2 2
      src/YSAI.Controls/barindicator/BarIndicatorControl.xaml
  20. 1 1
      src/YSAI.Controls/barindicator/BarIndicatorControl.xaml.cs
  21. 2 2
      src/YSAI.Controls/button/ButtonControl.xaml
  22. 1 1
      src/YSAI.Controls/button/ButtonControl.xaml.cs
  23. 3 3
      src/YSAI.Controls/colorpicker/ColorPickerControl.xaml
  24. 1 1
      src/YSAI.Controls/colorpicker/ColorPickerControl.xaml.cs
  25. 1 1
      src/YSAI.Controls/colorpicker/ColorPickerControlConverter.cs
  26. 2 2
      src/YSAI.Controls/colorpicker/ColorSelector.xaml
  27. 1 1
      src/YSAI.Controls/colorpicker/ColorSelector.xaml.cs
  28. 1 1
      src/YSAI.Controls/colorpicker/GridLengthUtil.cs
  29. 1 1
      src/YSAI.Controls/colorpicker/MultiComboBox.cs
  30. 1 1
      src/YSAI.Controls/colorpicker/MultiComboBoxItem.cs
  31. 1 1
      src/YSAI.Controls/colorpicker/NotTopMostPopup.cs
  32. 1 1
      src/YSAI.Controls/colorpicker/SearchTextChangedEventHandler.cs
  33. 1 1
      src/YSAI.Controls/colorpicker/SelectedBrushChangedEventHandler.cs
  34. 1 1
      src/YSAI.Controls/colorpicker/SliderHelper.cs
  35. 1 1
      src/YSAI.Controls/colorpicker/TextBoxHelper.cs
  36. 3 3
      src/YSAI.Controls/dashboard/DashBoardControl.xaml
  37. 1 1
      src/YSAI.Controls/dashboard/DashBoardControl.xaml.cs
  38. 2 2
      src/YSAI.Controls/gifimage/GifImageControl.xaml
  39. 1 1
      src/YSAI.Controls/gifimage/GifImageControl.xaml.cs
  40. 0 0
      src/YSAI.Core.Wpf/controls/hamburgermenu/ButtonStyle.xaml
  41. 5 5
      src/YSAI.Controls/hamburgermenu/HamburgerMenu.xaml
  42. 1 1
      src/YSAI.Controls/hamburgermenu/HamburgerMenu.xaml.cs
  43. 3 3
      src/YSAI.Controls/hamburgermenu/HamburgerMenuItem.xaml
  44. 1 1
      src/YSAI.Controls/hamburgermenu/HamburgerMenuItem.xaml.cs
  45. 0 0
      src/YSAI.Core.Wpf/controls/hamburgermenu/ListBoxStyle.xaml
  46. 0 0
      src/YSAI.Core.Wpf/controls/hamburgermenu/ToggleButtonStyle.xaml
  47. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Backspace.png
  48. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Button1.png
  49. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Button2.5.png
  50. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Button2.png
  51. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Button5.5.png
  52. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Enter1.png
  53. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Enter2.5.png
  54. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Enter2.png
  55. 0 0
      src/YSAI.Core.Wpf/controls/keyboard/Image/Enter5.5.png
  56. 1 1
      src/YSAI.Controls/keyboard/KeyBoardButtonControl.cs
  57. 1 1
      src/YSAI.Controls/keyboard/KeyBoardButtonControl.xaml
  58. 12 12
      src/YSAI.Controls/keyboard/KeyBoardControl.xaml
  59. 1 1
      src/YSAI.Controls/keyboard/KeyBoardControl.xaml.cs
  60. 2 2
      src/YSAI.Controls/keyboard/KeyBoardControlWindow.xaml
  61. 1 1
      src/YSAI.Controls/keyboard/KeyBoardControlWindow.xaml.cs
  62. 1 1
      src/YSAI.Controls/keyboard/KeyHelper.cs
  63. 2 2
      src/YSAI.Controls/ledgauge/ColorModel.cs
  64. 1 1
      src/YSAI.Controls/ledgauge/GenericOperator.cs
  65. 2 2
      src/YSAI.Controls/ledgauge/LedGaugeControl.xaml
  66. 4 6
      src/YSAI.Controls/ledgauge/LedGaugeControl.xaml.cs
  67. 1 1
      src/YSAI.Controls/ledgauge/Range.cs
  68. 2 2
      src/YSAI.Controls/loadinganimation/BallLoadingControl.xaml
  69. 1 1
      src/YSAI.Controls/loadinganimation/BallLoadingControl.xaml.cs
  70. 2 2
      src/YSAI.Controls/loadinganimation/CycleLoadingControl.xaml
  71. 1 1
      src/YSAI.Controls/loadinganimation/CycleLoadingControl.xaml.cs
  72. 3 3
      src/YSAI.Controls/loadinganimation/LoadingControl.xaml
  73. 1 1
      src/YSAI.Controls/loadinganimation/LoadingControl.xaml.cs
  74. 2 2
      src/YSAI.Controls/loadinganimation/LoadingXControl.xaml
  75. 1 1
      src/YSAI.Controls/loadinganimation/LoadingXControl.xaml.cs
  76. 2 2
      src/YSAI.Controls/loadinganimation/RingLoadingControl.xaml
  77. 1 1
      src/YSAI.Controls/loadinganimation/RingLoadingControl.xaml.cs
  78. 2 2
      src/YSAI.Controls/loadinganimation/RollLoadingControl.xaml
  79. 1 1
      src/YSAI.Controls/loadinganimation/RollLoadingControl.xaml.cs
  80. 2 2
      src/YSAI.Controls/loadinganimation/WaitLoadingControl.xaml
  81. 1 1
      src/YSAI.Controls/loadinganimation/WaitLoadingControl.xaml.cs
  82. 2 2
      src/YSAI.Controls/map/MapControl.xaml
  83. 1 1
      src/YSAI.Controls/map/MapControl.xaml.cs
  84. 3 3
      src/YSAI.Controls/pagebar/PageBarControl.xaml
  85. 2 2
      src/YSAI.Controls/pagebar/PageBarControl.xaml.cs
  86. 1 1
      src/YSAI.Controls/pagebar/PageBarItem.cs
  87. 2 2
      src/YSAI.Controls/radiobutton/RadioButtonControl.xaml
  88. 1 1
      src/YSAI.Controls/radiobutton/RadioButtonControl.xaml.cs
  89. 2 2
      src/YSAI.Controls/textbox/TextboxControl.xaml
  90. 1 1
      src/YSAI.Controls/textbox/TextboxControl.xaml.cs
  91. 2 2
      src/YSAI.Controls/tip/TipControl.xaml
  92. 1 1
      src/YSAI.Controls/tip/TipControl.xaml.cs
  93. 2 2
      src/YSAI.Controls/transition/TransitionControl.xaml
  94. 1 1
      src/YSAI.Controls/transition/TransitionControl.xaml.cs
  95. 1 1
      src/YSAI.Converters/BackgroundColorConverter.cs
  96. 1 1
      src/YSAI.Converters/BrushToColorConverter.cs
  97. 1 1
      src/YSAI.Converters/CheckConverter.cs
  98. 1 1
      src/YSAI.Converters/ColorToSolidColorBrushConverter.cs
  99. 1 1
      src/YSAI.Converters/GlassEffectWidthConverter.cs
  100. 0 0
      src/YSAI.Converters/HalfConverter.cs

+ 0 - 41
src/YSAI.Controls/YSAI.Controls.csproj

@@ -1,41 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFrameworks>net6.0-windows;net8.0-windows</TargetFrameworks>
-    <Nullable>enable</Nullable>
-    <UseWPF>true</UseWPF>
-  </PropertyGroup>
-	<ItemGroup>
-		<None Remove="keyboard\Image\Backspace.png" />
-		<None Remove="keyboard\Image\Button1.png" />
-		<None Remove="keyboard\Image\Button2.5.png" />
-		<None Remove="keyboard\Image\Button2.png" />
-		<None Remove="keyboard\Image\Button5.5.png" />
-		<None Remove="keyboard\Image\Enter1.png" />
-		<None Remove="keyboard\Image\Enter2.5.png" />
-		<None Remove="keyboard\Image\Enter2.png" />
-		<None Remove="keyboard\Image\Enter5.5.png" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<Resource Include="keyboard\Image\Backspace.png" />
-		<Resource Include="keyboard\Image\Button1.png" />
-		<Resource Include="keyboard\Image\Button2.5.png" />
-		<Resource Include="keyboard\Image\Button2.png" />
-		<Resource Include="keyboard\Image\Button5.5.png" />
-		<Resource Include="keyboard\Image\Enter1.png" />
-		<Resource Include="keyboard\Image\Enter2.5.png" />
-		<Resource Include="keyboard\Image\Enter2.png" />
-		<Resource Include="keyboard\Image\Enter5.5.png" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
-		<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<ProjectReference Include="..\YSAI.Converters\YSAI.Converters.csproj" />
-		<ProjectReference Include="..\YSAI.Mvvm\YSAI.Mvvm.csproj" />
-	</ItemGroup>
-</Project>

+ 0 - 32
src/YSAI.Controls/tabcontrol/Converters.cs

@@ -1,32 +0,0 @@
-using System;
-using System.Globalization;
-using System.Windows;
-using System.Windows.Data;
-
-namespace YSAI.Controls.tabcontrol
-{
-    class InverseBooleanConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            bool flag = false;
-            if (value is bool)
-            {
-                flag = (bool)value;
-            }
-            else if (value is bool?)
-            {
-                bool? nullable = (bool?)value;
-                flag = nullable.Value;
-            }
-            return (flag ? Visibility.Collapsed : Visibility.Visible);
-
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return ((value is Visibility) && (((Visibility)value) == Visibility.Collapsed));
-
-        }
-    }
-}

+ 0 - 87
src/YSAI.Controls/tabcontrol/Helper.cs

@@ -1,87 +0,0 @@
-using System.Windows;
-using System.Windows.Media;
-
-namespace YSAI.Controls.tabcontrol
-{
-    class Dimension
-    {
-        public double Height;
-        public double MaxHeight = double.PositiveInfinity;
-        public double MinHeight;
-        public double Width;
-        public double MaxWidth = double.PositiveInfinity;
-        public double MinWidth;
-    }
-
-    class Helper
-    {
-        /// <summary>
-        /// Find a specific parent object type in the visual tree
-        /// </summary>
-        public static T FindParentControl<T>(DependencyObject outerDepObj) where T : DependencyObject
-        {
-            DependencyObject dObj = VisualTreeHelper.GetParent(outerDepObj);
-            if (dObj == null)
-                return null;
-
-            if (dObj is T)
-                return dObj as T;
-
-            while ((dObj = VisualTreeHelper.GetParent(dObj)) != null)
-            {
-                if (dObj is T)
-                    return dObj as T;
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Find the Panel for the TabControl
-        /// </summary>
-        public static TabPanel FindVirtualizingTabPanel(Visual visual)
-        {
-            if (visual == null)
-                return null;
-
-            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(visual); i++)
-            {
-                Visual child = VisualTreeHelper.GetChild(visual, i) as Visual;
-
-                if (child != null)
-                {
-                    if (child is TabPanel)
-                    {
-                        object temp = child;
-                        return (TabPanel)temp;
-                    }
-
-                    TabPanel panel = FindVirtualizingTabPanel(child);
-                    if (panel != null)
-                    {
-                        object temp = panel;
-                        return (TabPanel)temp; // return the panel up the call stack
-                    }
-                }
-            }
-            return null;
-        }
-
-        /// <summary>
-        /// Clone an element
-        /// </summary>
-        /// <param name="elementToClone"></param>
-        /// <returns></returns>
-        public static object CloneElement(object elementToClone)
-        {
-            return elementToClone;
-            //string savedObject = System.Windows.Markup.XamlWriter.Save(elementToClone);
-
-            //// Load the XamlObject
-            //StringReader stringReader = new StringReader(savedObject);
-            //System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(stringReader);
-            //return System.Windows.Markup.XamlReader.Load(xmlReader);
-        }
-
-    }
-}

+ 0 - 788
src/YSAI.Controls/tabcontrol/TabControl.xaml

@@ -1,788 +0,0 @@
-<TabControl x:Class="YSAI.Controls.tabcontrol.TabControl"
-             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:YSAI.Controls.tabcontrol">
-
-    <TabControl.Resources>
-        <ResourceDictionary 
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:l="clr-namespace:YSAI.Controls.tabcontrol">
-
-            <BooleanToVisibilityConverter x:Key="boolConverter"/>
-            <l:InverseBooleanConverter x:Key="_inverseBooleanConverter"/>
-            <!-- 笔刷用于定义TabControl和TabItem的外观-->
-            
-            <!-- TabItems和TabControl的边框刷 -->
-            <SolidColorBrush x:Key="TabBorderBrush" Color="LightGray"/>
-            
-            <!-- 未选中时的标签文本颜色-->
-            <SolidColorBrush x:Key="TabGrayTextBrush" Color="#FF444444"/>
-            
-            <!-- 关闭按钮刷-->
-            <SolidColorBrush x:Key="TabCloseButtonBrush" Color="#FFADADAD"/>
-
-            <!-- TabItem刷 -->
-            <SolidColorBrush x:Key="TabItemNormalBackground" Color="WhiteSmoke"/>
-            <SolidColorBrush x:Key="TabItemHoverBackground" Color="LightGray"/>
-            <SolidColorBrush x:Key="TabItemSelectedBackground" Color="LightGray"/>
-
-            <!-- 用于将选项卡向左滚动的重复按钮的样式-->
-            <Style x:Key="RepeatButtonScrollLeftOrUpStyle" TargetType="{x:Type RepeatButton}">
-                <Setter Property="Foreground" Value="{StaticResource TabGrayTextBrush}" />
-                <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                <Setter Property="SnapsToDevicePixels" Value="True"/>
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type RepeatButton}">
-                            <Border x:Name="outerBorder"
-						Background="{TemplateBinding Background}"
-						BorderBrush="{TemplateBinding BorderBrush}"
-						BorderThickness="1"
-						Padding="{TemplateBinding Padding}"
-						CornerRadius="3,3,0,0">
-
-                                <Border x:Name="innerBorder" BorderThickness="1" BorderBrush="Transparent" Background="Transparent" Padding="4,0,4,0">
-                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
-                                        <Path x:Name="path1" Stroke="{TemplateBinding Foreground}" Fill="Transparent" Data="M 3,0 L0,3 3,6" />
-                                        <Path x:Name="path2" Stroke="{TemplateBinding Foreground}" Fill="Transparent" Data="M 7,0 L4,3 7,6" />
-                                    </Grid>
-                                </Border>
-
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="IsMouseOver" Value="true">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                </Trigger>
-                                <Trigger Property="IsPressed" Value="True">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Background" TargetName="innerBorder" Value="#11000000"/>
-                                    <Setter Property="BorderBrush" TargetName="innerBorder" Value="#66000000" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="3,3,0,0"/>
-                                    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,2,1,0" />
-                                </Trigger>
-
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Left">
-                                    <Setter Property="Data" TargetName="path1" Value="M 0,3 L3,0 6,3"/>
-                                    <Setter Property="Data" TargetName="path2" Value="M 0,7 L3,4 6,7"/>
-                                </DataTrigger>
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Right">
-                                    <Setter Property="Data" TargetName="path1" Value="M 0,3 L3,0 6,3"/>
-                                    <Setter Property="Data" TargetName="path2" Value="M 0,7 L3,4 6,7"/>
-                                </DataTrigger>
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Bottom">
-                                    <Setter Property="CornerRadius" TargetName="outerBorder" Value="0,0,3,3"/>
-                                </DataTrigger>
-
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-            <!-- 用于向右滚动选项卡的重复按钮的样式-->
-            <Style x:Key="RepeatButtonScrollRightOrDownStyle" TargetType="{x:Type RepeatButton}">
-                <Setter Property="Foreground" Value="{StaticResource TabGrayTextBrush}" />
-                <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                <Setter Property="SnapsToDevicePixels" Value="True"/>
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type RepeatButton}">
-                            <Border x:Name="outerBorder"
-						Background="{TemplateBinding Background}"
-						BorderBrush="{TemplateBinding BorderBrush}"
-						BorderThickness="1"
-						Padding="{TemplateBinding Padding}"
-						CornerRadius="3,3,0,0">
-                                <Border x:Name="innerBorder" BorderThickness="1" BorderBrush="Transparent" Background="Transparent" Padding="4,0,4,0">
-                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
-                                        <Path x:Name="path1" Stroke="{TemplateBinding Foreground}" Fill="Transparent" Data="M 0,0 L3,3 0,6" />
-                                        <Path x:Name="path2" Stroke="{TemplateBinding Foreground}" Fill="Transparent" Data="M 4,0 L7,3 4,6" />
-                                    </Grid>
-                                </Border>
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="IsMouseOver" Value="true">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                </Trigger>
-                                <Trigger Property="IsPressed" Value="True">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Background" TargetName="innerBorder" Value="#11000000"/>
-                                    <Setter Property="BorderBrush" TargetName="innerBorder" Value="#66000000" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="3,3,0,0"/>
-                                    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,2,1,0" />
-                                </Trigger>
-
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Left">
-                                    <Setter Property="Data" TargetName="path1" Value="M 0,0 L3,3 6,0"/>
-                                    <Setter Property="Data" TargetName="path2" Value="M 0,4 L3,7 6,4"/>
-                                    <Setter Property="CornerRadius" TargetName="outerBorder" Value="0,0,3,3"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="0,0,3,3"/>
-                                </DataTrigger>
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Right">
-                                    <Setter Property="Data" TargetName="path1" Value="M 0,0 L3,3 6,0"/>
-                                    <Setter Property="Data" TargetName="path2" Value="M 0,4 L3,7 6,4"/>
-                                    <Setter Property="CornerRadius" TargetName="outerBorder" Value="0,0,3,3"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="0,0,3,3"/>
-                                </DataTrigger>
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Bottom">
-                                    <Setter Property="CornerRadius" TargetName="outerBorder" Value="0,0,3,3"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="0,0,3,3"/>
-                                </DataTrigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-            <!-- 切换按钮的样式,该按钮显示一个包含所有选项卡标头的文本菜单-->
-            <Style x:Key="DropDownToggleButtonStyle" TargetType="{x:Type ToggleButton}">
-                <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="Foreground" Value="{StaticResource TabGrayTextBrush}"/>
-                <Setter Property="SnapsToDevicePixels" Value="True"/>
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type ToggleButton}">
-                            <Border x:Name="outerBorder" CornerRadius="3,3,0,0" BorderThickness="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" >
-                                <Border x:Name="innerBorder" CornerRadius="3,3,0,0">
-                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="False" Margin="0,1,0,0" SnapsToDevicePixels="False">
-                                        <Path Stroke="{TemplateBinding Foreground}" Data="M1,1L3,4 5,1z" Fill="{TemplateBinding Foreground}" ClipToBounds="False" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True"/>
-                                    </Grid>
-                                </Border>
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="IsMouseOver" Value="true">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                </Trigger>
-                                <Trigger Property="IsChecked" Value="True">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Background" TargetName="innerBorder" Value="#11000000"/>
-                                    <Setter Property="BorderBrush" TargetName="innerBorder" Value="#66000000" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                    <Setter Property="Margin" TargetName="innerBorder" Value="-1"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="3,3,0,0"/>
-                                    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,2,1,0" />
-                                </Trigger>
-
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Bottom">
-                                    <Setter Property="CornerRadius" TargetName="outerBorder" Value="0,0,3,3"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="0,0,3,3"/>
-                                </DataTrigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-            <!-- 新建选项卡按钮的样式 -->
-            <Style x:Key="NewTabButtonStyle" TargetType="{x:Type Button}">
-                <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="Foreground" Value="{StaticResource TabGrayTextBrush}"/>
-                <Setter Property="SnapsToDevicePixels" Value="True"/>
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type Button}">
-                            <Border CornerRadius="3,3,0,0" BorderThickness="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" x:Name="outerBorder">
-                                <Border x:Name="innerBorder" CornerRadius="3,3,0,0">
-                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" Margin="0,1,0,0" SnapsToDevicePixels="False">
-                                        <ContentPresenter x:Name="Cp" Opacity="0.4" />
-                                    </Grid>
-                                </Border>
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="IsMouseOver" Value="true">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                    <Setter Property="Opacity" TargetName="Cp" Value="1"/>
-                                </Trigger>
-                                <Trigger Property="IsPressed" Value="True">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Background" TargetName="innerBorder" Value="#11000000"/>
-                                    <Setter Property="BorderBrush" TargetName="innerBorder" Value="#66000000" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                    <Setter Property="Margin" TargetName="innerBorder" Value="-1"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="3,3,0,0"/>
-                                    <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,2,1,0" />
-                                </Trigger>
-                                <DataTrigger Binding="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" Value="Bottom">
-                                    <Setter Property="CornerRadius" TargetName="outerBorder" Value="0,0,3,3"/>
-                                    <Setter Property="CornerRadius" TargetName="innerBorder" Value="0,0,3,3"/>
-                                </DataTrigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-            <!-- 样式用于每个TabItem上的关闭按钮 -->
-            <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
-                <Setter Property="BorderBrush" Value="Transparent"/>
-                <Setter Property="Background" Value="Transparent"/>
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type Button}">
-                            <Border x:Name="border" 
-						CornerRadius="2" 
-						Background="{TemplateBinding Background}" 
-						BorderThickness="1" 
-						BorderBrush="{TemplateBinding BorderBrush}" 
-						Width="16" Height="16" 
-						SnapsToDevicePixels="True">
-                                <Grid Width="8" Height="8" HorizontalAlignment="Center" VerticalAlignment="Center">
-                                    <Path x:Name="path1" Stroke="{StaticResource TabCloseButtonBrush}" Data="M0,0 L8,8" StrokeThickness="2" />
-                                    <Path x:Name="path2" Stroke="{StaticResource TabCloseButtonBrush}" Data="M8,0 L0,8" StrokeThickness="2" />
-                                </Grid>
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="IsMouseOver" Value="True">
-                                    <Setter Property="BorderBrush" Value="{StaticResource TabCloseButtonBrush}"/>
-                                    <Setter Property="Background" Value="WhiteSmoke"/>
-                                    <Setter Property="Stroke" TargetName="path1" Value="DarkRed"/>
-                                    <Setter Property="Stroke" TargetName="path2" Value="DarkRed"/>
-                                </Trigger>
-                                <Trigger Property="IsPressed" Value="True">
-                                    <Setter Property="Background">
-                                        <Setter.Value>
-                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
-                                                <GradientStop Color="#FFADADAD" Offset="0"/>
-                                                <GradientStop Color="White" Offset="0.5"/>
-                                                <GradientStop Color="White" Offset="1"/>
-                                            </LinearGradientBrush>
-                                        </Setter.Value>
-                                    </Setter>
-                                </Trigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-            <!-- TabItem样式,定义了选项卡项的外观-->
-            <Style TargetType="{x:Type l:TabItem}">
-                <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
-                <Setter Property="Padding" Value="5" />
-                <Setter Property="HorizontalAlignment" Value="Stretch" />
-                <Setter Property="VerticalAlignment" Value="Stretch" />
-                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
-                <Setter Property="VerticalContentAlignment" Value="Stretch" />
-                <Setter Property="SnapsToDevicePixels" Value="True"/>
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type l:TabItem}">
-                            <Border x:Name="Bd"
-							Background="{TemplateBinding Background}"
-							BorderBrush="{TemplateBinding BorderBrush}"
-							SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
-                                <Grid HorizontalAlignment="Stretch">
-                                    <Grid.ColumnDefinitions>
-                                        <ColumnDefinition Width="Auto"/>
-                                        <ColumnDefinition Width="*"/>
-                                        <ColumnDefinition Width="Auto"/>
-                                    </Grid.ColumnDefinitions>
-
-                                    <ContentPresenter Content="{TemplateBinding Icon}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-
-                                    <Border Margin="2,0,2,0" Grid.Column="1">
-                                        <ContentPresenter
-									    Content="{TemplateBinding Header}"
-									    ContentTemplate="{TemplateBinding HeaderTemplate}"
-									    ContentSource="Header"
-										HorizontalAlignment="Stretch"
-										VerticalAlignment="Center"
-									    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
-									    Margin="{TemplateBinding Padding}"
-									    RecognizesAccessKey="True"/>
-                                    </Border>
-
-                                    <Button x:Name="PART_CloseButton" 
-								Grid.Column="2" 
-								VerticalAlignment="Center"
-								HorizontalAlignment="Center"
-								Margin="5,0,5,0"
-								Style="{StaticResource CloseButtonStyle}"
-								Visibility="Visible"
-								/>
-                                </Grid>
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="IsMouseOver" Value="true">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemMouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                </Trigger>
-                                <Trigger Property="IsSelected" Value="true">
-                                    <Setter Property="Background" Value="{Binding Path=TabItemSelectedBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}" />
-                                    <Setter Property="Foreground" Value="Black"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0"/>
-                                </Trigger>
-
-                                <Trigger Property="TabStripPlacement" Value="Top">
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,1,0"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="4,4,0,0"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,7,0,-1"/>
-                                </Trigger>
-
-                                <Trigger Property="TabStripPlacement" Value="Bottom">
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="0,0,4,4"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,-1,0,7"/>
-                                </Trigger>
-
-                                <Trigger Property="TabStripPlacement" Value="Left">
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="4,0,0,0"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,0,0,-1"/>
-                                </Trigger>
-
-                                <Trigger Property="TabStripPlacement" Value="Right">
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="0,4,0,0"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,0,0,-1"/>
-                                </Trigger>
-
-                                <Trigger Property="AllowDelete" Value="false">
-                                    <Setter Property="Visibility" TargetName="PART_CloseButton" Value="Collapsed"/>
-                                </Trigger>
-
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="TabStripPlacement" Value="Top"/>
-                                        <Condition Property="IsSelected" Value="true"/>
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.ZIndex" Value="2" />
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,1,0"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="4,4,0,0"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,0,0,-1"/>
-                                </MultiTrigger>
-
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="TabStripPlacement" Value="Bottom"/>
-                                        <Condition Property="IsSelected" Value="true"/>
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.ZIndex" Value="2" />
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="0,0,4,4"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,-1,0,0"/>
-                                </MultiTrigger>
-
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="TabStripPlacement" Value="Left"/>
-                                        <Condition Property="IsSelected" Value="true"/>
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.ZIndex" Value="2" />
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="4,0,0,4"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,0,0,-1"/>
-                                </MultiTrigger>
-
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="TabStripPlacement" Value="Right"/>
-                                        <Condition Property="IsSelected" Value="true"/>
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.ZIndex" Value="2" />
-                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,1,1"/>
-                                    <Setter Property="CornerRadius" TargetName="Bd" Value="0,4,0,0"/>
-                                    <Setter Property="Margin" TargetName="Bd" Value="0,0,0,-1"/>
-                                </MultiTrigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-            <!-- 控件模板的TabStripPlacement顶部-->
-            <ControlTemplate x:Key="TabControlTabPlacementTop" TargetType="{x:Type l:TabControl}">
-                <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="*" />
-                        <ColumnDefinition Width="Auto"/>
-                    </Grid.ColumnDefinitions>
-                    <Grid.RowDefinitions>
-                        <RowDefinition x:Name="RowDefinition0" Height="Auto" />
-                        <RowDefinition x:Name="RowDefinition1" Height="*" />
-                    </Grid.RowDefinitions>
-
-                    <Border Grid.ColumnSpan="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent"/>
-
-                    <!-- Toggle button which displays a context menu with a menu item for each tab which can be used to select a tab that is not in view-->
-                    <ToggleButton 
-                x:Name="PART_DropDown" 
-                Height="22"
-                Width="16"
-                VerticalAlignment="Bottom"
-                Margin="0,0,0,-1"
-                Grid.Column="0" 
-                KeyboardNavigation.TabIndex="1"
-                Style="{StaticResource DropDownToggleButtonStyle}" 
-                Visibility="{Binding IsUsingItemsSource, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource _inverseBooleanConverter}}"
-                ToolTip="Display all the tabs in a menu"/>
-
-                    <Button 
-                x:Name="PART_NewTabButton" 
-                Grid.Column="1" 
-                Height="22"
-                VerticalAlignment="Bottom"
-                Margin="-1,5,0,-1" 
-                KeyboardNavigation.TabIndex="2"
-                Style="{StaticResource NewTabButtonStyle}" 
-                Width="24"
-				Visibility="{Binding Path=AllowAddNew, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolConverter}}"
-				ToolTip="Add a New tab">
-
-                        <Image Source="pack://application:,,,/Wpf.TabControl;component/Images/newtab.ico"/>
-                    </Button>
-
-                    <!-- Repeat Buttons used for scrolling the TabItems into view-->
-                    <RepeatButton 
-                x:Name="PART_RepeatLeft" 
-                Panel.ZIndex="1" 
-                Grid.Column="2" 
-                Height="22"
-                KeyboardNavigation.TabIndex="3"
-                VerticalAlignment="Bottom"
-                Style="{StaticResource RepeatButtonScrollLeftOrUpStyle}" 
-                Margin="-1,5,0,-1" 
-                ToolTip="Scroll the Tab Items to the Left" 
-				Visibility="{Binding ElementName=TabPanel, Path=CanScrollLeftOrUp, Converter={StaticResource boolConverter}}"/>
-
-                    <ScrollViewer x:Name="PART_ScrollViewer" Grid.Column="3" Panel.ZIndex="1" CanContentScroll="True" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden">
-                        <l:TabPanel x:Name="TabPanel" IsItemsHost="True" SnapsToDevicePixels="True" />
-                    </ScrollViewer>
-
-                    <RepeatButton 
-                x:Name="PART_RepeatRight" 
-                Panel.ZIndex="1" 
-                Grid.Column="4" 
-                Height="22"
-                VerticalAlignment="Bottom"
-                Style="{StaticResource RepeatButtonScrollRightOrDownStyle}" 
-                Margin="-1,5,0,-1" 
-                ToolTip="Scroll the Tab Items to the Right" 
-                Visibility="{Binding ElementName=TabPanel, Path=CanScrollRightOrDown, Converter={StaticResource boolConverter}}" />
-
-                    <!-- Content Panel-->
-                    <Border x:Name="ContentPanel"
-				Grid.ColumnSpan="5" Grid.Row="1"
-				Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" 
-                BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
-                BorderThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"
-				KeyboardNavigation.DirectionalNavigation="Contained"
-				KeyboardNavigation.TabIndex="5"
-				KeyboardNavigation.TabNavigation="Local">
-                        <ContentPresenter x:Name="PART_SelectedContentHost"
-				    Content="{Binding Path=SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
-				    ContentSource="SelectedContent"
-                    ContentTemplate="{Binding Path=ContentTemplate, RelativeSource={RelativeSource TemplatedParent}}"
-				    SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}"
-				    Margin="{Binding Path=Padding, RelativeSource={RelativeSource TemplatedParent}}" />
-                    </Border>
-                </Grid>
-            </ControlTemplate>
-
-            <!-- 控件模板TabStripPlacement底部-->
-            <ControlTemplate x:Key="TabControlTabPlacementBottom" TargetType="{x:Type l:TabControl}">
-                <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="*" />
-                        <ColumnDefinition Width="Auto"/>
-                    </Grid.ColumnDefinitions>
-                    <Grid.RowDefinitions>
-                        <RowDefinition x:Name="RowDefinition0" Height="*" />
-                        <RowDefinition x:Name="RowDefinition1" Height="Auto" />
-                    </Grid.RowDefinitions>
-
-                    <!-- Toggle button which displays a context menu with a menu item for each tab which can be used to select a tab that is not in view-->
-                    <ToggleButton 
-                x:Name="PART_DropDown" 
-                Grid.Row="1"
-                Height="22"
-                Width="16"
-                VerticalAlignment="Top"
-                Margin="0,-1,0,0"
-                Grid.Column="0" 
-                Style="{StaticResource DropDownToggleButtonStyle}" 
-                Visibility="{Binding IsUsingItemsSource, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource _inverseBooleanConverter}}"
-                ToolTip="Display all the tabs in a menu"/>
-
-                    <Button 
-                x:Name="PART_NewTabButton" 
-                Grid.Row="1"
-                Grid.Column="1" 
-                Height="22"
-                VerticalAlignment="Top"
-                Margin="-1,-1,0,0" 
-                Style="{StaticResource NewTabButtonStyle}" 
-                Width="24"
-				Visibility="{Binding Path=AllowAddNew, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolConverter}}"
-				ToolTip="Add a New tab">
-
-                        <Image Source="pack://application:,,,/Wpf.TabControl;component/Images/newtab.ico"/>
-                    </Button>
-
-                    <!-- Repeat Buttons used for scrolling the TabItems into view-->
-                    <RepeatButton 
-                x:Name="PART_RepeatLeft" 
-                Panel.ZIndex="1" 
-                Grid.Row="1"
-                Grid.Column="2" 
-                Height="22"
-                VerticalAlignment="Top"
-                Style="{StaticResource RepeatButtonScrollLeftOrUpStyle}" 
-                Margin="-1,-1,0,0" 
-                ToolTip="Scroll the Tab Items to the Left" 
-				Visibility="{Binding ElementName=TabPanel, Path=CanScrollLeftOrUp, Converter={StaticResource boolConverter}}"/>
-
-                    <ScrollViewer x:Name="PART_ScrollViewer" Grid.Row="1" Grid.Column="3" Panel.ZIndex="1" CanContentScroll="True" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden">
-                        <l:TabPanel x:Name="TabPanel" IsItemsHost="True" SnapsToDevicePixels="True" />
-                    </ScrollViewer>
-
-                    <RepeatButton 
-                x:Name="PART_RepeatRight" 
-                Panel.ZIndex="1" 
-                Grid.Row="1"
-                Grid.Column="4" 
-                Height="22"
-                VerticalAlignment="Top"
-                Style="{StaticResource RepeatButtonScrollRightOrDownStyle}" 
-                Margin="-1,-1,0,0" 
-                ToolTip="Scroll the Tab Items to the Right" 
-                Visibility="{Binding ElementName=TabPanel, Path=CanScrollRightOrDown, Converter={StaticResource boolConverter}}" />
-
-                    <!-- Content Panel-->
-                    <Border x:Name="ContentPanel"
-				Grid.ColumnSpan="5" 
-				Grid.Row="0"
-				Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" 
-                BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
-                BorderThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"
-				KeyboardNavigation.DirectionalNavigation="Contained"
-				KeyboardNavigation.TabIndex="2"
-				KeyboardNavigation.TabNavigation="Local">
-                        <ContentPresenter x:Name="PART_SelectedContentHost"
-				    Content="{Binding Path=SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
-				    ContentSource="SelectedContent"
-                    ContentTemplate="{Binding Path=ContentTemplate, RelativeSource={RelativeSource TemplatedParent}}"
-				    SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}"
-				    Margin="{Binding Path=Padding, RelativeSource={RelativeSource TemplatedParent}}" />
-                    </Border>
-                </Grid>
-            </ControlTemplate>
-
-            <!-- 控制模板TabStripPlacement左-->
-            <ControlTemplate x:Key="TabControlTabPlacementLeft" TargetType="{x:Type l:TabControl}">
-                <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="20"/>
-                        <RowDefinition Height="*" />
-                        <RowDefinition Height="20"/>
-                    </Grid.RowDefinitions>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="Auto" />
-                        <ColumnDefinition Width="*" />
-                    </Grid.ColumnDefinitions>
-
-                    <Border Grid.RowSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}"/>
-
-                    <Grid Grid.Row="0">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="Auto" />
-                        </Grid.ColumnDefinitions>
-
-                        <!-- Repeat Buttons used for scrolling the TabItems into view-->
-                        <RepeatButton 
-                    x:Name="PART_RepeatLeft" 
-                    Panel.ZIndex="1" 
-                    Grid.Column="0" 
-                    Style="{StaticResource RepeatButtonScrollLeftOrUpStyle}" 
-                    Margin="0,0,0,-1" 
-                    ToolTip="Scroll the Tab Items to the Top" 
-                    Visibility="{Binding ElementName=TabPanel, Path=CanScrollLeftOrUp, Converter={StaticResource boolConverter}}"/>
-
-                        <!-- Toggle button which displays a context menu with a menu item for each tab which can be used to select a tab that is not in view-->
-                        <ToggleButton x:Name="PART_DropDown" Grid.Column="1" Margin="-1,0,0,-1" Style="{StaticResource DropDownToggleButtonStyle}" ToolTip="Display all the tabs in a menu" Width="20" Panel.ZIndex="1"
-                              Visibility="{Binding IsUsingItemsSource, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource _inverseBooleanConverter}}"/>
-
-                        <Button x:Name="PART_NewTabButton" Grid.Column="2" Margin="-1,0,0,-1" Style="{StaticResource NewTabButtonStyle}" Width="24"  Panel.ZIndex="1"
-				    Visibility="{Binding Path=AllowAddNew, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolConverter}}"
-				    ToolTip="Add a New tab">
-
-                            <Image Source="pack://application:,,,/Wpf.TabControl;component/Images/newtab.ico"/>
-                        </Button>
-                    </Grid>
-
-                    <ScrollViewer x:Name="PART_ScrollViewer" Grid.Row="1" Panel.ZIndex="1" CanContentScroll="True" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled">
-                        <l:TabPanel x:Name="TabPanel" IsItemsHost="True" />
-                    </ScrollViewer>
-
-                    <RepeatButton 
-                x:Name="PART_RepeatRight" 
-                Panel.ZIndex="1" 
-                Grid.Row="2" 
-                Style="{StaticResource RepeatButtonScrollRightOrDownStyle}" 
-                ToolTip="Scroll the Tab Items to the Bottom" 
-                Visibility="{Binding ElementName=TabPanel, Path=CanScrollRightOrDown, Converter={StaticResource boolConverter}}"/>
-
-                    <!-- Content Panel-->
-                    <Border x:Name="ContentPanel"
-				Grid.Column="1" Grid.RowSpan="3"
-				Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" 
-                BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
-                BorderThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"
-				KeyboardNavigation.DirectionalNavigation="Contained"
-				KeyboardNavigation.TabIndex="2"
-				KeyboardNavigation.TabNavigation="Local">
-                        <ContentPresenter x:Name="PART_SelectedContentHost"
-				    Content="{Binding Path=SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
-				    ContentSource="SelectedContent"
-                    ContentTemplate="{Binding Path=ContentTemplate, RelativeSource={RelativeSource TemplatedParent}}"
-				    SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}"
-				    Margin="{Binding Path=Padding, RelativeSource={RelativeSource TemplatedParent}}"/>
-                    </Border>
-                </Grid>
-            </ControlTemplate>
-
-            <!-- 控制模板的标签条放置权-->
-            <ControlTemplate x:Key="TabControlTabPlacementRight" TargetType="{x:Type l:TabControl}">
-                <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="20"/>
-                        <RowDefinition Height="*" />
-                        <RowDefinition Height="20"/>
-                    </Grid.RowDefinitions>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*" />
-                        <ColumnDefinition Width="Auto" />
-                    </Grid.ColumnDefinitions>
-
-                    <Border Grid.RowSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}"/>
-
-                    <Grid Grid.Row="0" Grid.Column="1">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
-
-                        <!-- Repeat Buttons used for scrolling the TabItems into view-->
-                        <RepeatButton 
-                    x:Name="PART_RepeatLeft" 
-                    Panel.ZIndex="1" 
-                    Grid.Column="2" 
-                    Style="{StaticResource RepeatButtonScrollLeftOrUpStyle}" 
-                    Margin="0,0,0,-1" 
-                    ToolTip="Scroll the Tab Items to the Top" 
-                    Visibility="{Binding ElementName=TabPanel, Path=CanScrollLeftOrUp, Converter={StaticResource boolConverter}}"/>
-
-                        <!-- Toggle button which displays a context menu with a menu item for each tab which can be used to select a tab that is not in view-->
-                        <ToggleButton x:Name="PART_DropDown" Grid.Column="1" Margin="-1,0,0,-1" Style="{StaticResource DropDownToggleButtonStyle}" ToolTip="Display all the tabs in a menu" Width="20" Panel.ZIndex="1"
-                              Visibility="{Binding IsUsingItemsSource, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource _inverseBooleanConverter}}"/>
-
-                        <Button x:Name="PART_NewTabButton" Grid.Column="0" Margin="-1,0,0,-1" Style="{StaticResource NewTabButtonStyle}" Width="24"  Panel.ZIndex="1"
-				    Visibility="{Binding Path=AllowAddNew, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolConverter}}"
-				    ToolTip="Add a New tab">
-
-                            <Image Source="pack://application:,,,/Wpf.TabControl;component/Images/newtab.ico"/>
-                        </Button>
-                    </Grid>
-
-                    <ScrollViewer x:Name="PART_ScrollViewer" Grid.Row="1" Grid.Column="1" Panel.ZIndex="1" CanContentScroll="True" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled">
-                        <l:TabPanel x:Name="TabPanel" IsItemsHost="True" />
-                    </ScrollViewer>
-
-                    <RepeatButton 
-                x:Name="PART_RepeatRight" 
-                Panel.ZIndex="1" 
-                Grid.Row="2" 
-                Grid.Column="1"
-                Style="{StaticResource RepeatButtonScrollRightOrDownStyle}" 
-                ToolTip="Scroll the Tab Items to the Bottom" 
-                Visibility="{Binding ElementName=TabPanel, Path=CanScrollRightOrDown, Converter={StaticResource boolConverter}}"/>
-
-                    <!-- Content Panel-->
-                    <Border x:Name="ContentPanel"
-				Grid.RowSpan="3"
-				Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" 
-                BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
-                BorderThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"
-				KeyboardNavigation.DirectionalNavigation="Contained"
-				KeyboardNavigation.TabIndex="2"
-				KeyboardNavigation.TabNavigation="Local">
-                        <ContentPresenter x:Name="PART_SelectedContentHost"
-				    Content="{Binding Path=SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
-				    ContentSource="SelectedContent"
-                    ContentTemplate="{Binding Path=ContentTemplate, RelativeSource={RelativeSource TemplatedParent}}"
-				    SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}"
-				    Margin="{Binding Path=Padding, RelativeSource={RelativeSource TemplatedParent}}"/>
-                    </Border>
-                </Grid>
-            </ControlTemplate>
-
-            <!-- TabControl样式,定义TabControl的外观-->
-            <Style TargetType="{x:Type l:TabControl}">
-                <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle"/>
-                <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle"/>
-
-                <Setter Property="Background" Value="White"/>
-                <Setter Property="BorderBrush" Value="{StaticResource TabBorderBrush}"/>
-                <Setter Property="BorderThickness" Value="1"/>
-
-                <Setter Property="TabItemNormalBackground" Value="{StaticResource TabItemNormalBackground}"/>
-                <Setter Property="TabItemMouseOverBackground" Value="{StaticResource TabItemHoverBackground}"/>
-                <Setter Property="TabItemSelectedBackground" Value="{StaticResource TabItemSelectedBackground}"/>
-
-                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
-                <Setter Property="VerticalContentAlignment" Value="Stretch" />
-
-                <Setter Property="SnapsToDevicePixels" Value="True"/>
-                <Setter Property="Template" Value="{StaticResource TabControlTabPlacementTop}"/>
-                <Style.Triggers>
-
-                    <Trigger Property="TabStripPlacement" Value="Bottom">
-                        <Setter Property="Template" Value="{StaticResource TabControlTabPlacementBottom}"/>
-                    </Trigger>
-
-                    <Trigger Property="TabStripPlacement" Value="Left">
-                        <Setter Property="TabItemMinWidth" Value="0"/>
-                        <Setter Property="TabItemMaxWidth" Value="150"/>
-
-                        <Setter Property="TabItemMinHeight" Value="20"/>
-                        <Setter Property="TabItemMaxHeight" Value="250"/>
-                        <Setter Property="Template" Value="{StaticResource TabControlTabPlacementLeft}"/>
-                    </Trigger>
-
-                    <Trigger Property="TabStripPlacement" Value="Right">
-                        <Setter Property="TabItemMinWidth" Value="0"/>
-                        <Setter Property="TabItemMaxWidth" Value="150"/>
-
-                        <Setter Property="TabItemMinHeight" Value="20"/>
-                        <Setter Property="TabItemMaxHeight" Value="250"/>
-                        <Setter Property="Template" Value="{StaticResource TabControlTabPlacementRight}"/>
-                    </Trigger>
-                </Style.Triggers>
-            </Style>
-            
-        </ResourceDictionary>
-    </TabControl.Resources>
-</TabControl>

+ 0 - 774
src/YSAI.Controls/tabcontrol/TabControl.xaml.cs

@@ -1,774 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Data;
-using System.Windows.Input;
-using System.Windows.Media;
-
-namespace YSAI.Controls.tabcontrol
-{
-    [TemplatePart(Name = "PART_DropDown", Type = typeof(ToggleButton))]
-    [TemplatePart(Name = "PART_RepeatLeft", Type = typeof(RepeatButton))]
-    [TemplatePart(Name = "PART_RepeatRight", Type = typeof(RepeatButton))]
-    [TemplatePart(Name = "PART_NewTabButton", Type = typeof(ButtonBase))]
-    [TemplatePart(Name = "PART_ScrollViewer", Type = typeof(ScrollViewer))]
-    public partial class TabControl : System.Windows.Controls.TabControl
-    {
-
-        // public Events
-        #region Events
-
-        public event EventHandler<CancelEventArgs> TabItemAdding;
-        public event EventHandler<TabItemEventArgs> TabItemAdded;
-        public event EventHandler<TabItemCancelEventArgs> TabItemClosing;
-        public event EventHandler<TabItemEventArgs> TabItemClosed;
-        public event EventHandler<NewTabItemEventArgs> NewTabItem;
-
-        #endregion
-
-        // TemplatePart controls
-        private ToggleButton _toggleButton;
-        private ButtonBase _addNewButton;
-
-        static TabControl()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(typeof(TabControl)));
-            TabStripPlacementProperty.AddOwner(typeof(TabControl), new FrameworkPropertyMetadata(Dock.Top, new PropertyChangedCallback(OnTabStripPlacementChanged)));
-        }
-
-        public TabControl()
-        {
-            InitializeComponent();
-            Loaded +=
-                delegate
-                {
-                    SetAddNewButtonVisibility();
-                    SetTabItemsCloseButtonVisibility();
-                    IsUsingItemsSource = BindingOperations.IsDataBound(this, ItemsSourceProperty);
-
-                    if (IsUsingItemsSource && IsFixedSize)
-                        AllowAddNew = AllowDelete = false;
-                };
-        }
-
-        #region Properties
-
-        private bool IsFixedSize
-        {
-            get
-            {
-                IEnumerable items = GetItems();
-                return items as IList == null || (items as IList).IsFixedSize;
-            }
-        }
-
-        #endregion
-
-        #region Dependancy properties
-
-        public bool IsUsingItemsSource
-        {
-            get { return (bool)GetValue(IsUsingItemsSourceProperty); }
-            private set { SetValue(IsUsingItemsSourcePropertyKey, value); }
-        }
-
-        public static readonly DependencyPropertyKey IsUsingItemsSourcePropertyKey =
-            DependencyProperty.RegisterReadOnly("IsUsingItemsSource", typeof(bool), typeof(TabControl), new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty IsUsingItemsSourceProperty = IsUsingItemsSourcePropertyKey.DependencyProperty;
-
-        #region Brushes
-
-        public Brush TabItemNormalBackground
-        {
-            get { return (Brush)GetValue(TabItemNormalBackgroundProperty); }
-            set { SetValue(TabItemNormalBackgroundProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemNormalBackgroundProperty = DependencyProperty.Register("TabItemNormalBackground", typeof(Brush), typeof(TabControl), new UIPropertyMetadata(null));
-
-        public Brush TabItemMouseOverBackground
-        {
-            get { return (Brush)GetValue(TabItemMouseOverBackgroundProperty); }
-            set { SetValue(TabItemMouseOverBackgroundProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemMouseOverBackgroundProperty = DependencyProperty.Register("TabItemMouseOverBackground", typeof(Brush), typeof(TabControl), new UIPropertyMetadata(null));
-
-        public Brush TabItemSelectedBackground
-        {
-            get { return (Brush)GetValue(TabItemSelectedBackgroundProperty); }
-            set { SetValue(TabItemSelectedBackgroundProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemSelectedBackgroundProperty = DependencyProperty.Register("TabItemSelectedBackground", typeof(Brush), typeof(TabControl), new UIPropertyMetadata(null));
-
-
-
-
-        #endregion
-
-        /*
-         * Based on the whether the ControlTemplate implements the NewTab button and Close Buttons determines the functionality of the AllowAddNew & AllowDelete properties
-         * If they are in the control template, then the visibility of the AddNew & Header buttons are bound to these properties
-         * 
-        */
-        /// <summary>
-        /// Allow the User to Add New TabItems
-        /// </summary>
-        public bool AllowAddNew
-        {
-            get { return (bool)GetValue(AllowAddNewProperty); }
-            set { SetValue(AllowAddNewProperty, value); }
-        }
-        public static readonly DependencyProperty AllowAddNewProperty = DependencyProperty.Register("AllowAddNew", typeof(bool), typeof(TabControl),
-            new FrameworkPropertyMetadata(true, new PropertyChangedCallback(OnAllowAddNewChanged), OnCoerceAllowAddNewCallback));
-
-        private static void OnAllowAddNewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            ((TabControl)d).SetAddNewButtonVisibility();
-        }
-
-        private static object OnCoerceAllowAddNewCallback(DependencyObject d, object basevalue)
-        {
-            return ((TabControl)d).OnCoerceAllowAddNewCallback(basevalue);
-        }
-
-        private object OnCoerceAllowAddNewCallback(object basevalue)
-        {
-            if (ItemsSource != null)
-            {
-                IList list = ItemsSource as IList;
-                if (list != null)
-                {
-                    if (list.IsFixedSize)
-                        return false;
-                    return basevalue;
-                }
-                return false;
-            }
-            return basevalue;
-        }
-
-        /// <summary>
-        /// Allow the User to Delete TabItems
-        /// </summary>
-        public bool AllowDelete
-        {
-            get { return (bool)GetValue(AllowDeleteProperty); }
-            set { SetValue(AllowDeleteProperty, value); }
-        }
-        public static readonly DependencyProperty AllowDeleteProperty = DependencyProperty.Register("AllowDelete", typeof(bool), typeof(TabControl),
-            new FrameworkPropertyMetadata(true, new PropertyChangedCallback(OnAllowDeleteChanged), OnCoerceAllowDeleteNewCallback));
-
-        private static void OnAllowDeleteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            TabControl tc = (TabControl)d;
-            tc.SetTabItemsCloseButtonVisibility();
-        }
-
-        private static object OnCoerceAllowDeleteNewCallback(DependencyObject d, object basevalue)
-        {
-            return ((TabControl)d).OnCoerceAllowDeleteCallback(basevalue);
-        }
-        private object OnCoerceAllowDeleteCallback(object basevalue)
-        {
-            if (ItemsSource != null)
-            {
-                IList list = ItemsSource as IList;
-                if (list != null)
-                {
-                    if (list.IsFixedSize)
-                        return false;
-                    return basevalue;
-                }
-                return false;
-            }
-            return basevalue;
-        }
-
-        /// <summary>
-        /// Set new Header as the current selection
-        /// </summary>
-        public bool SelectNewTabOnCreate
-        {
-            get { return (bool)GetValue(SelectNewTabOnCreateProperty); }
-            set { SetValue(SelectNewTabOnCreateProperty, value); }
-        }
-        public static readonly DependencyProperty SelectNewTabOnCreateProperty = DependencyProperty.Register("SelectNewTabOnCreate", typeof(bool), typeof(TabControl), new UIPropertyMetadata(true));
-
-
-        /// <summary>
-        /// Determines where new TabItems are added to the TabControl
-        /// </summary>
-        /// <remarks>
-        ///     Set to true (default) to add all new Tabs to the end of the TabControl
-        ///     Set to False to insert new tabs after the current selection
-        /// </remarks>
-        public bool AddNewTabToEnd
-        {
-            get { return (bool)GetValue(AddNewTabToEndProperty); }
-            set { SetValue(AddNewTabToEndProperty, value); }
-        }
-        public static readonly DependencyProperty AddNewTabToEndProperty = DependencyProperty.Register("AddNewTabToEnd", typeof(bool), typeof(TabControl), new UIPropertyMetadata(true));
-
-        /// <summary>
-        /// defines the Minimum width of a Header
-        /// </summary>
-        [DefaultValue(20.0)]
-        [Category("Layout")]
-        [Description("Gets or Sets the minimum Width Constraint shared by all Items in the Control, individual child elements MinWidth property will overide this property")]
-        public double TabItemMinWidth
-        {
-            get { return (double)GetValue(TabItemMinWidthProperty); }
-            set { SetValue(TabItemMinWidthProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemMinWidthProperty = DependencyProperty.Register("TabItemMinWidth", typeof(double), typeof(TabControl),
-            new FrameworkPropertyMetadata(20.0, new PropertyChangedCallback(OnMinMaxChanged), CoerceMinWidth));
-
-        private static object CoerceMinWidth(DependencyObject d, object value)
-        {
-            TabControl tc = (TabControl)d;
-            double newValue = (double)value;
-
-            if (newValue > tc.TabItemMaxWidth)
-                return tc.TabItemMaxWidth;
-
-            return (newValue > 0 ? newValue : 0);
-        }
-
-        /// <summary>
-        /// defines the Minimum height of a Header
-        /// </summary>
-        [DefaultValue(20.0)]
-        [Category("Layout")]
-        [Description("Gets or Sets the minimum Height Constraint shared by all Items in the Control, individual child elements MinHeight property will override this value")]
-        public double TabItemMinHeight
-        {
-            get { return (double)GetValue(TabItemMinHeightProperty); }
-            set { SetValue(TabItemMinHeightProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemMinHeightProperty = DependencyProperty.Register("TabItemMinHeight", typeof(double), typeof(TabControl),
-            new FrameworkPropertyMetadata(20.0, new PropertyChangedCallback(OnMinMaxChanged), CoerceMinHeight));
-
-        private static object CoerceMinHeight(DependencyObject d, object value)
-        {
-            TabControl tc = (TabControl)d;
-            double newValue = (double)value;
-
-            if (newValue > tc.TabItemMaxHeight)
-                return tc.TabItemMaxHeight;
-
-            return (newValue > 0 ? newValue : 0);
-        }
-
-        /// <summary>
-        /// defines the Maximum width of a Header
-        /// </summary>
-        [DefaultValue(double.PositiveInfinity)]
-        [Category("Layout")]
-        [Description("Gets or Sets the maximum width Constraint shared by all Items in the Control, individual child elements MaxWidth property will override this value")]
-        public double TabItemMaxWidth
-        {
-            get { return (double)GetValue(TabItemMaxWidthProperty); }
-            set { SetValue(TabItemMaxWidthProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemMaxWidthProperty = DependencyProperty.Register("TabItemMaxWidth", typeof(double), typeof(TabControl),
-            new FrameworkPropertyMetadata(double.PositiveInfinity, new PropertyChangedCallback(OnMinMaxChanged), CoerceMaxWidth));
-
-        private static object CoerceMaxWidth(DependencyObject d, object value)
-        {
-            TabControl tc = (TabControl)d;
-            double newValue = (double)value;
-
-            if (newValue < tc.TabItemMinWidth)
-                return tc.TabItemMinWidth;
-
-            return newValue;
-        }
-
-        /// <summary>
-        /// defines the Maximum width of a Header
-        /// </summary>
-        [DefaultValue(double.PositiveInfinity)]
-        [Category("Layout")]
-        [Description("Gets or Sets the maximum height Constraint shared by all Items in the Control, individual child elements MaxHeight property will override this value")]
-        public double TabItemMaxHeight
-        {
-            get { return (double)GetValue(TabItemMaxHeightProperty); }
-            set { SetValue(TabItemMaxHeightProperty, value); }
-        }
-        public static readonly DependencyProperty TabItemMaxHeightProperty = DependencyProperty.Register("TabItemMaxHeight", typeof(double), typeof(TabControl),
-            new FrameworkPropertyMetadata(double.PositiveInfinity, new PropertyChangedCallback(OnMinMaxChanged), CoerceMaxHeight));
-
-        private static object CoerceMaxHeight(DependencyObject d, object value)
-        {
-            TabControl tc = (TabControl)d;
-            double newValue = (double)value;
-
-            if (newValue < tc.TabItemMinHeight)
-                return tc.TabItemMinHeight;
-
-            return newValue;
-        }
-
-        /// <summary>
-        /// OnMinMaxChanged callback responds to any of the Min/Max dependancy properties changing
-        /// </summary>
-        /// <param name="d"></param>
-        /// <param name="e"></param>
-        private static void OnMinMaxChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            TabControl tc = (TabControl)d;
-            if (tc.Template == null) return;
-
-            foreach (TabItem child in tc.InternalChildren())
-            {
-                if (child != null)
-                    child.Dimension = null;
-            }
-
-
-            //            var tabsCount = tc.GetTabsCount();
-            //            for (int i = 0; i < tabsCount; i++)
-            //            {
-            //                Header ti = tc.GetTabItem(i);
-            //                if (ti != null)
-            //                    ti.Dimension = null;
-            //            }
-
-            TabPanel tp = Helper.FindVirtualizingTabPanel(tc);
-            if (tp != null)
-                tp.InvalidateMeasure();
-        }
-
-        /// <summary>
-        /// OnTabStripPlacementChanged property callback
-        /// </summary>
-        /// <remarks>
-        ///     We need to supplement the base implementation with this method as the base method does not work when
-        ///     we are using virtualization in the tabpanel, it only updates visible items
-        /// </remarks>
-        private static void OnTabStripPlacementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            TabControl tc = (TabControl)d;
-
-            foreach (TabItem tabItem in tc.InternalChildren())
-            {
-                if (tabItem != null)
-                {
-                    tabItem.Dimension = null;
-                    tabItem.CoerceValue(TabItem.TabStripPlacementProperty);
-                }
-            }
-        }
-
-        #endregion
-
-        /*
-         * Protected override methods
-         * 
-        */
-
-        #region Overrides
-
-        /// <summary>
-        /// OnApplyTemplate override
-        /// </summary>
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-
-            // set up the event handler for the template parts
-            _toggleButton = this.Template.FindName("PART_DropDown", this) as ToggleButton;
-            if (_toggleButton != null)
-            {
-                // create a context menu for the togglebutton
-                ContextMenu cm = new ContextMenu { PlacementTarget = _toggleButton, Placement = PlacementMode.Bottom };
-
-                // create a binding between the togglebutton's IsChecked Property
-                // and the Context Menu's IsOpen Property
-                Binding b = new Binding
-                {
-                    Source = _toggleButton,
-                    Mode = BindingMode.TwoWay,
-                    Path = new PropertyPath(ToggleButton.IsCheckedProperty)
-                };
-
-                cm.SetBinding(ContextMenu.IsOpenProperty, b);
-
-                _toggleButton.ContextMenu = cm;
-                _toggleButton.Checked += DropdownButton_Checked;
-            }
-
-            ScrollViewer scrollViewer = this.Template.FindName("PART_ScrollViewer", this) as ScrollViewer;
-
-            // set up event handlers for the RepeatButtons Click event
-            RepeatButton repeatLeft = this.Template.FindName("PART_RepeatLeft", this) as RepeatButton;
-            if (repeatLeft != null)
-            {
-                repeatLeft.Click += delegate
-                {
-                    if (scrollViewer != null)
-                        scrollViewer.LineLeft();
-                };
-            }
-
-            RepeatButton repeatRight = this.Template.FindName("PART_RepeatRight", this) as RepeatButton;
-            if (repeatRight != null)
-            {
-                repeatRight.Click += delegate
-                {
-                    if (scrollViewer != null)
-                        scrollViewer.LineRight();
-                };
-            }
-
-            // set up the event handler for the 'New Tab' Button Click event
-            _addNewButton = this.Template.FindName("PART_NewTabButton", this) as ButtonBase;
-            if (_addNewButton != null)
-                _addNewButton.Click += ((sender, routedEventArgs) => AddTabItem());
-        }
-
-        /// <summary>
-        /// IsItemItsOwnContainerOverride
-        /// </summary>
-        /// <param name="item"></param>
-        /// <returns></returns>
-        protected override bool IsItemItsOwnContainerOverride(object item)
-        {
-            return item is TabItem;
-        }
-        /// <summary>
-        /// GetContainerForItemOverride
-        /// </summary>
-        /// <returns></returns>
-        protected override DependencyObject GetContainerForItemOverride()
-        {
-            return new TabItem();
-        }
-
-
-        protected override void OnPreviewKeyDown(KeyEventArgs e)
-        {
-            var tabsCount = GetTabsCount();
-            if (tabsCount == 0)
-                return;
-
-            TabItem ti = null;
-
-            switch (e.Key)
-            {
-                case Key.Home:
-                    ti = GetTabItem(0);
-                    break;
-
-                case Key.End:
-                    ti = GetTabItem(tabsCount - 1);
-                    break;
-
-                case Key.Tab:
-                    if (e.KeyboardDevice.Modifiers == ModifierKeys.Control)
-                    {
-                        var index = SelectedIndex;
-                        var direction = e.KeyboardDevice.Modifiers == ModifierKeys.Shift ? -1 : 1;
-
-                        while (true)
-                        {
-                            index += direction;
-                            if (index < 0)
-                                index = tabsCount - 1;
-                            else if (index > tabsCount - 1)
-                                index = 0;
-
-                            FrameworkElement ui = GetTabItem(index);
-                            if (ui != null)
-                            {
-                                if (ui.Visibility == Visibility.Visible && ui.IsEnabled)
-                                {
-                                    ti = GetTabItem(index);
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    break;
-            }
-
-            TabPanel panel = Helper.FindVirtualizingTabPanel(this);
-            if (panel != null && ti != null)
-            {
-                panel.MakeVisible(ti, Rect.Empty);
-                SelectedItem = ti;
-
-                e.Handled = ti.Focus();
-            }
-            base.OnPreviewKeyDown(e);
-        }
-
-        protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
-        {
-            base.OnItemsChanged(e);
-
-            if (e.Action == NotifyCollectionChangedAction.Add && SelectNewTabOnCreate)
-            {
-                TabItem tabItem = (TabItem)this.ItemContainerGenerator.ContainerFromItem(e.NewItems[e.NewItems.Count - 1]);
-                SelectedItem = tabItem;
-
-                TabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
-                if (itemsHost != null)
-                    itemsHost.MakeVisible(tabItem, Rect.Empty);
-
-                tabItem.Focus();
-            }
-        }
-
-        protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
-        {
-            base.OnItemsSourceChanged(oldValue, newValue);
-
-            IsUsingItemsSource = newValue != null;
-            if (IsFixedSize)
-                AllowAddNew = AllowDelete = false;
-
-            SetAddNewButtonVisibility();
-            SetTabItemsCloseButtonVisibility();
-        }
-
-        #endregion
-
-        /// <summary>
-        /// Handle the ToggleButton Checked event that displays a context menu of Header Headers
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void DropdownButton_Checked(object sender, RoutedEventArgs e)
-        {
-            if (_toggleButton == null) return;
-
-            _toggleButton.ContextMenu.Items.Clear();
-            _toggleButton.ContextMenu.Placement = TabStripPlacement == Dock.Bottom ? PlacementMode.Top : PlacementMode.Bottom;
-
-            int index = 0;
-            foreach (TabItem tabItem in this.InternalChildren())
-            {
-                if (tabItem != null)
-                {
-                    //var header = Helper.CloneElement(tabItem.Header);
-                    var icon = tabItem.Icon == null ? null : tabItem.Icon;
-
-                    var mi = new MenuItem { Header = tabItem.Header, Icon = icon, Tag = index++.ToString() };
-                    mi.Click += ContextMenuItem_Click;
-
-                    _toggleButton.ContextMenu.Items.Add(mi);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Handle the MenuItem's Click event
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void ContextMenuItem_Click(object sender, RoutedEventArgs e)
-        {
-            MenuItem mi = sender as MenuItem;
-            if (mi == null) return;
-
-            int index;
-            // get the index of the Header from the manuitems Tag property
-            bool b = int.TryParse(mi.Tag.ToString(), out index);
-
-            if (b)
-            {
-                TabItem tabItem = GetTabItem(index);
-                if (tabItem != null)
-                {
-                    TabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
-                    if (itemsHost != null)
-                        itemsHost.MakeVisible(tabItem, Rect.Empty);
-
-                    tabItem.Focus();
-                }
-            }
-        }
-
-        /// <summary>
-        ///     Add a new Header
-        /// </summary>
-        public void AddTabItem()
-        {
-            if (IsFixedSize)
-                throw new InvalidOperationException("ItemsSource is Fixed Size");
-
-            int i = this.SelectedIndex;
-
-            // give an opertunity to cancel the adding of the tabitem
-            CancelEventArgs c = new CancelEventArgs();
-            if (TabItemAdding != null)
-                TabItemAdding(this, c);
-
-            if (c.Cancel)
-                return;
-
-            TabItem tabItem;
-
-            // Using ItemsSource property
-            if (ItemsSource != null)
-            {
-                IList list = (IList)ItemsSource;
-                NewTabItemEventArgs n = new NewTabItemEventArgs();
-                if (NewTabItem == null)
-                    throw new InvalidOperationException("You must implement the NewTabItem event to supply the item to be added to the tab control.");
-
-                NewTabItem(this, n);
-                if (n.Content == null)
-                    return;
-
-                if (i == -1 || i == list.Count - 1 || AddNewTabToEnd)
-                    list.Add(n.Content);
-                else
-                    list.Insert(++i, n.Content);
-
-                tabItem = (TabItem)this.ItemContainerGenerator.ContainerFromItem(n.Content);
-            }
-            else
-            {
-                // Using Items Property
-                tabItem = new TabItem { Header = "New Tab" };
-
-                if (i == -1 || i == this.Items.Count - 1 || AddNewTabToEnd)
-                    this.Items.Add(tabItem);
-                else
-                    this.Items.Insert(++i, tabItem);
-            }
-
-            if (TabItemAdded != null)
-                TabItemAdded(this, new TabItemEventArgs(tabItem));
-        }
-
-        /// <summary>
-        /// Called by a child Header that wants to remove itself by clicking on the close button
-        /// </summary>
-        /// <param name="tabItem"></param>
-        public void RemoveTabItem(TabItem tabItem)
-        {
-            if (IsFixedSize)
-                throw new InvalidOperationException("ItemsSource is Fixed Size");
-
-            // gives an opertunity to cancel the removal of the tabitem
-            var c = new TabItemCancelEventArgs(tabItem);
-            if (TabItemClosing != null)
-                TabItemClosing(tabItem, c);
-
-            if (c.Cancel)
-                return;
-
-            if (ItemsSource != null)
-            {
-                var list = ItemsSource as IList;
-                object listItem = ItemContainerGenerator.ItemFromContainer(tabItem);
-                if (listItem != null && list != null)
-                    list.Remove(listItem);
-            }
-            else
-                this.Items.Remove(tabItem);
-
-            if (TabItemClosed != null)
-                TabItemClosed(this, new TabItemEventArgs(tabItem));
-        }
-
-        private void SetAddNewButtonVisibility()
-        {
-            if (this.Template == null)
-                return;
-
-            ButtonBase button = this.Template.FindName("PART_NewTabButton", this) as ButtonBase;
-            if (button == null) return;
-
-            if (IsFixedSize)
-                button.Visibility = Visibility.Collapsed;
-            else
-                button.Visibility = AllowAddNew
-                                        ? Visibility.Visible
-                                        : Visibility.Collapsed;
-        }
-
-        private void SetTabItemsCloseButtonVisibility()
-        {
-            bool isFixedSize = IsFixedSize;
-
-            var tabsCount = GetTabsCount();
-            for (int i = 0; i < tabsCount; i++)
-            {
-                TabItem ti = GetTabItem(i);
-                if (ti != null)
-                    ti.AllowDelete = !isFixedSize && this.AllowDelete;
-            }
-        }
-
-        internal IEnumerable GetItems()
-        {
-            if (IsUsingItemsSource)
-                return ItemsSource;
-            return Items;
-        }
-
-        internal int GetTabsCount()
-        {
-            if (BindingOperations.IsDataBound(this, ItemsSourceProperty))
-            {
-                IList list = ItemsSource as IList;
-                if (list != null)
-                    return list.Count;
-
-                // ItemsSource is only an IEnumerable
-                int i = 0;
-                IEnumerator enumerator = ItemsSource.GetEnumerator();
-                while (enumerator.MoveNext())
-                    i++;
-                return i;
-            }
-
-            if (Items != null)
-                return Items.Count;
-
-            return 0;
-        }
-
-        internal TabItem GetTabItem(int index)
-        {
-            if (BindingOperations.IsDataBound(this, ItemsSourceProperty))
-            {
-                IList list = ItemsSource as IList;
-                if (list != null)
-                    return this.ItemContainerGenerator.ContainerFromItem(list[index]) as TabItem;
-
-                // ItemsSource is at least an IEnumerable
-                int i = 0;
-                IEnumerator enumerator = ItemsSource.GetEnumerator();
-                while (enumerator.MoveNext())
-                {
-                    if (i == index)
-                        return this.ItemContainerGenerator.ContainerFromItem(enumerator.Current) as TabItem;
-                    i++;
-                }
-                return null;
-            }
-            return Items[index] as TabItem;
-        }
-
-        private IEnumerable InternalChildren()
-        {
-            IEnumerator enumerator = GetItems().GetEnumerator();
-            while (enumerator.MoveNext())
-            {
-                if (enumerator.Current is TabItem)
-                    yield return enumerator.Current;
-                else
-                    yield return this.ItemContainerGenerator.ContainerFromItem(enumerator.Current) as TabItem;
-            }
-        }
-    }
-}

+ 0 - 32
src/YSAI.Controls/tabcontrol/TabEventArgs.cs

@@ -1,32 +0,0 @@
-using System;
-using System.ComponentModel;
-
-namespace YSAI.Controls.tabcontrol
-{
-    public class TabItemEventArgs : EventArgs
-    {
-        public TabItem TabItem { get; private set; }
-
-        public TabItemEventArgs(TabItem item)
-        {
-            TabItem = item;
-        }
-    }
-    public class NewTabItemEventArgs : EventArgs
-    {
-        /// <summary>
-        ///     The object to be used as the Content for the new TabItem
-        /// </summary>
-        public object Content { get; set; }
-    }
-
-    public class TabItemCancelEventArgs : CancelEventArgs
-    {
-        public TabItem TabItem { get; private set; }
-
-        public TabItemCancelEventArgs(TabItem item)
-        {
-            TabItem = item;
-        }
-    }
-}

+ 0 - 86
src/YSAI.Controls/tabcontrol/TabItem.cs

@@ -1,86 +0,0 @@
-using System.Windows;
-using System.Windows.Controls.Primitives;
-
-namespace YSAI.Controls.tabcontrol
-{
-    [TemplatePart(Name = "PART_CloseButton", Type = typeof(ButtonBase))]
-    public class TabItem : System.Windows.Controls.TabItem
-    {
-        static TabItem()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(typeof(YSAI.Controls.tabcontrol.TabItem), new FrameworkPropertyMetadata(typeof(YSAI.Controls.tabcontrol.TabItem)));
-        }
-
-        /// <summary>
-        /// Provides a place to display an Icon on the Header and on the DropDown Context Menu
-        /// </summary>
-        public object Icon
-        {
-            get { return (object)GetValue(IconProperty); }
-            set { SetValue(IconProperty, value); }
-        }
-        public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(object), typeof(TabItem), new UIPropertyMetadata(null));
-
-        /// <summary>
-        /// Allow the Header to be Deleted by the end user
-        /// </summary>
-        public bool AllowDelete
-        {
-            get { return (bool)GetValue(AllowDeleteProperty); }
-            set { SetValue(AllowDeleteProperty, value); }
-        }
-        public static readonly DependencyProperty AllowDeleteProperty = DependencyProperty.Register("AllowDelete", typeof(bool), typeof(TabItem), new UIPropertyMetadata(true));
-
-        /// <summary>
-        /// OnApplyTemplate override
-        /// </summary>
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-
-            // wire up the CloseButton's Click event if the button exists
-            ButtonBase button = this.Template.FindName("PART_CloseButton", this) as ButtonBase;
-            if (button != null)
-            {
-                button.Click += delegate
-                {
-                    // get the parent tabcontrol 
-                    TabControl tc = Helper.FindParentControl<TabControl>(this);
-                    if (tc == null) return;
-
-                    // remove this tabitem from the parent tabcontrol
-                    tc.RemoveTabItem(this);
-                };
-            }
-        }
-
-        /// <summary>
-        ///     Used by the TabPanel for sizing
-        /// </summary>
-        internal Dimension Dimension { get; set; }
-
-        /// <summary>
-        /// OnMouseEnter, Create and Display a Tooltip
-        /// </summary>
-        /// <param name="e"></param>
-        protected override void OnMouseEnter(System.Windows.Input.MouseEventArgs e)
-        {
-            base.OnMouseEnter(e);
-
-            this.ToolTip = Header;
-            e.Handled = true;
-        }
-
-        /// <summary>
-        /// OnMouseLeave, remove the tooltip
-        /// </summary>
-        /// <param name="e"></param>
-        protected override void OnMouseLeave(System.Windows.Input.MouseEventArgs e)
-        {
-            base.OnMouseLeave(e);
-
-            this.ToolTip = null;
-            e.Handled = true;
-        }
-    }
-}

+ 0 - 742
src/YSAI.Controls/tabcontrol/TabPanel.cs

@@ -1,742 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Media;
-
-namespace YSAI.Controls.tabcontrol
-{
-    /// <summary>
-    /// TabPanel
-    /// </summary>
-    public class TabPanel : Panel, IScrollInfo
-    {
-        private int _maxVisibleItems;
-        //        private double _maxChildWidthOrHeight;
-        private readonly List<Rect> _childRects;
-        private Dock _tabStripPlacement;
-
-        // scrolling
-        private readonly TranslateTransform _translateTransform = new TranslateTransform();
-        private Size _extent = new Size(0, 0);
-        private Size _oldExtent = new Size(0, 0);
-        private Size _viewPort = new Size(0, 0);
-        private Size _lastSize = new Size(0, 0);
-        private Point _offset = new Point(0, 0);
-        private ScrollViewer _scrollOwner;
-
-        private int _firstVisibleIndex;
-        //        private int _childCount;
-
-        public TabPanel()
-        {
-            _childRects = new List<Rect>(4);
-            base.RenderTransform = _translateTransform;
-        }
-
-        #region CLR Properties
-        private Dock TabStripPlacement
-        {
-            get
-            {
-                Dock dock = Dock.Top;
-                TabControl templatedParent = base.TemplatedParent as TabControl;
-                if (templatedParent != null)
-                {
-                    dock = templatedParent.TabStripPlacement;
-
-                }
-                return dock;
-            }
-        }
-        private double MinimumChildWidth
-        {
-            get
-            {
-                TabControl templatedParent = base.TemplatedParent as TabControl;
-                if (templatedParent != null)
-                    return templatedParent.TabItemMinWidth;
-                return 0;
-            }
-        }
-        private double MinimumChildHeight
-        {
-            get
-            {
-                TabControl templatedParent = base.TemplatedParent as TabControl;
-                if (templatedParent != null)
-                    return templatedParent.TabItemMinHeight;
-                return 0;
-            }
-        }
-        private double MaximumChildWidth
-        {
-            get
-            {
-                TabControl templatedParent = base.TemplatedParent as TabControl;
-                if (templatedParent != null)
-                    return templatedParent.TabItemMaxWidth;
-                return double.PositiveInfinity;
-            }
-        }
-        private double MaximumChildHeight
-        {
-            get
-            {
-                TabControl templatedParent = base.TemplatedParent as TabControl;
-                if (templatedParent != null)
-                    return templatedParent.TabItemMaxHeight;
-                return double.PositiveInfinity;
-            }
-        }
-
-        private int FirstVisibleIndex
-        {
-            get { return _firstVisibleIndex; }
-            set
-            {
-                if (_firstVisibleIndex == value)
-                    return;
-
-                if (value < 0)
-                {
-                    _firstVisibleIndex = 0;
-                    return;
-                }
-
-                _firstVisibleIndex = value;
-                if (LastVisibleIndex > InternalChildren.Count - 1)
-                    FirstVisibleIndex--;
-            }
-        }
-
-        private int LastVisibleIndex
-        {
-            get { return _firstVisibleIndex + _maxVisibleItems - 1; }
-        }
-        #endregion
-
-        #region Dependancy Properties
-
-        /// <summary>
-        /// CanScrollLeftOrUp Dependancy Property
-        /// </summary>
-        [Browsable(false)]
-        internal bool CanScrollLeftOrUp
-        {
-            get { return (bool)GetValue(CanScrollLeftOrUpProperty); }
-            set { SetValue(CanScrollLeftOrUpProperty, value); }
-        }
-        internal static readonly DependencyProperty CanScrollLeftOrUpProperty = DependencyProperty.Register("CanScrollLeftOrUp", typeof(bool), typeof(TabPanel), new UIPropertyMetadata(false));
-
-        /// <summary>
-        /// CanScrollRightOrDown Dependancy Property
-        /// </summary>
-        [Browsable(false)]
-        internal bool CanScrollRightOrDown
-        {
-            get { return (bool)GetValue(CanScrollRightOrDownProperty); }
-            set { SetValue(CanScrollRightOrDownProperty, value); }
-        }
-        internal static readonly DependencyProperty CanScrollRightOrDownProperty = DependencyProperty.Register("CanScrollRightOrDown", typeof(bool), typeof(TabPanel), new UIPropertyMetadata(false));
-
-        #endregion
-
-        #region MeasureOverride
-        /// <summary>
-        /// Measure Override
-        /// </summary>
-        protected override Size MeasureOverride(Size availableSize)
-        {
-            _viewPort = availableSize;
-            _tabStripPlacement = TabStripPlacement;
-
-            switch (_tabStripPlacement)
-            {
-                case Dock.Top:
-                case Dock.Bottom:
-                    return MeasureHorizontal(availableSize);
-
-                case Dock.Left:
-                case Dock.Right:
-                    return MeasureVertical(availableSize);
-            }
-
-            return new Size();
-        }
-        #endregion
-
-        #region MeasureHorizontal
-        /// <summary>
-        /// Measure the tab items for docking at the top or bottom
-        /// </summary>
-        private Size MeasureHorizontal(Size availableSize)
-        {
-            double maxChildWidthOrHeight = 0d;
-            int childCount = InternalChildren.Count;
-            EnsureChildRects();
-
-            double extentWidth = 0d;
-            double[] widths = new double[childCount];  // stores the widths of the items for use in the arrange pass
-
-            for (int i = 0; i < childCount; i++)
-            {
-                TabItem tabItem = InternalChildren[i] as TabItem;
-                if (tabItem == null) return new Size();
-
-                SetDimensions(tabItem);
-
-                tabItem.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
-
-                ClearDimensions(tabItem);
-
-                // calculate the maximum child height
-                maxChildWidthOrHeight = Math.Max(maxChildWidthOrHeight, Math.Ceiling(tabItem.DesiredSize.Height));
-
-                // calculate the child width while respecting the Maximum & Minimum width constraints
-                widths[i] = Math.Min(MaximumChildWidth, Math.Max(MinimumChildWidth, Math.Ceiling(tabItem.DesiredSize.Width)));
-
-                // determines how much horizontal space we require
-                extentWidth += widths[i];
-            }
-            maxChildWidthOrHeight = Math.Max(MinimumChildHeight, Math.Min(MaximumChildHeight, maxChildWidthOrHeight));  // observe the constraints
-            _extent = new Size(extentWidth, maxChildWidthOrHeight);
-
-            bool flag = false;
-            // 1). all the children fit into the available space using there desired widths
-            if (extentWidth <= availableSize.Width)
-            {
-                _maxVisibleItems = childCount;
-                FirstVisibleIndex = 0;
-
-                double left = 0;
-                for (int i = 0; i < childCount; i++)
-                {
-                    _childRects[i] = new Rect(left, 0, widths[i], maxChildWidthOrHeight);
-                    left += widths[i];
-
-                    FrameworkElement child = InternalChildren[i] as FrameworkElement;
-                    if (child != null) child.Measure(new Size(widths[i], maxChildWidthOrHeight));
-                }
-
-                CanScrollLeftOrUp = false;
-                CanScrollRightOrDown = false;
-
-                flag = true;
-            }
-
-            // 2). all the children fit in the available space if we reduce their widths to a uniform value 
-            // while staying within the MinimumChildWidth and MaximumChildWidth constraints
-            if (!flag)
-            {
-                // make sure the width is not greater than the MaximumChildWidth constraints
-                double targetWidth = Math.Min(MaximumChildWidth, availableSize.Width / childCount);
-
-                // target width applies now if whether we can fit all items in the available space or whether we are scrolling
-                if (targetWidth >= MinimumChildWidth)
-                {
-                    _maxVisibleItems = childCount;
-                    FirstVisibleIndex = 0;
-
-                    extentWidth = 0;
-                    double left = 0;
-
-                    for (int i = 0; i < childCount; i++)
-                    {
-                        extentWidth += targetWidth;
-                        widths[i] = targetWidth;
-                        _childRects[i] = new Rect(left, 0, widths[i], maxChildWidthOrHeight);
-                        left += widths[i];
-
-                        FrameworkElement child = InternalChildren[i] as FrameworkElement;
-                        if (child != null) child.Measure(new Size(widths[i], maxChildWidthOrHeight));
-                    }
-                    _extent = new Size(extentWidth, maxChildWidthOrHeight);
-
-                    flag = true;
-
-                    CanScrollLeftOrUp = false;
-                    CanScrollRightOrDown = false;
-                }
-            }
-
-            // 3) we can not fit all the children in the viewport, so now we will enable scrolling/virtualizing items
-            if (!flag)
-            {
-                _maxVisibleItems = (int)Math.Floor(_viewPort.Width / MinimumChildWidth);            // calculate how many visible children we can show at once
-                if (_maxVisibleItems == 0)
-                    _maxVisibleItems = 1;
-
-                double targetWidth = availableSize.Width / _maxVisibleItems;                        // calculate the new target width
-                FirstVisibleIndex = _firstVisibleIndex;
-
-                extentWidth = 0;
-                double left = 0;
-                for (int i = 0; i < childCount; i++)
-                {
-                    extentWidth += targetWidth;
-                    widths[i] = targetWidth;
-
-                    _childRects[i] = new Rect(left, 0, widths[i], maxChildWidthOrHeight);
-                    left += widths[i];
-
-
-                    FrameworkElement child = InternalChildren[i] as FrameworkElement;
-                    if (child != null) child.Measure(new Size(widths[i], maxChildWidthOrHeight));
-                }
-                _extent = new Size(extentWidth, maxChildWidthOrHeight);
-
-                CanScrollLeftOrUp = LastVisibleIndex < childCount - 1;
-                CanScrollRightOrDown = FirstVisibleIndex > 0;
-            }
-
-            return new Size(double.IsInfinity(availableSize.Width) ? _extent.Width : availableSize.Width, maxChildWidthOrHeight);
-        }
-
-        #endregion
-
-        #region MeasureVertical
-
-        /// <summary>
-        /// Measure the tab items for docking at the left or right
-        /// </summary>
-        private Size MeasureVertical(Size availableSize)
-        {
-            int childCount = InternalChildren.Count;
-            double maxChildWidthOrHeight = 0d;
-
-            EnsureChildRects();
-
-            double extentHeight = 0d;
-            double[] heights = new double[childCount];
-
-            // we will first measure all the children with unlimited space to get their desired sizes
-            // this will also get us the height required for all TabItems
-            for (int i = 0; i < childCount; i++)
-            {
-                TabItem tabItem = InternalChildren[i] as TabItem;
-                if (tabItem == null) return new Size();
-
-                SetDimensions(tabItem);
-
-                tabItem.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
-
-                ClearDimensions(tabItem);
-
-                // calculate the maximum child width
-                maxChildWidthOrHeight = Math.Max(maxChildWidthOrHeight, Math.Ceiling(tabItem.DesiredSize.Width));
-
-                // calculate the child width while respecting the Maximum & Minimum width constraints
-                heights[i] = Math.Min(MaximumChildHeight, Math.Max(MinimumChildHeight, Math.Ceiling(tabItem.DesiredSize.Height)));
-
-                // determines how much horizontal space we require
-                extentHeight += heights[i];
-            }
-            maxChildWidthOrHeight = Math.Max(MinimumChildWidth, Math.Min(MaximumChildWidth, maxChildWidthOrHeight));  // observe the constraints
-            _extent = new Size(maxChildWidthOrHeight, extentHeight);
-
-            bool flag = false;
-            // 1). all the children fit into the available space using there desired widths
-            if (extentHeight <= availableSize.Height)
-            {
-                _maxVisibleItems = childCount;
-                FirstVisibleIndex = 0;
-
-                double top = 0;
-                for (int i = 0; i < childCount; i++)
-                {
-                    _childRects[i] = new Rect(0, top, maxChildWidthOrHeight, heights[i]);
-                    top += heights[i];
-
-                    FrameworkElement child = InternalChildren[i] as FrameworkElement;
-                    if (child != null) child.Measure(new Size(maxChildWidthOrHeight, heights[i]));
-                }
-
-                CanScrollLeftOrUp = false;
-                CanScrollRightOrDown = false;
-
-                flag = true;
-            }
-
-            // 2). all the children fit in the available space if we reduce their widths to a uniform value 
-            // while staying within the MinimumChildWidth and MaximumChildWidth constraints
-            if (!flag)
-            {
-                // make sure the width is not greater than the MaximumChildWidth constraints
-                double targetHeight = Math.Min(MaximumChildHeight, availableSize.Height / childCount);
-
-                // target width applies now if whether we can fit all items in the available space or whether we are scrolling
-                if (targetHeight >= MinimumChildHeight)
-                {
-                    _maxVisibleItems = childCount;
-                    FirstVisibleIndex = 0;
-
-                    extentHeight = 0;
-                    double top = 0;
-
-                    for (int i = 0; i < childCount; i++)
-                    {
-                        extentHeight += targetHeight;
-                        heights[i] = targetHeight;
-                        _childRects[i] = new Rect(0, top, maxChildWidthOrHeight, heights[i]);
-                        top += heights[i];
-
-                        FrameworkElement child = InternalChildren[i] as FrameworkElement;
-                        if (child != null) child.Measure(new Size(maxChildWidthOrHeight, heights[i]));
-                    }
-                    _extent = new Size(maxChildWidthOrHeight, extentHeight);
-
-                    flag = true;
-
-                    CanScrollLeftOrUp = false;
-                    CanScrollRightOrDown = false;
-                }
-            }
-
-            // 3) we can not fit all the children in the viewport, so now we will enable scrolling/virtualizing items
-            if (!flag)
-            {
-                _maxVisibleItems = (int)Math.Floor(_viewPort.Height / MinimumChildHeight);          // calculate how many visible children we can show at once
-                double targetHeight = availableSize.Height / _maxVisibleItems;                      // calculate the new target width
-                FirstVisibleIndex = _firstVisibleIndex;
-
-                extentHeight = 0;
-                double top = 0;
-                for (int i = 0; i < childCount; i++)
-                {
-                    extentHeight += targetHeight;
-                    heights[i] = targetHeight;
-                    _childRects[i] = new Rect(0, top, maxChildWidthOrHeight, heights[i]);
-                    top += heights[i];
-
-                    FrameworkElement child = InternalChildren[i] as FrameworkElement;
-                    if (child != null) child.Measure(new Size(maxChildWidthOrHeight, heights[i]));
-                }
-                _extent = new Size(maxChildWidthOrHeight, extentHeight);
-
-                CanScrollLeftOrUp = LastVisibleIndex < childCount - 1;
-                CanScrollRightOrDown = FirstVisibleIndex > 0;
-            }
-
-            return new Size(maxChildWidthOrHeight, double.IsInfinity(availableSize.Height) ? _extent.Height : availableSize.Height);
-
-        }
-        #endregion
-
-        #region ArrangeOverride
-
-        /// <summary>
-        /// Arrange Override
-        /// </summary>
-        protected override Size ArrangeOverride(Size finalSize)
-        {
-            // monitors changes to the ScrollViewer extent value
-            if (_oldExtent != _extent)
-            {
-                _oldExtent = _extent;
-                if (_scrollOwner != null)
-                    _scrollOwner.InvalidateScrollInfo();
-            }
-
-            // monitors changes to the parent container size, (ie window resizes)
-            if (finalSize != _lastSize)
-            {
-                _lastSize = finalSize;
-                if (_scrollOwner != null)
-                    _scrollOwner.InvalidateScrollInfo();
-            }
-
-            // monitor scrolling being removed
-            bool invalidateMeasure = false;
-            if (_extent.Width <= _viewPort.Width && _offset.X > 0)
-            {
-                _offset.X = 0;
-                _translateTransform.X = 0;
-
-                if (_scrollOwner != null)
-                    _scrollOwner.InvalidateScrollInfo();
-
-                invalidateMeasure = true;
-            }
-            if (_extent.Height <= _viewPort.Height && _offset.Y > 0)
-            {
-                _offset.Y = 0;
-                _translateTransform.Y = 0;
-
-                if (_scrollOwner != null)
-                    _scrollOwner.InvalidateScrollInfo();
-
-                invalidateMeasure = true;
-            }
-            if (invalidateMeasure)
-                InvalidateMeasure();
-
-
-
-            // arrange the children
-            for (var i = 0; i < InternalChildren.Count; i++)
-            {
-                InternalChildren[i].Arrange(_childRects[i]);
-            }
-
-            // we need these lines as when the Scroll Buttons get Shown/Hidden,
-            // the _offset value gets out of line, this will ensure that our scroll position stays in line
-            if (InternalChildren.Count > 0)
-            {
-                _offset = _childRects[FirstVisibleIndex].TopLeft;
-                _translateTransform.X = -_offset.X;
-                _translateTransform.Y = -_offset.Y;
-            }
-
-            return finalSize;
-        }
-        #endregion
-
-        private void EnsureChildRects()
-        {
-            while (InternalChildren.Count > _childRects.Count)
-                _childRects.Add(new Rect());
-        }
-
-        #region IScrollInfo Members
-
-        public bool CanHorizontallyScroll { get; set; }
-
-        public bool CanVerticallyScroll { get; set; }
-
-        public double ExtentHeight
-        {
-            get { return _extent.Height; }
-        }
-
-        public double ExtentWidth
-        {
-            get { return _extent.Width; }
-        }
-
-        public double HorizontalOffset
-        {
-            get { return _offset.X; }
-        }
-
-        public void LineDown()
-        {
-            LineRight();
-        }
-
-        public void LineLeft()
-        {
-            // this works because we can guarantee that when we are in scroll mode, 
-            // there will be children, and they will all be of equal size
-            FirstVisibleIndex++;
-
-            if (_tabStripPlacement == Dock.Top || _tabStripPlacement == Dock.Bottom)
-                SetHorizontalOffset(HorizontalOffset + _childRects[0].Width);
-            else
-                SetVerticalOffset(HorizontalOffset + _childRects[0].Height);
-        }
-
-        public void LineRight()
-        {
-            FirstVisibleIndex--;
-
-            if (_tabStripPlacement == Dock.Top || _tabStripPlacement == Dock.Bottom)
-                SetHorizontalOffset(HorizontalOffset - _childRects[0].Width);
-            else
-                SetVerticalOffset(HorizontalOffset - _childRects[0].Height);
-        }
-
-        public void LineUp()
-        {
-            LineLeft();
-        }
-
-        public Rect MakeVisible(Visual visual, Rect rectangle)
-        {
-            InvalidateMeasure();
-            UpdateLayout();
-
-            TabControl ic = ItemsControl.GetItemsOwner(this) as TabControl;
-            if (ic == null) return Rect.Empty;
-
-            int index = -1;
-            var tabsCount = ic.GetTabsCount();
-            for (int i = 0; i < tabsCount; i++)
-            {
-                if (visual.Equals(ic.GetTabItem(i)))
-                {
-                    index = i;
-                    break;
-                }
-            }
-            if (index > -1)
-            {
-                if (index < FirstVisibleIndex)
-                    FirstVisibleIndex = index;
-                else if (index > LastVisibleIndex)
-                {
-                    while (index > LastVisibleIndex)
-                        FirstVisibleIndex++;
-                }
-
-                InvalidateArrange();
-            }
-
-            return Rect.Empty;
-        }
-
-        public void MouseWheelDown()
-        {
-            LineDown();
-        }
-
-        public void MouseWheelLeft()
-        {
-            LineLeft();
-        }
-
-        public void MouseWheelRight()
-        {
-            LineRight();
-        }
-
-        public void MouseWheelUp()
-        {
-            LineUp();
-        }
-
-        public void PageDown()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void PageLeft()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void PageRight()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void PageUp()
-        {
-            throw new NotImplementedException();
-        }
-
-        public ScrollViewer ScrollOwner
-        {
-            get { return _scrollOwner; }
-            set { _scrollOwner = value; }
-        }
-
-        public void SetHorizontalOffset(double offset)
-        {
-            if (offset < 0 || _viewPort.Width >= _extent.Width)
-                offset = 0;
-            else
-            {
-                if (offset + _viewPort.Width > _extent.Width)
-                    offset = _extent.Width - _viewPort.Width;
-            }
-
-            _offset.X = offset;
-            if (_scrollOwner != null)
-                _scrollOwner.InvalidateScrollInfo();
-
-            _translateTransform.X = -offset;
-
-            InvalidateMeasure();
-        }
-
-        public void SetVerticalOffset(double offset)
-        {
-            if (offset < 0 || _viewPort.Height >= _extent.Height)
-                offset = 0;
-            else
-            {
-                if (offset + _viewPort.Height > _extent.Height)
-                    offset = _extent.Height - _viewPort.Height;
-            }
-
-            _offset.Y = offset;
-            if (_scrollOwner != null)
-                _scrollOwner.InvalidateScrollInfo();
-
-            _translateTransform.Y = -offset;
-
-            InvalidateMeasure();
-        }
-
-        public double VerticalOffset
-        {
-            get { return _offset.Y; }
-        }
-
-        public double ViewportHeight
-        {
-            get { return _viewPort.Height; }
-        }
-
-        public double ViewportWidth
-        {
-            get { return _viewPort.Width; }
-        }
-
-        #endregion
-
-        #region Helpers
-
-        private static void SetDimensions(TabItem tabItem)
-        {
-            if (tabItem.Dimension == null)
-            {
-                // store the original size specifications of the tab
-                tabItem.Dimension =
-                    new Dimension
-                    {
-                        Height = tabItem.Height,
-                        Width = tabItem.Width,
-                        MaxHeight = tabItem.MaxHeight,
-                        MaxWidth = tabItem.MaxWidth,
-                        MinHeight = tabItem.MinHeight,
-                        MinWidth = tabItem.MinWidth
-                    };
-            }
-            else
-            {
-                // restore the original values for the tab
-                tabItem.BeginInit();
-                tabItem.Height = tabItem.Dimension.Height;
-                tabItem.Width = tabItem.Dimension.Width;
-                tabItem.MaxHeight = tabItem.Dimension.MaxHeight;
-                tabItem.MaxWidth = tabItem.Dimension.MaxWidth;
-                tabItem.MinHeight = tabItem.Dimension.MinHeight;
-                tabItem.MinWidth = tabItem.Dimension.MinWidth;
-                tabItem.EndInit();
-            }
-        }
-
-        private static void ClearDimensions(FrameworkElement tabItem)
-        {
-            // remove any size restrictions from the Header,
-            // this is because the TabControl's size restriction properties takes precedence over
-            // the individual tab items
-            // eg, if the TabControl sets the TabItemMaxWidth property to 300, but the Header
-            // has a minWidth of 400, the TabControls value of 300 should be used
-            tabItem.BeginInit();
-            tabItem.Height = double.NaN;
-            tabItem.Width = double.NaN;
-            tabItem.MaxHeight = double.PositiveInfinity;
-            tabItem.MaxWidth = double.PositiveInfinity;
-            tabItem.MinHeight = 0;
-            tabItem.MinWidth = 0;
-            tabItem.EndInit();
-        }
-
-        #endregion
-    }
-}

+ 2 - 1
src/YSAI.Converters/YSAI.Converters.csproj

@@ -1,9 +1,10 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-	<TargetFrameworks>net6.0-windows;net8.0-windows</TargetFrameworks>
+    <TargetFramework>net8.0-windows</TargetFramework>
     <Nullable>enable</Nullable>
     <UseWPF>true</UseWPF>
+    <ImplicitUsings>enable</ImplicitUsings>
   </PropertyGroup>
 
 </Project>

+ 10 - 11
src/YSAI.WindowMessage/Window.xaml

@@ -1,16 +1,15 @@
-<sv:WindowBase x:Class="YSAI.WindowMessage.Window"
-        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-        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:YSAI.WindowMessage"
-        xmlns:btn="clr-namespace:YSAI.Controls.button;assembly=YSAI.Controls"
-        xmlns:sv="clr-namespace:YSAI.Window;assembly=YSAI.Window"
-        WindowStartupLocation="CenterScreen" IsVer="False" IsSkin="False" Height="266" ResizeMode="NoResize"  MinWidth="266" Width="1" IsTitleLeft="true">
+<core:WindowBase  
+    x:Class="YSAI.Core.Wpf.MWindow"
+    xmlns:core="clr-namespace:YSAI.Core.Wpf"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button" 
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+    WindowStartupLocation="CenterScreen" IsVer="False" IsSkin="False" Height="266" ResizeMode="NoResize"  MinWidth="266" Width="1" IsTitleLeft="true">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="pack://application:,,,/YSAI.Resources;component/style/Style_Button.xaml" />
+                <ResourceDictionary Source="/YSAI.Core.Wpf;component/resources/style/Style_Button.xaml" />
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
     </Window.Resources>
@@ -54,4 +53,4 @@
             </Grid>
         </Border>
     </Grid>
-</sv:WindowBase>
+</core:WindowBase>

+ 19 - 0
src/YSAI.Core.Wpf/MWindow.xaml.cs

@@ -0,0 +1,19 @@
+namespace YSAI.Core.Wpf
+{
+    /// <summary>
+    /// MWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class MWindow : WindowBase, IDisposable
+    {
+        public MWindow()
+        {
+            InitializeComponent();
+            this.DataContext = new MWindowController(this, ContentControl);
+        }
+
+        public void Dispose()
+        {
+            GC.SuppressFinalize(this);
+        }
+    }
+}

+ 82 - 83
src/YSAI.WindowMessage/WindowController.cs

@@ -1,22 +1,95 @@
-using System;
-using System.Drawing;
-using System.Threading;
-using System.Threading.Tasks;
+using System.Drawing;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using YSAI.Core.Wpf.mvvm;
 using YSAI.Langs;
-using YSAI.Mvvm;
 using YSAI.Unility.Windows;
 using Brushes = System.Windows.Media.Brushes;
 
-namespace YSAI.WindowMessage
+namespace YSAI.Core.Wpf
 {
-    public class WindowController : NotifyObject
+    public enum MessageBoxButton
     {
-        public WindowController(FrameworkElement ThisWindow, Label ContentControl)
+        /// <summary>
+        /// 确认按钮
+        /// </summary>
+        OK = 0,
+
+        /// <summary>
+        /// 确认取消按钮
+        /// </summary>
+        OKCancel = 1,
+
+        /// <summary>
+        /// 是按钮
+        /// </summary>
+        Yes = 2,
+
+        /// <summary>
+        /// 是否按钮
+        /// </summary>
+        YesNo = 3
+    }
+
+    public enum MessageBoxImage
+    {
+        /// <summary>
+        /// 黄色背景/三角形/黑色感叹高
+        /// </summary>
+        Exclamation,
+
+        /// <summary>
+        /// 应用程序图标
+        /// </summary>
+        Application,
+
+        /// <summary>
+        /// 蓝色背景/圆形/白色倒立感叹号
+        /// </summary>
+        Asterisk,
+
+        /// <summary>
+        /// 红色背景/圆形/白色差
+        /// </summary>
+        Error,
+
+        /// <summary>
+        /// 红色背景/圆形/白色差
+        /// </summary>
+        Hand,
+
+        /// <summary>
+        /// 蓝色背景/圆形/白色倒立感叹号
+        /// </summary>
+        Information,
+
+        /// <summary>
+        /// 蓝色背景/圆形/白色问号
+        /// </summary>
+        Question,
+
+        /// <summary>
+        /// 盾牌
+        /// </summary>
+        Shield,
+
+        /// <summary>
+        /// 黄色背景/三角形/黑色感叹高
+        /// </summary>
+        Warning,
+
+        /// <summary>
+        /// 应用程序图标
+        /// </summary>
+        WinLogo
+    }
+
+    public class MWindowController : NotifyObject
+    {
+        public MWindowController(FrameworkElement ThisWindow, Label ContentControl)
         {
             this.ContentControl = ContentControl;
             this.ThisWindow = (System.Windows.Window)ThisWindow;
@@ -284,81 +357,7 @@ namespace YSAI.WindowMessage
             return true;
         }
 
-        public enum MessageBoxButton
-        {
-            /// <summary>
-            /// 确认按钮
-            /// </summary>
-            OK = 0,
-
-            /// <summary>
-            /// 确认取消按钮
-            /// </summary>
-            OKCancel = 1,
-
-            /// <summary>
-            /// 是按钮
-            /// </summary>
-            Yes = 2,
-
-            /// <summary>
-            /// 是否按钮
-            /// </summary>
-            YesNo = 3
-        }
 
-        public enum MessageBoxImage
-        {
-            /// <summary>
-            /// 黄色背景/三角形/黑色感叹高
-            /// </summary>
-            Exclamation,
-
-            /// <summary>
-            /// 应用程序图标
-            /// </summary>
-            Application,
-
-            /// <summary>
-            /// 蓝色背景/圆形/白色倒立感叹号
-            /// </summary>
-            Asterisk,
-
-            /// <summary>
-            /// 红色背景/圆形/白色差
-            /// </summary>
-            Error,
-
-            /// <summary>
-            /// 红色背景/圆形/白色差
-            /// </summary>
-            Hand,
-
-            /// <summary>
-            /// 蓝色背景/圆形/白色倒立感叹号
-            /// </summary>
-            Information,
-
-            /// <summary>
-            /// 蓝色背景/圆形/白色问号
-            /// </summary>
-            Question,
-
-            /// <summary>
-            /// 盾牌
-            /// </summary>
-            Shield,
-
-            /// <summary>
-            /// 黄色背景/三角形/黑色感叹高
-            /// </summary>
-            Warning,
-
-            /// <summary>
-            /// 应用程序图标
-            /// </summary>
-            WinLogo
-        }
 
         /// <summary>
         /// 计算字符串长度,设置控件长度
@@ -399,4 +398,4 @@ namespace YSAI.WindowMessage
         /// </summary>
         public bool BoolRet { get; set; }
     }
-}
+}

+ 6 - 7
src/YSAI.WindowMessage/MessageBox.cs

@@ -1,17 +1,16 @@
-using MessageBoxButton = YSAI.WindowMessage.WindowController.MessageBoxButton;
-using MessageBoxImage = YSAI.WindowMessage.WindowController.MessageBoxImage;
+using static YSAI.Core.Wpf.MWindowController;
 
-namespace YSAI.WindowMessage
+namespace YSAI.Core.Wpf
 {
     public class MessageBox
     {
         public static bool Show(string Content, string Title, MessageBoxButton btn, MessageBoxImage img)
         {
-            using (Window mainWindow = new Window())
+            using (MWindow mainWindow = new MWindow())
             {
-                ((WindowController)mainWindow.DataContext).SetMessage(Content, Title, btn, img);
+                ((MWindowController)mainWindow.DataContext).SetMessage(Content, Title, btn, img);
                 mainWindow.ShowDialog();
-                return ((WindowController)mainWindow.DataContext).BoolRet;
+                return ((MWindowController)mainWindow.DataContext).BoolRet;
             }
         }
 
@@ -35,4 +34,4 @@ namespace YSAI.WindowMessage
             return Show(Content, string.Empty, MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
-}
+}

+ 5 - 10
src/YSAI.Window/WindowBase.cs

@@ -1,6 +1,4 @@
-using System;
 using System.IO;
-using System.Linq;
 using System.Runtime.InteropServices;
 using System.Windows;
 using System.Windows.Controls;
@@ -10,9 +8,9 @@ using System.Windows.Media.Animation;
 using YSAI.Langs;
 using YSAI.Log;
 using YSAI.Unility;
-using static YSAI.Window.WindowHelper;
+using static YSAI.Core.Wpf.WindowHelper;
 
-namespace YSAI.Window
+namespace YSAI.Core.Wpf
 {
     public class WindowBase : System.Windows.Window
     {
@@ -309,10 +307,7 @@ namespace YSAI.Window
             }
         }
 
-        /// <summary>
-        /// Ƥ·ôÃû³Æ
-        /// </summary>
-        private string SkinName { get; set; }
+
 
         /// <summary>
         /// ÉèÖÃÆ¤·ô
@@ -321,7 +316,7 @@ namespace YSAI.Window
         {
             try
             {
-                string strSourceDic = "pack://application:,,,/YSAI.Window;component/Themes/WindowTemplate_" + SkinName + ".xaml";
+                string strSourceDic = "pack://application:,,,/YSAI.Core.Wpf;component/themes/WindowTemplate_" + SkinName + ".xaml";
                 Application.Current.Resources.BeginInit();
                 Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
                 {
@@ -329,7 +324,7 @@ namespace YSAI.Window
                 });
                 Application.Current.Resources.MergedDictionaries.RemoveAt(0);
                 Application.Current.Resources.EndInit();
-                WindowHelper.OnSkinSwitchEventHandler?.Invoke(null, null);
+                WindowHelper.OnSkinSwitchEventHandler?.Invoke(SkinName, null);
             }
             catch (Exception ex)
             {

+ 12 - 2
src/YSAI.Window/WindowHelper.cs

@@ -1,13 +1,23 @@
-using System;
 using System.ComponentModel;
 using System.Diagnostics.CodeAnalysis;
 using System.Runtime.InteropServices;
 using System.Security;
 
-namespace YSAI.Window
+namespace YSAI.Core.Wpf
 {
     public static class WindowHelper
     {
+        /// <summary>
+        /// Ƥ·ôÃû³Æ
+        /// </summary>
+        public static string SkinName { get; set; }
+        /// <summary>
+        /// »ñÈ¡µ±Ç°Æ¤·ô
+        /// </summary>
+        public static string GetSkinName()
+        {
+            return SkinName;
+        }
         /// <summary>
         /// Ƥ·ôÇл»Î¯ÍÐ
         /// </summary>

+ 47 - 0
src/YSAI.Core.Wpf/YSAI.Core.Wpf.csproj

@@ -0,0 +1,47 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+	<PropertyGroup>
+		<TargetFrameworks>net6.0-windows;net8.0-windows</TargetFrameworks>
+		<Nullable>enable</Nullable>
+		<UseWPF>true</UseWPF>
+		<ImplicitUsings>enable</ImplicitUsings>
+	</PropertyGroup>
+
+	<ItemGroup>
+	  <None Remove="controls\keyboard\Image\Backspace.png" />
+	  <None Remove="controls\keyboard\Image\Button1.png" />
+	  <None Remove="controls\keyboard\Image\Button2.5.png" />
+	  <None Remove="controls\keyboard\Image\Button2.png" />
+	  <None Remove="controls\keyboard\Image\Button5.5.png" />
+	  <None Remove="controls\keyboard\Image\Enter1.png" />
+	  <None Remove="controls\keyboard\Image\Enter2.5.png" />
+	  <None Remove="controls\keyboard\Image\Enter2.png" />
+	  <None Remove="controls\keyboard\Image\Enter5.5.png" />
+	  <None Remove="themes\Image\ContentBackgroundPicture.png" />
+	</ItemGroup>
+	<ItemGroup>
+		<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
+	</ItemGroup>
+	<ItemGroup>
+		<ProjectReference Include="..\YSAI.Langs\YSAI.Langs.csproj" />
+		<ProjectReference Include="..\YSAI.Unility.Windows\YSAI.Unility.Windows.csproj" />
+	</ItemGroup>
+	<ItemGroup>
+	  <Resource Include="controls\keyboard\Image\Backspace.png" />
+	  <Resource Include="controls\keyboard\Image\Button1.png" />
+	  <Resource Include="controls\keyboard\Image\Button2.5.png" />
+	  <Resource Include="controls\keyboard\Image\Button2.png" />
+	  <Resource Include="controls\keyboard\Image\Button5.5.png" />
+	  <Resource Include="controls\keyboard\Image\Enter1.png" />
+	  <Resource Include="controls\keyboard\Image\Enter2.5.png" />
+	  <Resource Include="controls\keyboard\Image\Enter2.png" />
+	  <Resource Include="controls\keyboard\Image\Enter5.5.png" />
+	  <Resource Include="themes\Image\ContentBackgroundPicture.png" />
+	</ItemGroup>
+	<ItemGroup>
+	  <Compile Update="MWindow.xaml.cs">
+	    <SubType>Code</SubType>
+	  </Compile>
+	</ItemGroup>
+
+</Project>

+ 2 - 3
src/YSAI.Controls/badge/BadgeControl.xaml

@@ -1,10 +1,9 @@
-<ContentControl x:Class="YSAI.Controls.badge.BadgeControl"
+<ContentControl x:Class="YSAI.Core.Wpf.controls.badge.BadgeControl"
              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:YSAI.Controls.badge"
-                xmlns:cs="clr-namespace:YSAI.Converters;assembly=YSAI.Converters"
+                xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters"
                 mc:Ignorable="d"
                 MinWidth="{Binding ActualHeight,ElementName=badge}"
                 x:Name="badge"

+ 2 - 3
src/YSAI.Controls/badge/BadgeControl.xaml.cs

@@ -1,10 +1,9 @@
-using System;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Media.Animation;
 
-namespace YSAI.Controls.badge
+namespace YSAI.Core.Wpf.controls.badge
 {
     /// <summary>
     /// BadgeControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/barindicator/BarIndicatorControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.barindicator.BarIndicatorControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.barindicator.BarIndicatorControl"
              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:YSAI.Controls.barindicator" x:Name="main">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.barindicator" x:Name="main">
     <Viewbox>
         <Grid>
             <!--背景矩形-->

+ 1 - 1
src/YSAI.Controls/barindicator/BarIndicatorControl.xaml.cs

@@ -5,7 +5,7 @@ using System.Windows.Media;
 using System.Windows.Media.Animation;
 using System.Windows.Shapes;
 
-namespace YSAI.Controls.barindicator
+namespace YSAI.Core.Wpf.controls.barindicator
 {
     /// <summary>
     /// BorIndicatorControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/button/ButtonControl.xaml

@@ -1,9 +1,9 @@
-<Button x:Class="YSAI.Controls.button.ButtonControl"
+<Button x:Class="YSAI.Core.Wpf.controls.button.ButtonControl"
              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:YSAI.Controls.button">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.button">
     <Button.Resources>
         <Style TargetType="{x:Type local:ButtonControl}">
             <Setter Property="Height" Value="30" />

+ 1 - 1
src/YSAI.Controls/button/ButtonControl.xaml.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.button
+namespace YSAI.Core.Wpf.controls.button
 {
     /// <summary>
     /// ButtonControl.xaml 的交互逻辑

+ 3 - 3
src/YSAI.Controls/colorpicker/ColorPickerControl.xaml

@@ -1,10 +1,10 @@
-<ContentControl x:Class="YSAI.Controls.colorpicker.ColorPickerControl"
+<ContentControl x:Class="YSAI.Core.Wpf.controls.colorpicker.ColorPickerControl"
              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:cs="clr-namespace:YSAI.Converters;assembly=YSAI.Converters"
-             xmlns:local="clr-namespace:YSAI.Controls.colorpicker" mc:Ignorable="d"
+                xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters"
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.colorpicker" mc:Ignorable="d"
                 BorderBrush="LightGray"
                 BorderThickness="1"
                 d:DesignHeight="450"

+ 1 - 1
src/YSAI.Controls/colorpicker/ColorPickerControl.xaml.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     /// <summary>
     /// ColorPickerControl.xaml 的交互逻辑

+ 1 - 1
src/YSAI.Controls/colorpicker/ColorPickerControlConverter.cs

@@ -4,7 +4,7 @@ using System.Windows;
 using System.Windows.Data;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     internal class GridLengthConverter : IValueConverter
     {

+ 2 - 2
src/YSAI.Controls/colorpicker/ColorSelector.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.colorpicker.ColorSelector"
+<UserControl x:Class="YSAI.Core.Wpf.controls.colorpicker.ColorSelector"
              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:YSAI.Controls.colorpicker"
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.colorpicker"
              mc:Ignorable="d"
              d:DesignHeight="300"
              d:DesignWidth="340"

+ 1 - 1
src/YSAI.Controls/colorpicker/ColorSelector.xaml.cs

@@ -7,7 +7,7 @@ using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     /// <summary>
     /// ColorSelector.xaml 的交互逻辑

+ 1 - 1
src/YSAI.Controls/colorpicker/GridLengthUtil.cs

@@ -3,7 +3,7 @@ using System.ComponentModel;
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     internal class GridLengthTool
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/MultiComboBox.cs

@@ -5,7 +5,7 @@ using System.Windows.Controls;
 using System.Windows.Data;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     public class MultiComboBox : System.Windows.Controls.Primitives.MultiSelector
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/MultiComboBoxItem.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     public class MultiComboBoxItem : ListBoxItem
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/NotTopMostPopup.cs

@@ -5,7 +5,7 @@ using System.Windows.Controls.Primitives;
 using System.Windows.Input;
 using System.Windows.Interop;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     internal class NotTopMostPopup : Popup
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/SearchTextChangedEventHandler.cs

@@ -1,6 +1,6 @@
 using System.Windows;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     public class SearchTextChangedEventArgs : RoutedEventArgs
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/SelectedBrushChangedEventHandler.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     public class SelectedBrushChangedEventArgs : RoutedEventArgs
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/SliderHelper.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     public class SliderHelper
     {

+ 1 - 1
src/YSAI.Controls/colorpicker/TextBoxHelper.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.colorpicker
+namespace YSAI.Core.Wpf.controls.colorpicker
 {
     public class TextBoxHelper
     {

+ 3 - 3
src/YSAI.Controls/dashboard/DashBoardControl.xaml

@@ -1,10 +1,10 @@
-<UserControl x:Class="YSAI.Controls.dashboard.DashBoardControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.dashboard.DashBoardControl"
              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:cs="clr-namespace:YSAI.Converters;assembly=YSAI.Converters"
-             xmlns:local="clr-namespace:YSAI.Controls.dashboard"
+             xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters"
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.dashboard"
              mc:Ignorable="d">
     <UserControl.Resources>
         <cs:ImageOffsetConverter x:Key="imageOffsetConverter" />

+ 1 - 1
src/YSAI.Controls/dashboard/DashBoardControl.xaml.cs

@@ -5,7 +5,7 @@ using System.Windows.Media;
 using System.Windows.Media.Animation;
 using System.Windows.Shapes;
 
-namespace YSAI.Controls.dashboard
+namespace YSAI.Core.Wpf.controls.dashboard
 {
     [TemplatePart(Name = "LayoutRoot", Type = typeof(Grid))]
     [TemplatePart(Name = "Pointer", Type = typeof(Path))]

+ 2 - 2
src/YSAI.Controls/gifimage/GifImageControl.xaml

@@ -1,9 +1,9 @@
-<Control x:Class="YSAI.Controls.gifimage.GifImageControl"
+<Control x:Class="YSAI.Core.Wpf.controls.gifimage.GifImageControl"
              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:YSAI.Controls.gifimage">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.gifimage">
     <Control.Resources>
         <Style TargetType="local:GifImageControl">
             <Setter Property="Template">

+ 1 - 1
src/YSAI.Controls/gifimage/GifImageControl.xaml.cs

@@ -14,7 +14,7 @@ using System.Windows.Media.Imaging;
 using System.Windows.Threading;
 using Image = System.Windows.Controls.Image;
 
-namespace YSAI.Controls.gifimage
+namespace YSAI.Core.Wpf.controls.gifimage
 {
     /// <summary>
     /// GifImageControl.xaml 的交互逻辑

src/YSAI.Controls/hamburgermenu/ButtonStyle.xaml → src/YSAI.Core.Wpf/controls/hamburgermenu/ButtonStyle.xaml


+ 5 - 5
src/YSAI.Controls/hamburgermenu/HamburgerMenu.xaml

@@ -1,10 +1,10 @@
-<ContentControl x:Class="YSAI.Controls.hamburgermenu.HamburgerMenu"
+<ContentControl x:Class="YSAI.Core.Wpf.controls.hamburgermenu.HamburgerMenu"
              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:sys="clr-namespace:System;assembly=mscorlib"
-             xmlns:local="clr-namespace:YSAI.Controls.hamburgermenu">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.hamburgermenu">
     <ContentControl.Resources>
         <Style TargetType="local:HamburgerMenu">
             <Setter Property="Width" Value="50" />
@@ -16,9 +16,9 @@
                         <ControlTemplate.Resources>
                             <ResourceDictionary>
                                 <ResourceDictionary.MergedDictionaries>
-                                    <ResourceDictionary Source="/YSAI.Controls;component/hamburgermenu/ListBoxStyle.xaml" />
-                                    <ResourceDictionary Source="/YSAI.Controls;component/hamburgermenu/ToggleButtonStyle.xaml" />
-                                    <ResourceDictionary Source="pack://application:,,,/YSAI.Resources;component/style/Style_ScrollViewer.xaml" />
+                                    <ResourceDictionary Source="/YSAI.Core.Wpf;component/controls/hamburgermenu/ListBoxStyle.xaml" />
+                                    <ResourceDictionary Source="/YSAI.Core.Wpf;component/controls/hamburgermenu/ToggleButtonStyle.xaml" />
+                                    <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ScrollViewer.xaml" />
                                 </ResourceDictionary.MergedDictionaries>
                                 <Style TargetType="local:HamburgerMenuItem">
                                     <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:HamburgerMenu}}, Path=MenuItemForeground}" />

+ 1 - 1
src/YSAI.Controls/hamburgermenu/HamburgerMenu.xaml.cs

@@ -3,7 +3,7 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.hamburgermenu
+namespace YSAI.Core.Wpf.controls.hamburgermenu
 {
     public partial class HamburgerMenu : ContentControl
     {

+ 3 - 3
src/YSAI.Controls/hamburgermenu/HamburgerMenuItem.xaml

@@ -1,15 +1,15 @@
-<ListBoxItem x:Class="YSAI.Controls.hamburgermenu.HamburgerMenuItem"
+<ListBoxItem x:Class="YSAI.Core.Wpf.controls.hamburgermenu.HamburgerMenuItem"
              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:YSAI.Controls.hamburgermenu">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.hamburgermenu">
     <ListBoxItem.Resources>
         <Style TargetType="local:HamburgerMenuItem">
             <Style.Resources>
                 <ResourceDictionary>
                     <ResourceDictionary.MergedDictionaries>
-                        <ResourceDictionary Source="/YSAI.Controls;component/hamburgermenu/ButtonStyle.xaml" />
+                        <ResourceDictionary Source="/YSAI.Core.Wpf;component/controls/hamburgermenu/ButtonStyle.xaml" />
                     </ResourceDictionary.MergedDictionaries>
                 </ResourceDictionary>
             </Style.Resources>

+ 1 - 1
src/YSAI.Controls/hamburgermenu/HamburgerMenuItem.xaml.cs

@@ -4,7 +4,7 @@ using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
 
-namespace YSAI.Controls.hamburgermenu
+namespace YSAI.Core.Wpf.controls.hamburgermenu
 {
     /// <summary>
     /// HamburgerMenuItem.xaml 的交互逻辑

src/YSAI.Controls/hamburgermenu/ListBoxStyle.xaml → src/YSAI.Core.Wpf/controls/hamburgermenu/ListBoxStyle.xaml


src/YSAI.Controls/hamburgermenu/ToggleButtonStyle.xaml → src/YSAI.Core.Wpf/controls/hamburgermenu/ToggleButtonStyle.xaml


src/YSAI.Controls/keyboard/Image/Backspace.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Backspace.png


src/YSAI.Controls/keyboard/Image/Button1.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Button1.png


src/YSAI.Controls/keyboard/Image/Button2.5.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Button2.5.png


src/YSAI.Controls/keyboard/Image/Button2.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Button2.png


src/YSAI.Controls/keyboard/Image/Button5.5.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Button5.5.png


src/YSAI.Controls/keyboard/Image/Enter1.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Enter1.png


src/YSAI.Controls/keyboard/Image/Enter2.5.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Enter2.5.png


src/YSAI.Controls/keyboard/Image/Enter2.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Enter2.png


src/YSAI.Controls/keyboard/Image/Enter5.5.png → src/YSAI.Core.Wpf/controls/keyboard/Image/Enter5.5.png


+ 1 - 1
src/YSAI.Controls/keyboard/KeyBoardButtonControl.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.keyboard
+namespace YSAI.Core.Wpf.controls.keyboard
 {
     public class KeyBoardButtonControl : Button
     {

+ 1 - 1
src/YSAI.Controls/keyboard/KeyBoardButtonControl.xaml

@@ -1,6 +1,6 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:local="clr-namespace:YSAI.Controls.keyboard">
+                    xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.keyboard">
     <Style x:Key="DefaultFuctionButtonControl" TargetType="{x:Type local:KeyBoardButtonControl}">
         <Setter Property="Height" Value="150" />
         <Setter Property="Width" Value="400" />

+ 12 - 12
src/YSAI.Controls/keyboard/KeyBoardControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.keyboard.KeyBoardControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.keyboard.KeyBoardControl"
              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:YSAI.Controls.keyboard" x:Name="control" Focusable="False">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.keyboard" x:Name="control" Focusable="False">
     <UserControl.Resources>
         <ResourceDictionary>
 
@@ -34,7 +34,7 @@
                     <Trigger Property="IsChecked" Value="true">
                         <Setter Property="Background" TargetName="border">
                             <Setter.Value>
-                                <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Enter2.5.png" />
+                                <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Enter2.5.png" />
                             </Setter.Value>
                         </Setter>
 
@@ -59,12 +59,12 @@
                 <Setter Property="Focusable" Value="False" />
                 <Setter Property="PressedBackground">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Enter1.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Enter1.png" />
                     </Setter.Value>
                 </Setter>
                 <Setter Property="Background">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Button1.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Button1.png" />
                     </Setter.Value>
                 </Setter>
             </Style>
@@ -73,12 +73,12 @@
                 <Setter Property="Width" Value="210" />
                 <Setter Property="PressedBackground">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Enter2.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Enter2.png" />
                     </Setter.Value>
                 </Setter>
                 <Setter Property="Background">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Button2.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Button2.png" />
                     </Setter.Value>
                 </Setter>
             </Style>
@@ -87,12 +87,12 @@
                 <Setter Property="Width" Value="270" />
                 <Setter Property="PressedBackground">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Enter2.5.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Enter2.5.png" />
                     </Setter.Value>
                 </Setter>
                 <Setter Property="Background">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Button2.5.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Button2.5.png" />
                     </Setter.Value>
                 </Setter>
             </Style>
@@ -101,12 +101,12 @@
                 <Setter Property="Width" Value="1100" />
                 <Setter Property="PressedBackground">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Enter5.5.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Enter5.5.png" />
                     </Setter.Value>
                 </Setter>
                 <Setter Property="Background">
                     <Setter.Value>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Button5.5.png" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Button5.5.png" />
                     </Setter.Value>
                 </Setter>
             </Style>
@@ -177,7 +177,7 @@
 
                 <local:KeyBoardButtonControl Style="{StaticResource Resource.Style.FuncButton.Lenght.2}" Grid.Row="1" Grid.Column="14" Content="      " HorizontalAlignment="Right" Tag="8" IsHitTestVisible="False">
                     <Button.Background>
-                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Controls;component/keyboard/Image/Backspace.png" Stretch="None" />
+                        <ImageBrush ImageSource="pack://application:,,,/YSAI.Core.Wpf.controls;component/keyboard/Image/Backspace.png" Stretch="None" />
                     </Button.Background>
                 </local:KeyBoardButtonControl>
             </Grid>

+ 1 - 1
src/YSAI.Controls/keyboard/KeyBoardControl.xaml.cs

@@ -6,7 +6,7 @@ using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
 
-namespace YSAI.Controls.keyboard
+namespace YSAI.Core.Wpf.controls.keyboard
 {
     /// <summary>
     /// KeyBoardControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/keyboard/KeyBoardControlWindow.xaml

@@ -1,9 +1,9 @@
-<Window x:Class="YSAI.Controls.keyboard.KeyBoardControlWindow"
+<Window x:Class="YSAI.Core.Wpf.controls.keyboard.KeyBoardControlWindow"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         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:YSAI.Controls.keyboard" WindowStyle="None" Background="Transparent"
+        xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.keyboard" WindowStyle="None" Background="Transparent"
         AllowsTransparency="True" MouseDown="Window_MouseDown" Topmost="True">
     <Window.Resources>
         <!--消息弹窗加载 由下到上 +震动-->

+ 1 - 1
src/YSAI.Controls/keyboard/KeyBoardControlWindow.xaml.cs

@@ -4,7 +4,7 @@ using System.Windows;
 using System.Windows.Input;
 using System.Windows.Interop;
 
-namespace YSAI.Controls.keyboard
+namespace YSAI.Core.Wpf.controls.keyboard
 {
     /// <summary>
     /// KeyBoardControlWindow.xaml 的交互逻辑

+ 1 - 1
src/YSAI.Controls/keyboard/KeyHelper.cs

@@ -3,7 +3,7 @@ using System.Diagnostics;
 using System.Linq;
 using System.Runtime.InteropServices;
 
-namespace YSAI.Controls.keyboard
+namespace YSAI.Core.Wpf.controls.keyboard
 {
     public static partial class KeyHelper
     {

+ 2 - 2
src/YSAI.Controls/ledgauge/ColorModel.cs

@@ -1,9 +1,9 @@
 using System;
 using System.Diagnostics;
 using System.Drawing;
-using YSAI.Mvvm;
+using YSAI.Core.Wpf.mvvm;
 
-namespace YSAI.Controls.ledgauge
+namespace YSAI.Core.Wpf.controls.ledgauge
 {
     public class ColorModel : NotifyObject
     {

+ 1 - 1
src/YSAI.Controls/ledgauge/GenericOperator.cs

@@ -2,7 +2,7 @@ using System;
 using System.Diagnostics;
 using System.Linq.Expressions;
 
-namespace YSAI.Controls.ledgauge
+namespace YSAI.Core.Wpf.controls.ledgauge
 {
     public static class GenericOperator<T, U, V>
     {

+ 2 - 2
src/YSAI.Controls/ledgauge/LedGaugeControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.ledgauge.LedGaugeControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.ledgauge.LedGaugeControl"
              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:YSAI.Controls.ledgauge"
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.ledgauge"
              Focusable="False"
              Name="root">
     <Viewbox>

+ 4 - 6
src/YSAI.Controls/ledgauge/LedGaugeControl.xaml.cs

@@ -1,13 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
+using System.ComponentModel;
 using System.Timers;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Threading;
 
-namespace YSAI.Controls.ledgauge
+namespace YSAI.Core.Wpf.controls.ledgauge
 {
     /// <summary>
     /// LedGaugeControl.xaml 的交互逻辑
@@ -16,7 +14,7 @@ namespace YSAI.Controls.ledgauge
     {
         private bool isFlashingStateOn;
 
-        private Timer flashTimer;
+        private System.Timers.Timer flashTimer;
 
         private RadialGradientBrush lampBrush;
 
@@ -255,7 +253,7 @@ namespace YSAI.Controls.ledgauge
 
         private void LedGauge_Loaded(object sender, RoutedEventArgs e)
         {
-            flashTimer = new Timer(FlashingInterval);
+            flashTimer = new System.Timers.Timer(FlashingInterval);
             flashTimer.Elapsed += OnTimerTick;
             if (base.IsVisible && base.IsEnabled && IsFlashing)
             {

+ 1 - 1
src/YSAI.Controls/ledgauge/Range.cs

@@ -2,7 +2,7 @@ using Newtonsoft.Json;
 using System;
 using System.Diagnostics;
 
-namespace YSAI.Controls.ledgauge
+namespace YSAI.Core.Wpf.controls.ledgauge
 {
     [JsonObject(MemberSerialization.OptIn)]
     [DebuggerDisplay("Range Min = {Min}, Max = {Max},  Width = {Width}, Center = {Center}")]

+ 2 - 2
src/YSAI.Controls/loadinganimation/BallLoadingControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.loadinganimation.BallLoadingControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.BallLoadingControl"
              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:YSAI.Controls.loadinganimation">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation">
     <UserControl.Resources>
         <Style TargetType="{x:Type local:BallLoadingControl}">
             <Setter Property="Template">

+ 1 - 1
src/YSAI.Controls/loadinganimation/BallLoadingControl.xaml.cs

@@ -6,7 +6,7 @@ using System.Windows.Media;
 using System.Windows.Media.Animation;
 using System.Windows.Shapes;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// BallLoadingControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/loadinganimation/CycleLoadingControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.loadinganimation.CycleLoadingControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.CycleLoadingControl"
              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:YSAI.Controls.loadinganimation"
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation"
              mc:Ignorable="d">
     <UserControl.Resources>
         <Style TargetType="{x:Type local:CycleLoadingControl}">

+ 1 - 1
src/YSAI.Controls/loadinganimation/CycleLoadingControl.xaml.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// CycleLoadingControl.xaml 的交互逻辑

+ 3 - 3
src/YSAI.Controls/loadinganimation/LoadingControl.xaml

@@ -1,10 +1,10 @@
-<UserControl x:Class="YSAI.Controls.loadinganimation.LoadingControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.LoadingControl"
              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:YSAI.Controls.loadinganimation"
-             xmlns:cs="clr-namespace:YSAI.Converters;assembly=YSAI.Converters">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation"
+             xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters">
     <UserControl.Resources>
         <cs:LoadingBackgroundThicknessConverter x:Key="LoadingBackgroundThicknessConverter" />
         <cs:LoadingLineYConverter x:Key="LoadingLineYConverter" />

+ 1 - 1
src/YSAI.Controls/loadinganimation/LoadingControl.xaml.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// LoadingControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/loadinganimation/LoadingXControl.xaml

@@ -1,9 +1,9 @@
-<ContentControl x:Class="YSAI.Controls.loadinganimation.LoadingXControl"
+<ContentControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.LoadingXControl"
              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:YSAI.Controls.loadinganimation">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation">
     <ContentControl.Resources>
         <!--  主色  -->
         <Color x:Key="LightGreenEffect">#33ABA0</Color>

+ 1 - 1
src/YSAI.Controls/loadinganimation/LoadingXControl.xaml.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// LoadingXControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/loadinganimation/RingLoadingControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.loadinganimation.RingLoadingControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.RingLoadingControl"
              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:YSAI.Controls.loadinganimation">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation">
     <UserControl.Resources>
         <Style TargetType="local:RingLoadingControl">
             <Setter Property="Template">

+ 1 - 1
src/YSAI.Controls/loadinganimation/RingLoadingControl.xaml.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// RingLoadingControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/loadinganimation/RollLoadingControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.loadinganimation.RollLoadingControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.RollLoadingControl"
              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:YSAI.Controls.loadinganimation">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation">
     <UserControl.Resources>
         <PowerEase x:Key="PowerEaseInOut" EasingMode="EaseInOut" />
         <Style TargetType="{x:Type local:RollLoadingControl}">

+ 1 - 1
src/YSAI.Controls/loadinganimation/RollLoadingControl.xaml.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// RollLoadingControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/loadinganimation/WaitLoadingControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.loadinganimation.WaitLoadingControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.loadinganimation.WaitLoadingControl"
              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:YSAI.Controls.loadinganimation">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.loadinganimation">
     <UserControl.Resources>
         <PowerEase x:Key="PowerEaseInOut" EasingMode="EaseInOut" />
         <Style TargetType="{x:Type local:WaitLoadingControl}">

+ 1 - 1
src/YSAI.Controls/loadinganimation/WaitLoadingControl.xaml.cs

@@ -1,7 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 
-namespace YSAI.Controls.loadinganimation
+namespace YSAI.Core.Wpf.controls.loadinganimation
 {
     /// <summary>
     /// WaitLoadingControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/map/MapControl.xaml

@@ -1,9 +1,9 @@
-<UserControl x:Class="YSAI.Controls.map.MapControl"
+<UserControl x:Class="YSAI.Core.Wpf.controls.map.MapControl"
              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:YSAI.Controls.map">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.map">
     <Grid>
         <Grid>
             <Grid.Resources>

+ 1 - 1
src/YSAI.Controls/map/MapControl.xaml.cs

@@ -1,6 +1,6 @@
 using System.Windows.Controls;
 
-namespace YSAI.Controls.map
+namespace YSAI.Core.Wpf.controls.map
 {
     /// <summary>
     /// MapControl.xaml 的交互逻辑

+ 3 - 3
src/YSAI.Controls/pagebar/PageBarControl.xaml

@@ -1,10 +1,10 @@
-<ItemsControl x:Class="YSAI.Controls.pagebar.PageBarControl"
+<ItemsControl x:Class="YSAI.Core.Wpf.controls.pagebar.PageBarControl"
              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:pb="clr-namespace:YSAI.Controls.pagebar"
-             xmlns:local="clr-namespace:YSAI.Controls.pagebar"
+             xmlns:pb="clr-namespace:YSAI.Core.Wpf.controls.pagebar"
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.pagebar"
              xmlns:system="clr-namespace:System;assembly=mscorlib">
     <ItemsControl.Resources>
         <SolidColorBrush x:Key="Primary" Color="#2196F3" />

+ 2 - 2
src/YSAI.Controls/pagebar/PageBarControl.xaml.cs

@@ -2,9 +2,9 @@
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
-using YSAI.Mvvm;
+using YSAI.Core.Wpf.mvvm;
 
-namespace YSAI.Controls.pagebar
+namespace YSAI.Core.Wpf.controls.pagebar
 {
     /// <summary>
     /// 页码条

+ 1 - 1
src/YSAI.Controls/pagebar/PageBarItem.cs

@@ -6,7 +6,7 @@ using System.Windows.Data;
 using System.Windows.Input;
 using System.Windows.Media;
 
-namespace YSAI.Controls.pagebar
+namespace YSAI.Core.Wpf.controls.pagebar
 {
     /// <summary>
     /// 页码条子项

+ 2 - 2
src/YSAI.Controls/radiobutton/RadioButtonControl.xaml

@@ -1,9 +1,9 @@
-<RadioButton x:Class="YSAI.Controls.radiobutton.RadioButtonControl"
+<RadioButton x:Class="YSAI.Core.Wpf.controls.radiobutton.RadioButtonControl"
              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:YSAI.Controls.radiobutton">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.radiobutton">
     <RadioButton.Resources>
         <Style TargetType="{x:Type local:RadioButtonControl}">
             <Setter Property="Height" Value="30" />

+ 1 - 1
src/YSAI.Controls/radiobutton/RadioButtonControl.xaml.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.radiobutton
+namespace YSAI.Core.Wpf.controls.radiobutton
 {
     /// <summary>
     /// RadioButtonControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/textbox/TextboxControl.xaml

@@ -1,9 +1,9 @@
-<TextBox x:Class="YSAI.Controls.textbox.TextBoxControl"
+<TextBox x:Class="YSAI.Core.Wpf.controls.textbox.TextBoxControl"
              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:YSAI.Controls.textbox">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.textbox">
     <TextBox.Resources>
         <Style TargetType="{x:Type local:TextBoxControl}">
             <Setter Property="Height" Value="30" />

+ 1 - 1
src/YSAI.Controls/textbox/TextboxControl.xaml.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Media;
 
-namespace YSAI.Controls.textbox
+namespace YSAI.Core.Wpf.controls.textbox
 {
     /// <summary>
     /// TextboxControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/tip/TipControl.xaml

@@ -1,9 +1,9 @@
-<ContentControl x:Class="YSAI.Controls.tip.TipControl"
+<ContentControl x:Class="YSAI.Core.Wpf.controls.tip.TipControl"
              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:YSAI.Controls.tip">
+             xmlns:local="clr-namespace:YSAI.Core.Wpf.controls.tip">
     <ContentControl.Resources>
         <local:ToolTipOffsetConverter x:Key="ToolTipOffsetConverter" />
         <Style TargetType="local:TipControl">

+ 1 - 1
src/YSAI.Controls/tip/TipControl.xaml.cs

@@ -6,7 +6,7 @@ using System.Windows.Controls;
 using System.Windows.Data;
 using System.Windows.Media;
 
-namespace YSAI.Controls.tip
+namespace YSAI.Core.Wpf.controls.tip
 {
     /// <summary>
     /// TipControl.xaml 的交互逻辑

+ 2 - 2
src/YSAI.Controls/transition/TransitionControl.xaml

@@ -1,9 +1,9 @@
-<ContentControl x:Class="YSAI.Controls.transition.TransitionControl"
+<ContentControl x:Class="YSAI.Core.Wpf.controls.transition.TransitionControl"
              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:t="clr-namespace:YSAI.Controls.transition">
+             xmlns:t="clr-namespace:YSAI.Core.Wpf.controls.transition">
     <ContentControl.Resources>
         <Style TargetType="t:TransitionControl">
             <Setter Property="ClipToBounds" Value="True" />

+ 1 - 1
src/YSAI.Controls/transition/TransitionControl.xaml.cs

@@ -4,7 +4,7 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media.Animation;
 
-namespace YSAI.Controls.transition
+namespace YSAI.Core.Wpf.controls.transition
 {
     /// <summary>
     /// TransitionControl.xaml 的交互逻辑

+ 1 - 1
src/YSAI.Converters/BackgroundColorConverter.cs

@@ -3,7 +3,7 @@ using System.Globalization;
 using System.Windows.Data;
 using System.Windows.Media;
 
-namespace YSAI.Converters
+namespace YSAI.Core.Wpf.converters
 {
     /// <summary>
     /// 将背景颜色转换为渐变效果

+ 1 - 1
src/YSAI.Converters/BrushToColorConverter.cs

@@ -4,7 +4,7 @@ using System.Windows;
 using System.Windows.Data;
 using System.Windows.Media;
 
-namespace YSAI.Converters
+namespace YSAI.Core.Wpf.converters
 {
     public class BrushToColorConverter : IValueConverter
     {

+ 1 - 1
src/YSAI.Converters/CheckConverter.cs

@@ -2,7 +2,7 @@
 using System.Globalization;
 using System.Windows.Data;
 
-namespace YSAI.Converters
+namespace YSAI.Core.Wpf.converters
 {
     /// <summary>
     /// 单选按钮转换器

+ 1 - 1
src/YSAI.Converters/ColorToSolidColorBrushConverter.cs

@@ -3,7 +3,7 @@ using System.Globalization;
 using System.Windows.Data;
 using System.Windows.Media;
 
-namespace YSAI.Converters
+namespace YSAI.Core.Wpf.converters
 {
     /// <summary>
     /// 将给定的颜色转换为SolidColorBrush

+ 1 - 1
src/YSAI.Converters/GlassEffectWidthConverter.cs

@@ -2,7 +2,7 @@
 using System.Globalization;
 using System.Windows.Data;
 
-namespace YSAI.Converters
+namespace YSAI.Core.Wpf.converters
 {
     /// <summary>
     /// 绘制玻璃效果的转换器

+ 0 - 0
src/YSAI.Converters/HalfConverter.cs


Некоторые файлы не были показаны из-за большого количества измененных файлов