Ay.Framework.WPF 进度一览[2015-06-05更新 - AyColorPickerDialog和AySlider完成] ( 官方群号 3...

2016-02-14 10:31:42来源:作者:AaronYang技术分享人点击

(QQ群337468846)

待完成

AySlider ,日期, 颜色选择 ,视频背景,三角PopUp

AyCheckbox,List,自动升级组件

AyRadioBox,List

AyDataGrid

AyComboTree

AyComboGrid

AyRemoteImage

AyFileUpload

多行文本框

待解决问题,processbar 运动不均匀

换色,换控件的实现,右上角换成path

以下控件已经完成

2015-6-5 16:01:17

像素化 Path高清带边框,实现多彩

2015-6-3 18:37:27

AyColorPicker和AyColorPickerDialog

支持透明色, 尚未增加推荐色位属性

2015-6-2 15:42:54

AySlider, 建议 横向模式,不设置height, 纵向模式不设置 Width

属性 默认值 使用说明 Icon(string类型,来自AyIconAll的Icon,支持path,ico,png,jpg,gif,fontawesome写法) path_Ellipse 详情见AyIconAll用法 ThumbStroke (Brush类型) 跟着主题走,可修改,FF84BDDA,资源Key =HoverButtonBorderColor 调整AyIconAll的Stroke ThumbFill (Brush类型) White 调整AyIconAll的Foreground ThumbStrokeThickness(double类型) 1.0 调整AyIconAll的StrokeThickness ThumbWidth 调整AyIconAll的Width ThumbHeight 22.00 调整AyIconAll的Height ToolTipOpacity 调整 值提示框的透明度,调整为0 则提示不显示 ToolTipRadius 5.0 值提示框圆角 ThumbShadowStroke Black Thumb的阴影色,无法设置,自动根据ThumbStroke计算的 IconFontSize 调整AyIconAll的FontSize CompletedFill 跟着主题走,可修改,FF7Eb4EA 资源Key=Ay.SliderThumb.Track.Selected.Background UnCompletedFill 跟着主题走,可修改,B7B7B7资源Key=Ay.SliderThumb.Track.Static.Background HighlightFill 跟着主题走,可修改,FF226584资源Key=Ay.SliderThumb.PART_SelectionRange.Fill 高亮范围颜色设置,Slider默认设置,例如SelectionStart="10" SelectionEnd="40" HighlightFill="YellowGreen" Minimum="0" Maximum="100" Value="50" 其中IsSnapToTickEnabled="True"可设置为整数移动 TrackWidth 纵向Slider时候,就是轨道的宽度,横向时候就是Slider的轨道的高度

效果图预览:

代码:

<control:AyWindow x:Class="WpfApplication11.Window5"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:control="clr-namespace:Ay.Framework.WPF.Controls;assembly=Ay.Framework.WPF" xmlns:Behaviors="clr-namespace:Ay.Framework.WPF.Behaviors;assembly=Ay.Framework.WPF" Title="Ay的Slider控件" Height="400" Width="600" WindowStartupLocation="CenterScreen"><Grid x:Name="LayoutRoot"><Border Background="#CCFFFFFF" Padding="5" ><Canvas><control:AySlider HorizontalAlignment="Left" IsSnapToTickEnabled="True" SmallChange="1" VerticalAlignment="Top" Height="30" Width="201" Minimum="0" Maximum="100" Value="50" Icon="path_TickTop" ThumbHeight="25" ThumbWidth="12" Canvas.Left="28" Canvas.Top="10"/><control:AySlider HorizontalAlignment="Left" IsSnapToTickEnabled="True" VerticalAlignment="Top" Height="218" Orientation="Vertical" Minimum="0" Maximum="100" Value="50" IsSelectionRangeEnabled="True" Canvas.Left="28" Canvas.Top="60"/><control:AySlider HorizontalAlignment="Left" IsSnapToTickEnabled="True" VerticalAlignment="Top" Height="218" Orientation="Vertical"Minimum="0" Maximum="100" Value="50" IsSelectionRangeEnabled="True" Canvas.Left="85" Canvas.Top="60" Icon="pack://application:,,,/Ay.Framework.WPF;component/Resources/ay.gif"/><control:AySlider x:Name="as1" HorizontalAlignment="Left" IsSnapToTickEnabled="True" VerticalAlignment="Top" Height="218" Orientation="Vertical"Minimum="0" Maximum="100" Value="50" IsSelectionRangeEnabled="True" Canvas.Left="152" Canvas.Top="60" Icon="fa_book" IconFontSize="40" ThumbHeight="40" ThumbWidth="40"/><control:AySlider x:Name="as2" HorizontalAlignment="Left" IsSnapToTickEnabled="True" VerticalAlignment="Top" Height="218" Orientation="Vertical" TrackWidth="20" CompletedFill="#EF1A6A" UnCompletedFill="#FFD7E6" ThumbStroke="#72B504" ThumbFill="#C9FBC2"Minimum="0" Maximum="100" Value="50" IsSelectionRangeEnabled="True" Canvas.Left="216" Canvas.Top="60" Icon="fa_book" IconFontSize="40" ThumbHeight="40" ThumbWidth="50"/><control:AyComboBox VerticalAlignment="Center" Width="120" PanelMaxHeight="200" x:Name="cboFontAweEnum" SelectionChanged="cboFontAweEnum_SelectionChanged" Canvas.Left="109" Canvas.Top="295"/><control:AySlider HorizontalAlignment="Left" ToolTipRadius="10" IsSnapToTickEnabled="True" SmallChange="1" VerticalAlignment="Top" Width="201" Minimum="0" Maximum="100" Value="50" ThumbStroke="#F23C3C"Icon="/Ay.Framework.WPF;component/resources/demo/sliderdemo.png" CompletedFill="#DE0A0A"ThumbHeight="32" ThumbWidth="32" Canvas.Left="300" Canvas.Top="31"/><control:AySlider HorizontalAlignment="Left" ToolTipOpacity="0.5" IsSnapToTickEnabled="True" SmallChange="1" VerticalAlignment="Top" Width="201" CompletedFill="#ECCF12" ThumbWidth="70" ThumbHeight="80" IconFontSize="40" ThumbStroke="#EF9F69"Minimum="0" Maximum="100" Value="50"Icon="path_ay" Canvas.Left="300" Canvas.Top="91"/><control:AySlider HorizontalAlignment="Left" ToolTipOpacity="1" IsSnapToTickEnabled="True" SmallChange="1" VerticalAlignment="Top" Width="201" ThumbWidth="40" ThumbHeight="40" IconFontSize="40" ThumbStroke="#F78F16" UnCompletedFill="#F4D9A4"Minimum="0" Maximum="100" Value="40" TrackWidth="18" Icon="fa_star"Canvas.Left="300" Canvas.Top="165"><control:AySlider.ThumbFill><RadialGradientBrush><GradientStop Color="#FFFBAC39" Offset="0"/><GradientStop Color="#FFF0BD38" Offset="1"/><GradientStop Color="#FFFB7200" Offset="0.653"/></RadialGradientBrush></control:AySlider.ThumbFill><control:AySlider.CompletedFill><LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"><GradientStop Color="#FFBEF014" Offset="0"/><GradientStop Color="#FFD3F112" Offset="1"/><GradientStop Color="#FF92BB07" Offset="0.516"/></LinearGradientBrush></control:AySlider.CompletedFill></control:AySlider><!--<control:AySlider HorizontalAlignment="Left" Margin="300,0,0,0" IsSnapToTickEnabled="True" VerticalAlignment="Top" Height="218.112" Width="39.042" Orientation="Vertical" SelectionStart="10" SelectionEnd="40" HighlightFill="YellowGreen" Minimum="0" Maximum="100" Value="50" IsSelectionRangeEnabled="True"/>--></Canvas></Border></Grid></control:AyWindow>

2015-06-01 09:00:41

优化AyTreeViewItemModel,使得创建子AyTreeViewItemModel时候无需 children.add了,指定父类自动是父类的子类

例如这样的子类,直接指定AyTreeView的itemssource即可

public ObservableCollection<AyTreeViewItemModel> CreateTreeData(){ObservableCollection<AyTreeViewItemModel> list = new ObservableCollection<AyTreeViewItemModel>();AyTreeViewItemModel root = new AyTreeViewItemModel("热力公司", "fa-bank", null, true);list.Add(root);AyTreeViewItemModel vfen = new AyTreeViewItemModel("V分公司", "fa-building", root, false);AyTreeViewItemModel vfen1 = new AyTreeViewItemModel("V换热站", "fa-home ", vfen, false);AyTreeViewItemModel changfen = new AyTreeViewItemModel("长丰片区", "fa-building", root, true);AyTreeViewItemModel changfen1 = new AyTreeViewItemModel("长丰换热站", "fa-home", changfen, false);AyTreeViewItemModel changfen1_1 = new AyTreeViewItemModel("长丰小区", "fa-binoculars", changfen1, false);AyTreeViewItemModel changfen1_1_1 = new AyTreeViewItemModel("长丰楼", "fa-building-o", changfen1_1, false);AyTreeViewItemModel changfen1_1_1_1 = new AyTreeViewItemModel("长丰单元", "fa-keyboard-o", changfen1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_1 = new AyTreeViewItemModel("106111", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_2 = new AyTreeViewItemModel("A11", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_3 = new AyTreeViewItemModel("108111", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_4 = new AyTreeViewItemModel("108112", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_5 = new AyTreeViewItemModel("10822", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_6 = new AyTreeViewItemModel("109111", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_7 = new AyTreeViewItemModel("10922", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_8 = new AyTreeViewItemModel("110111", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_9 = new AyTreeViewItemModel("14122", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_10 = new AyTreeViewItemModel("901", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_11 = new AyTreeViewItemModel("902", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_12 = new AyTreeViewItemModel("333", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_13 = new AyTreeViewItemModel("A15", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_14 = new AyTreeViewItemModel("A19", "fa-cc-discover", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_15 = new AyTreeViewItemModel("AA1", "fa-building", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_16 = new AyTreeViewItemModel("242", "fa-building", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_17 = new AyTreeViewItemModel("31101", "fa-building", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_18 = new AyTreeViewItemModel("A18", "fa-building", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_19 = new AyTreeViewItemModel("A16", "fa-building", changfen1_1_1_1, false);AyTreeViewItemModel changfen1_1_1_1_20 = new AyTreeViewItemModel("A17", "fa-building", changfen1_1_1_1, false);AyTreeViewItemModel daqin = new AyTreeViewItemModel("大庆路片区", "fa-building", root, false);AyTreeViewItemModel daqin1 = new AyTreeViewItemModel("宏文路123号院站", "fa-home ", daqin, false);AyTreeViewItemModel daqin2 = new AyTreeViewItemModel("金台区纺西村站", "fa-home ", daqin, false);AyTreeViewItemModel daqin3 = new AyTreeViewItemModel("十二厂复兴村站", "fa-home ", daqin, false);AyTreeViewItemModel daqin4 = new AyTreeViewItemModel("十二厂西兴村站", "fa-home ", daqin, false);AyTreeViewItemModel daqin5 = new AyTreeViewItemModel("制氧家属院站", "fa-home ", daqin, false);AyTreeViewItemModel daqin6 = new AyTreeViewItemModel("中粮国际站", "fa-home ", daqin, false);AyTreeViewItemModel feidong = new AyTreeViewItemModel("肥东片区", "fa-building", root, false);AyTreeViewItemModel gendan = new AyTreeViewItemModel("大庆路片区", "fa-building", root, false);AyTreeViewItemModel gaoxing = new AyTreeViewItemModel("高新片区", "fa-building", root, false);AyTreeViewItemModel jiangtanlu = new AyTreeViewItemModel("姜谭路片区", "fa-building", root, false);AyTreeViewItemModel jinling = new AyTreeViewItemModel("金陵片区", "fa-building", root, false);AyTreeViewItemModel qiaobei = new AyTreeViewItemModel("桥北分公司", "fa-building", root, false);AyTreeViewItemModel qiaonan = new AyTreeViewItemModel("桥南片区", "fa-building", root, false);AyTreeViewItemModel zhenwu = new AyTreeViewItemModel("政务片区", "fa-building", root, false);return list;}

第4个参数,指是否展开节点,已经动画模式都支持默认展开了(v2.9.1版本)

2015-5-29 16:57:09

增加Uc_HKControl 控制面板控件

优化DragInCanvasBehavior行为,让其不会拖出Canvas的范围,可以配置左键拖动,还是右键

使用DEMO

<Canvas ClipToBounds="True"> <control:Uc_HKControl x:Name="uchkTest" Width="75" Height="75" Canvas.Top="10" Canvas.Right="10" > <i:Interaction.Behaviors> <Behaviors:DragInCanvasBehavior/> </i:Interaction.Behaviors> </control:Uc_HKControl> </Canvas> xmlns:control="clr-namespace:Ay.Framework.WPF.Controls;assembly=Ay.Framework.WPF" xmlns:Behaviors="clr-namespace:Ay.Framework.WPF.Behaviors;assembly=Ay.Framework.WPF"

2015-05-28 19:30:32

新的控件架构方式,自己独创的,新的接口提供,第一个 无损 自定义形状的控件模式应用

下面的是我改版的 RepeatButton,如果上面的内容你使用 pathlistbox,将会导致RepeatButton在pathlistbox的item的时候失去焦点,导致mouseover效果不对,怎么解决,不过已经解决了,而且无损 放大指定形状的 指定类型的控件.

AyIconAll 设置了path模式和fontawesome的颜色为双向绑定。

2015-5-27 16:58:53

新增AyPath控件,用于优化AyIconAll,path模式的显示性能,此时更简单和轻松了

<control:AyPath control:PathKey.Key="path_add" Width="36" Height="36" Padding="0" Foreground="#000000" SnapsToDevicePixels="True"></control:AyPath>

2015-5-27 14:44:58

海康威视WPF版本 实时监控控件

2015-05-25 17:10:16

AyTreeView高级效果演示

三角形的旋转,鼠标移入三角的显示,鼠标选中 图标 反色,鼠标移入移出 拖影,选中效果,三角形范围更大,点击更准确

整行响应更准确,自动算 层级,自动距离左边.

超级难点: mvvm中的 对象 转 TreeViewItem,才能 添加动画的支持. 这个最难,如果突破不了,什么都不可能,它才不像listbox那样就可以拿到item

节点的展开和收起的动画的添加, 超级难,不用 eventsetter,因为这使得事件在控件使用者地方了,肯定不行.

鼠标移入移出,选中,展开,收起,图标反色也是最小的难度.

展开时候,因为要计算 展开的高度,收起也要,而且你要对动画非常的了解,才能灵活应用,比如问题:动画执行完,属性无法更改,因为被锁定了,怎样解锁等

流畅度和内存控制,我已经很优化了,执行完就释放内存.

AyTreeView动画开关控制属性 -- TreeViewAnimationIsOpen

增加TreeViewItemHeight高度,可以绑定调节

2015-5-25 13:59:56

AyIconAll 的 fontawesome支持 fa- 或者 fa_ ,自动处理空白字符,例如首尾空白.

2015-05-23 10:34:04

新版AyPropertyChanged类,支持linq的属性通知,支持其他类属性通知,支持多属性通知

增加ExecuteCommandAction,使用例如以下demo,暂时没什么用,可用CommandBehavior替代

<StackPanel> <TextBlock Text="{Binding Student.StudentName, ElementName=uc}"> <i:Interaction.Triggers> <i:EventTrigger EventName="MouseLeftButtonDown"> <Behaviours:ExecuteCommandAction Command="{Binding Clicked, ElementName=studentsViewModel}" CommandParameter="{Binding Student, ElementName=uc}"/> </i:EventTrigger> </i:Interaction.Triggers> </TextBlock> <TextBlock Text="{Binding Student.Age, ElementName=uc}"> </TextBlock> <TextBlock Visibility="Hidden" Height="0"> <TextBlock.DataContext> <vm:StudentViewModel x:Name="studentsViewModel"></vm:StudentViewModel> </TextBlock.DataContext> </TextBlock> </StackPanel> public class StudentViewModel : AyPropertyChanged { public StudentViewModel() { Clicked = new ActionCommand(this.Click); } public ICommand Clicked { get; private set; } public void Click(object arg) { //为了演示需要,在这里用了一个MessageBox //应尽量避免在VM中揉杂UI交互功能 MessageBox.Show((arg as Student).StudentName); } } public class Student : AyPropertyChanged { string studentName; public string StudentName { get { return studentName; } set { studentName = value; this.OnPropertyChanged(() => this.StudentName); } } int age; public int Age { get { return age; } set { age = value; this.OnPropertyChanged(() => this.Age); } } }

增加CommandBehavior 绑定Event对Command的绑定

2015-5-22 15:11:44

AyWindow增加 是否可以拖动CanDrag (bool型的)

AyIconAll增加Stroke(Brush型)和StrokeThickness(double型) 可以控制字体描边和path的描边

2015-05-18 18:53:39

AySwitch竣工 青春版

支持自定义尺寸,字体大小,两侧内容,两侧内容自动居中,是控件总长度减去滑块长度的剩余部分的水平居中,支持自定义2种状态颜色,缓冲动画,

示例代码,如上面截图

2015-05-05 14:30:23

MenuItem增加 Check,只要设置以下代码

menuItem.IsCheckable = true; menuItem.IsChecked = true;

选中不选中的效果

调整多屏幕显示器的支持DEMO

支持 主屏幕不投影, 显示其他 连接上的显示器, 例如上图, A,B,C,D,E 5个按钮,右键按钮,出现投影选项,可以将窗口最大化的投影到其他显示器,被投影的窗体没有最小化,最大化,皮肤,关闭按钮,一个窗口只能在一个显示器上显示.

窗口aa显示到A显示器,没有关掉,又投影到B显示器,效果是 移动那个窗口对象到B显示器,A没有内容了

打开程序时候,读取上次窗口投影记录,保持上次关闭程序时候投影的状态,关闭主窗口,全部关闭.

窗口aa显示到A显示器,没有关掉,又将bb投影到A显示器,效果是 提醒该显示器已经投影了"XXX"窗口,是否替换,替换了,aa窗口关闭,bb窗口显示在A显示器,注意MenuItem的checked情况,要后台设置原先的aa窗口对应的check要变为false,现在的true.

优化AyMessageBox,调整提示文本的宽度为固定,且最多显示2行.

增加ShowQuestionOkCancel方法,效果如上,示例代码

if (MessageBoxResult.OK == AyMessageBox.ShowQuestionOkCancel(string.Format("屏幕上已经存在/"{0}/"窗口,是否替换?", "热源纵览"), "提醒")) { }

2015-04-30 17:48:57

AySimplyListView 继承Listview,性能比DataGrid好,如果你只是用于作为列表展示又需要表头,可以考虑,例如 日志等,表示很多需求还是需要用DataGrid,回家 封装DataGrid常见的需求DEMO

但是他为 我的 ComboGrid打下了基础.

2015-04-27 17:38:00

完成 Button的 平面模式,ToggleButton的普通和平面模式

添加 AyButton.IsFlatStyle="True" 统一是否开启平面模式

例如 平面的SplitButton,其实 control是 xmlns:control="clr-namespace:Ay.Framework.WPF.Controls;assembly=Ay.Framework.WPF"

<control:AySplitButton x:Name="spFlat2" VerticalAlignment="Center" Width="118" FontSize="13" HorizontalAlignment="Right" Click="SplitButton_Click" Height="25" Margin="0,16,317.5,18"control:AyButton.IsFlatStyle="True"Mode="ComboMenu" Placement="Bottom" ><control:AySplitButton.Content><StackPanel Orientation="Horizontal"><Image Height="16" Margin="0,0,7,0" Source="/Ay.Framework.WPF;component/resources/demo/icondemo3.png" Stretch="uniform" Width="16"/><TextBlock Text="精简开发" /></StackPanel></control:AySplitButton.Content><MenuItem Header="WPF语言"><MenuItem.Icon><Image Height="18" Source="/Ay.Framework.WPF;component/resources/demo/icondemo2.png" Stretch="Uniform" Width="18"/></MenuItem.Icon></MenuItem><MenuItem Header="WPF开发"><MenuItem Header="Web开发"><MenuItem.Icon><Image Height="18" Source="/Ay.Framework.WPF;component/resources/demo/icodemo1.png" Stretch="Uniform" Width="18"/></MenuItem.Icon></MenuItem><MenuItem Header="桌面程序开发"><MenuItem.Icon><Image Height="18" Source="/Ay.Framework.WPF;component/resources/demo/icondemo3.png" Stretch="Uniform" Width="18"/></MenuItem.Icon></MenuItem><MenuItem Header="游戏开发"/><MenuItem Header="Winform开发"><MenuItem.Icon><Image Height="18" Source="/Ay.Framework.WPF;component/resources/demo/icondemo3.png" Stretch="Uniform" Width="18"/></MenuItem.Icon></MenuItem><MenuItem Header="Silverlight"/></MenuItem></control:AySplitButton>

平面的Button

<Button Width="140" Height="28" Click="SplitButton_Click" control:AyButton.IsFlatStyle="True" Margin="15,0,0,0"> <StackPanel Orientation="Horizontal"> <Image Height="20" Source="/Ay.Framework.WPF;component/resources/demo/book.png" Stretch="uniform" Width="20" Margin="0,0,5,0"/> <TextBlock Text="我是很平的Button" VerticalAlignment="Center"/> </StackPanel> </Button>

平面的ToggleButton, 平面模式支持背景色和Border颜色设置,不设置则是默认的主题颜色, 普通模式不支持背景色和边框颜色设置,受框架主题限制

<StackPanel Margin="0,5" Orientation="Horizontal"> <TextBlock Text="toggleButton演示,普通模式和平面模式" Width="250" Height=" 28" FontSize="14" Foreground="Red" Margin="5" VerticalAlignment="Center"/> <ToggleButton Content="10小时" Height="26" Width="70" Margin="5" /> <ToggleButton Content="20小时" Height="26" Width="70" Margin="5" /> <ToggleButton Content="30小时" Height="26" Width="100" Margin="5" control:AyButton.IsFlatStyle="True" /> <ToggleButton Height="26" Width="26" Margin="5" BorderBrush="#FF5C97DA" control:AyButton.IsFlatStyle="True"> <Image Source="/Ay.Framework.WPF;component/resources/demo/icondemo3.png" Width="16" Height="16"/> </ToggleButton> <ToggleButton control:AyButton.IsFlatStyle="True" Height="26" Width="26" Margin="5" BorderBrush="#FF5C97DA"> <Image Width="18" Height="18" Source="/Ay.Framework.WPF;component/resources/demo/smile.png" Stretch="Uniform" /> </ToggleButton> <ToggleButton control:AyButton.IsFlatStyle="True" Height="26" Width="26" Margin="5" BorderBrush="#FF5C97DA"> <Image Source="/Ay.Framework.WPF;component/resources/demo/icondemo2.png" Width="16" Stretch="Uniform" Height="16"/> </ToggleButton> <ToggleButton control:AyButton.IsFlatStyle="True" Height="26" Width="26" Margin="5" BorderBrush="#FF5C97DA"> <Image Source="/Ay.Framework.WPF;component/resources/demo/demo3.png" Width="16" Height="16"/> </ToggleButton> <ToggleButton control:AyButton.IsFlatStyle="True" Background="#B2CFDEE8" Height="26" Width="26" Margin="5" BorderBrush="#FF5C97DA"> <Image Source="/Ay.Framework.WPF;component/resources/demo/demo3.png" Width="16" Height="16"/> </ToggleButton> </StackPanel>

效果图:

最后一个Toggle指定了背景颜色

2015-04-24 16:24:49

完成AySplitButton,继承Button类:

静态效果图:

动态图演示:

代码使用示例

<control:AySplitButton x:Name="FlatSplitbuttonAy" Foreground="#030303" FontSize="12" Click="SplitButton_Click" Width="118" Height="26" IsFlatStyle="True" VerticalAlignment="Center" HorizontalAlignment="Center" Mode="Split" Placement="Top" Margin="5,0,0,0"> <control:AySplitButton.Content> <StackPanel Orientation="Horizontal"> <Image Height="16" Margin="0,0,8,0" Source="demo3.png" Stretch="Fill" Width="16"/> <TextBlock Text="美食快递" /> </StackPanel> </control:AySplitButton.Content> <MenuItem Header="WPF语言"> <MenuItem.Icon> <Image Height="18" Source="icondemo2.png" Stretch="Uniform" Width="18"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="WPF开发"> <MenuItem Header="Web开发"> <MenuItem.Icon> <Image Height="18" Source="icodemo1.png" Stretch="Uniform" Width="18"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="桌面程序开发"> <MenuItem.Icon> <Image Height="18" Source="icondemo3.png" Stretch="Uniform" Width="18"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="游戏开发"/> <MenuItem Header="Winform开发"> <MenuItem.Icon> <Image Height="18" Source="icondemo3.png" Stretch="Uniform" Width="18"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Silverlight"/> </MenuItem> </control:AySplitButton>

特色:支持 弹出框位置自定义

支持3种模式 Mode

public enum SplitButtonMode { Split, ComboMenu, Button }

支持默认是否明显显示右侧展开三角形,调节右侧三角形的border即可,调节属性SanJiaoBorderOpacity double类型 0-1之间取值

例如中间第二个就是明显显示了

支持按钮内容自定义AySplitButton.Content属性,跟wpf自带的Button的Content一样.

对了,我们还支持 是否显示 三角形,来达到一个不显示三角形的 菜单效果, 请设置属性SanJiaoVisibility="Collapsed" 就行了

当然,你还可以直接 就一个三角形按钮也行,下面是我给出的示例代码,这里要设置Padding等于0,来覆盖默认样式的padding,因为我的SplitButton可以自动适应内容,调节内容边距

<control:AySplitButton x:Name="test_zuhe" Margin="5,0,0,0"Click="SplitButton_Click" Height="65"VerticalAlignment="Center" HorizontalAlignment="Center" Padding="0"Mode="Split" Placement="Bottom" > <MenuItem Header="无内容模式"/> <MenuItem Header="没有Content"> <MenuItem Header="padding要等于0"/> <MenuItem Header="Split模式"/> </MenuItem></control:AySplitButton>

2015-04-24 11:58:37

调整, 继承AyWindow和AyPopup的窗体默认 属于超高清模式 非普通画质,画质等级 低级-普通-中级-中等接近-高级-超高级

2015-04-24 10:08:22

调整菜单 最小宽度为174,并且调整menuitem的边距,让看起来更协调, 调整弹出位置与父控件左侧对其,由于 阴影的问题,牺牲了左侧的阴影,不过还好,不影响整体

2015-04-23 17:37:43

AySplitButton,支持 三角左侧内容自定义,还未完全实现完,还要实现 ComboMenu

静态图演示

2015-04-23 14:21:24

修改Menu的部分样式,调整阴影 更平

2015-04-22 17:40:05

透明度调节AyOpacitySetSlider样式, 支持垂直和水平模式, 支持 整型调整数字

2015-04-22 11:43:57和2015-04-22 15:07:50

AyCheckBox AyRadioButton 只是仅仅样式,控件还是 RadioButton,CheckBox

静态图片

2015-4-14 17:44:03

AyProgressBar样式完成,特色:支持动画时候,完成百分比连续动画,非完成部分白色

2015-4-14 12:03:43

AyIconAll 是一个完全超牛的Icon控件,支持图片(原来Image控件支持的,支持ico),支持path,支持gif,支持fontawesome (支持fa-mobile的写法,在wpf中-变成了_而已,支持动态切换)

示例代码:

Path的使用 path_ 开头定义图标,图标的data定义在application.xml中

关于FontAwesome我已经封装成枚举,更方便使用了,你可以直接按照fa的方式去使用

Icon的图片方式,支持pack,支持相对路径

path和fontawesome支持 颜色改变,根据Foreground更改,Path的宽和高是width和height,字体是fontsize,就当做textblock去调节就ok

2015-4-13 11:57:32

优化AyPopupWindow动画,不再偶尔卡顿

完成AyMessageBox

AyMessageBox是继承AyPopupWIndow,默认居中弹出,支持6套图标,图标来自AyIcons类

AyMessageBox支持自定义图标,可以控制标题栏高度,标题文字和LOGO,其他作用都是和MessageBox的参数一样,例如 是否删除对话框,点击确定,返回MessageBoxResult类型,你可以直接根据MessageBox的用法就会用了.

弹出框使用 DEMO

private void openMessageBox_Click(object sender, RoutedEventArgs e){if (cboMsgType.Text == "信息") {AyMessageBox.ShowInformation("必须填写用户名");}else if (cboMsgType.Text == "警告"){AyMessageBox.ShowWarning("必须填写用户名");}else if (cboMsgType.Text == "错误"){AyMessageBox.ShowError("必须填写用户名");}else if (cboMsgType.Text == "异常"){AyMessageBox.ShowError("必须填写用户名");}else if (cboMsgType.Text == "疑问"){AyMessageBox.ShowQuestion("必须填写用户名");}else if (cboMsgType.Text == "删除"){if (MessageBoxResult.OK == AyMessageBox.ShowDelete("确认删除吗", "删除")){AyMessageBox.ShowRight("操作成功!");}else {AyMessageBox.ShowRight("操作已经被取消!","操作");}}else if (cboMsgType.Text == "ok"){AyMessageBox.ShowRight("操作成功!");}}private void openIconMessageBox_Click(object sender, RoutedEventArgs e){AyMessageBox.ShowCus("确认删除吗", "", Environment.CurrentDirectory+"/images/sys_Remove.png");}

效果图:

2015-4-10 17:54:36

AyWindow支持右侧4个按钮分别是否显示

支持窗体icon和title设置,自动调整显示,图标请设置16*16的图标,因为模板不控制图标大小

主要为AyMessageBox打下基础

2015-4-10 17:18:46 AyPopupwindow更新

在原先的支持固定控件位置弹出,现又支持 居中弹出和右下角弹出(动画已经更新,出现是从下往上,关闭是从上往下)

支持窗体icon和title设置,自动调整显示,图标请设置16*16的图标,因为模板不控制图标大小

2015-4-7 16:49:00

http://www.ayjs.net/post/79.html AyCombobox,AyTextbox,AyAutoCompleteTextBox,AyScrollViewer已经完成

2015-03-31 13:10:05

Ay.Framework.WPF 架构优化,集成皮肤窗口,客户端无需单独设置,优化Application,客户无需记录打开窗口,优化关闭应用程序为OnExplicitShutdown,自带判断是否主窗口关闭,退出所有。去掉AyWindow的IsMainWindow属性。

新增CefSharp 谷歌37的浏览器控件,支持WPF,替代自带的WebBrowser,由于CefSharp的32位版本加载web有点慢,且不能AnyCPU,所以只能分为32版本和64位版本

整合背景图片文件夹和配置文件目录,优化xml读取

2015-03-27

AyTabControl

动态图:

Ay3DModelLoadControl

AyWindow

AySkinSetWindow

AyPopWindow

AyArcChart

AyFontRadioButton

AyFontButton

AyImage2Button

AyImage3Button

AyImage4Button(如AyWindow的右上角的4个按钮的状态)

AyPanel

ShowCurrentTime

AyContextMenu

AyMenu

Ay主题系统

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台