visual studio 和 blend for visual studio 有什么区别?

我看到与visual studio一起安装的有blend for visual studio,
不知道它们有什么区别?哪一个好用?

1个回答

blend for visual studio 这个并不是用于开发中写代码的,而是专门用来做WPF的界面设计的。这是为了让专业的人做专业的事,尽量让写代码的人只使用visual studio,而做界面设计的(如美工)只需要画界面。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Blend for Visual Studio 2012 能支持framewrk4.5.2的框架吗
Blend for Visual Studio 2012 能支持framewrk4.5.2的框架吗? 目前只支持4.5框架~我项目是4.5.2框架的在Blend中编辑的时候不出现窗口设计器界面。有没有大牛们遇到过~怎么破
vs2010和vs2013安装完之后,闪退。
今天下载完安装之后,都可以正常打开,安装了大番茄插件之后,出现欢迎界面 ![图片说明](https://img-ask.csdn.net/upload/201506/17/1434552871_744847.png) ![图片说明](https://img-ask.csdn.net/upload/201506/17/1434552907_520997.png) 直接闪退,无反应。 打开Blend for Visual Studio 2013则没有问题
关于livecharts官网中提供的Features->Events的示例问题?
livecharts示例代码:https://lvcharts.net/App/examples/v1/wpf/Events 我应用于wpf项目中的代码: ScrollableViewModel.cs ``` using LiveCharts; using LiveCharts.Defaults; using LiveCharts.Geared; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; namespace WpfApp1.Resources.UserControls.Scrollable { public class ScrollableViewModel : INotifyPropertyChanged { private Func<double, string> _formatter; private Func<double, string> _xformatter; private double _from; private double _to; private double _min; private double _max; public ScrollableViewModel() { DataClickCommand = new MyCommand<ChartPoint> { ExecuteDelegate = p => From = Values.FirstOrDefault().DateTime.Ticks }; var now = DateTime.Now; var trend = -30000d; var l = new List<DateTimePoint>(); var Eventl = new List<VisitsByDateTime>(); var r = new Random(); for (var i = 0; i < 50000; i++) { now = now.AddMilliseconds(100); double xx = Convert.ToDateTime(now).ToOADate(); //每隔100毫秒 l.Add(new DateTimePoint(now, trend)); //每隔一分鐘造一個事件 if (i % 600 == 0) Eventl.Add(new VisitsByDateTime { DateTime = now, Total = (decimal)1 }); if (r.NextDouble() > 0.4) { trend += r.NextDouble() * 10; } else { trend -= r.NextDouble() * 10; } } Formatter = x => new DateTime((long)x).ToString("dd日HH时mm分ss秒fff毫秒"); XFormatter = x => new DateTime((long)x).ToString("dd日HH时mm分"); Values = l.AsGearedValues().WithQuality(Quality.High); EventValues = Eventl.AsGearedValues(); From = DateTime.Now.AddMilliseconds(10000).Ticks; To = DateTime.Now.AddMilliseconds(900000).Ticks; Min = Values.FirstOrDefault().DateTime.Ticks; Max = Values.LastOrDefault().DateTime.Ticks; } public MyCommand<ChartPoint> DataClickCommand { get; set; } public object Mapper { get; set; } //波形 public GearedValues<DateTimePoint> Values { get; set; } //事件 public GearedValues<VisitsByDateTime> EventValues { get; set; } public double From { get { return _from; } set { _from = value; OnPropertyChanged("From"); } } public double To { get { return _to; } set { _to = value; OnPropertyChanged("To"); } } public double Min { get { return _min; } set { _min = value; OnPropertyChanged("Min"); } } public double Max { get { return _max; } set { _max = value; OnPropertyChanged("Max"); } } public Func<double, string> Formatter { get { return _formatter; } set { _formatter = value; OnPropertyChanged("Formatter"); } } public Func<double, string> XFormatter { get { return _xformatter; } set { _xformatter = value; OnPropertyChanged("XFormatter"); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName = null) { if (PropertyChanged != null) PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } public class MyCommand<T> : ICommand where T : class { public Predicate<T> CanExecuteDelegate { get; set; } public Action<T> ExecuteDelegate { get; set; } public bool CanExecute(object parameter) { return CanExecuteDelegate == null || CanExecuteDelegate((T)parameter); } public void Execute(object parameter) { if (ExecuteDelegate != null) ExecuteDelegate((T)parameter); } public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } } } ``` ScrollableViewE.xaml ``` <UserControl x:Class="WpfApp1.Resources.UserControls.ScrollableE.ScrollableViewE" 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:WpfApp1.Resources.UserControls.ScrollableE" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:geared="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared" xmlns:scrollable="clr-namespace:WpfApp1.Resources.UserControls.Scrollable" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> <UserControl.DataContext> <scrollable:ScrollableViewModel></scrollable:ScrollableViewModel> </UserControl.DataContext> <Grid> <lvc:CartesianChart Name="ScrollChart" DisableAnimations="True" ClipToBounds="True" Zoom="X" DataClick="ChartOnDataClick" Margin="20 10"> <lvc:CartesianChart.Resources> <Style TargetType="lvc:Separator"> <Setter Property="IsEnabled" Value="False"></Setter> </Style> </lvc:CartesianChart.Resources> <lvc:CartesianChart.Series> <geared:GColumnSeries Values="{Binding EventValues}" StrokeThickness="3"/> <geared:GLineSeries Values="{Binding Values}" LineSmoothness="0" StrokeThickness="2" Stroke="#00e701" PointGeometry="{x:Null}" AreaLimit="0"/> </lvc:CartesianChart.Series> <lvc:CartesianChart.AxisX> <lvc:Axis IsMerged="True" LabelFormatter="{Binding XFormatter, Mode=OneTime}" MinValue="{Binding Min, Mode=TwoWay}" MaxValue="{Binding Max, Mode=TwoWay}" Foreground="#fff" FontSize="12" FontWeight="UltraBold"/> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> <lvc:Axis ShowLabels="False" /> </lvc:CartesianChart.AxisY> </lvc:CartesianChart> </Grid> </UserControl> ``` ScrollableViewE.cs ``` using LiveCharts; using LiveCharts.Wpf; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfApp1.Resources.UserControls.ScrollableE { /// <summary> /// ScrollableViewE.xaml 的交互逻辑 /// </summary> public partial class ScrollableViewE : UserControl { public ScrollableViewE() { InitializeComponent(); } private void ChartOnDataClick(object sender, ChartPoint p) { Console.WriteLine("[EVENT] You clicked (" + p.X + ", " + p.Y + ")"); } } } ``` 运行截图: ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579513236_276210.png) 问题:当我点击折线图的时候可以进入到ChartOnDataClick方法,但是为什么点击柱状图的时候没反应呢?怎么才能让点击柱状图的时候进入到ChartOnDataClick方法?
VS2019未到return就突然函数执行结束
![图片说明](https://img-ask.csdn.net/upload/201912/28/1577510261_313085.png) 构造函数执行到第47行就返回了,断点检测到的,程序没有爆出任何异常。 之前代码都一直是正常执行的,突然一次编译就这样了 而且突然所有的数据绑定和命令绑定都失效了。 有谁遇见过吗? ``` <Page xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="VRnew.View.ManagePatientView" 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:VRnew.View" mc:Ignorable="d" DataContext="{Binding managePatientViewModel, Source={StaticResource Locator}}" x:Name="ManagePatientVMPage" Title="ManagePatientView"> <telerik:RadButton x:Name="FlushButton" Grid.Row="4" Grid.Column="0" Content="刷新" FontSize="25" Command="{Binding DataContext.FlushPatient ,ElementName=ManagePatientVMPage}" telerik:StyleManager.Theme="Office2016Touch" ></telerik:RadButton> ``` 这是View层的 ``` private RelayCommand _flushpatient; public RelayCommand FlushPatient => _flushpatient ?? (_flushpatient = new RelayCommand (async () => { PatientInformationIE = managePatientModel.GetAllPatient(); }) ); ``` 这是VM层的,点击flush按钮没有触发command,断点不执行这里。
Blend2019能不能导入AI文件
Blend2019能不能导入AI文件作出复合路径 或者怎么用blend做出Ai文件里的复杂的集合路径
wpf导入3ds max生成的obj文件,发现贴图位置不对
在使用expression blend 4 导入3ds max导出的obj文件时,发现展示出来的效果出现了贴图位置不对的情况,如下图:![图片说明](https://img-ask.csdn.net/upload/201909/11/1568171829_957027.png) 我使用的是win10 64位系统,我用系统自带的3d build和3dview查看obj文件,发现文件效果展示正常,如下图:![图片说明](https://img-ask.csdn.net/upload/201909/11/1568171930_352550.png) 现在不清楚是什么原因,猜测可能是因为blend中的坐标体系与其他的不一样,造成贴图位置无法正确对应,但网络上没有相关问题的解决方案,在这边请教各位大神。[源文件及obj文件](链接: https://pan.baidu.com/s/1zybIzR4DRWstqH8oYtjmiA 提取码: i61i "")
WPF的Webbrowser浏览本地html中的echart图,鼠标悬浮不出数据。
公司WPF项目要看各种折线统计图,然后我用webbroswer打开本地html交互做好了,但是鼠标悬浮在图上到交点的时候不会显示点的数据,我又做了个小demo,单独拉了一个wpf项目这么做是成功的,鼠标悬浮以后是出点数据的,但是公司的项目就是不行,可惜我不是很精通wpf,总感觉鼠标下有一层这招挡着,导致根本没法触发鼠标的各种事件,求解决。 这个是Echart.xaml那个子页面 ``` <Page x:Class="HontyeNMR.UserControls.Echart" 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:HontyeNMR.UserControls" mc:Ignorable="d" d:DesignHeight="375" d:DesignWidth="1000"> <Grid> <WebBrowser x:Name="webBrowser1"/> </Grid> </Page> ``` 后台只有一句 webBrowser1.Navigate("https://echarts.baidu.com/examples/editor.html?c=line-stack"); 这个是App.xaml ``` <Application x:Class="HontyeNMR.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="UserControls/Page1.xaml" Startup="Application_Startup"> <Application.Resources> <!--空按钮--> <Style x:Key="EmptyButton" TargetType="Button"> <Setter Property="Padding" Value="0"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <ContentPresenter Content="{TemplateBinding Content}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonBlue" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#00A5DB" Offset="0.5"/> <GradientStop Color="#00A5DB" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#0095DB" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#0095DB" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#0085DB" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#0085DB" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonYellow" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#FF8800" Offset="0.5"/> <GradientStop Color="#FF8800" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#FF7700" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#FF7700" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#FF6600" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#FF6600" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonRed" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#EC4040" Offset="0.5"/> <GradientStop Color="#EC4040" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#EC5050" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#EC5050" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#EC6060" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#EC6060" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonGray" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#C8C8C8" Offset="0.5"/> <GradientStop Color="#C8C8C8" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#B8B8B8" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#B8B8B8" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#A8A8A8" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#A8A8A8" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--滚动条样式Start--> <ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}"> <Grid x:Name="Grid" Background="{TemplateBinding Background}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Rectangle x:Name="Corner" Grid.Column="1" Fill="White" Grid.Row="1"/> <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/> <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource MyScrollBarStyle}"/> <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Style="{DynamicResource MyScrollBarStyle}"/> </Grid> </ControlTemplate> <!-- 应该在此定义资源字典条目。--> <SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4"/> <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Focusable" Value="false"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type RepeatButton}"> <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Thumb}"> <Rectangle Name="thumbRect" Fill="LightGray" RadiusX="3" RadiusY="3"/> <!--滚动条颜色--> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Fill" Value="Gray" TargetName="thumbRect" /> <!--滚动条选中颜色--> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Focusable" Value="false"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type RepeatButton}"> <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="MyScrollBarStyle" TargetType="{x:Type ScrollBar}"> <Setter Property="Background" Value="AliceBlue"/> <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> <Setter Property="Stylus.IsFlicksEnabled" Value="false"/> <Setter Property="Width" Value="6"/> <Setter Property="MinWidth" Value="6"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ScrollBar}"> <Grid x:Name="Bg" Background="AliceBlue" SnapsToDevicePixels="true" Width="6"> <Grid.RowDefinitions> <RowDefinition /> </Grid.RowDefinitions> <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}"> <Track.DecreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> </Track.DecreaseRepeatButton> <Track.IncreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> </Track.IncreaseRepeatButton> <Track.Thumb> <Thumb Style="{StaticResource ScrollBarThumb}"/> </Track.Thumb> </Track> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="Orientation" Value="Horizontal"> <Setter Property="Width" Value="Auto"/> <Setter Property="MinWidth" Value="0"/> <Setter Property="Height" Value="6"/> <Setter Property="MinHeight" Value="6"/> <Setter Property="Background" Value="AliceBlue"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ScrollBar}"> <Grid x:Name="Bg" Background="AliceBlue" SnapsToDevicePixels="true"> <Grid.ColumnDefinitions> <ColumnDefinition /> </Grid.ColumnDefinitions> <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}"> <Track.DecreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> </Track.DecreaseRepeatButton> <Track.IncreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> </Track.IncreaseRepeatButton> <Track.Thumb> <Thumb Style="{StaticResource ScrollBarThumb}" /> </Track.Thumb> </Track> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <!--滚动条样式End--> </Application.Resources> </Application> ``` 下面是MainWindow ``` <Window x:Class="MR.MainWindow" 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:MR" mc:Ignorable="d" Title="MainWindow" Height="800" Width="1000"> <Grid> <StackPanel x:Name="asd"></StackPanel> </Grid> </Window> Page1 page1 = new Page1(); this.Content = page1; ```
uwp xml 背景图片没有显示是什么情况
想做个界面的背景图片,在其中的一个界面上可以显示,但是新建的界面却没能显示图片,不知道什么原因,下面为没出图片界面的代码。大佬帮忙看下,谢谢。 <Page x:Class="EBoatApp.Views.ActivatePage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:EBoatApp.Views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Grid> <Grid.Background> <ImageBrush Stretch="Fill" ImageSource="Skin/Icon/背景.jpg"></ImageBrush> </Grid.Background> <Grid.RowDefinitions> <RowDefinition Height="15*"/> <RowDefinition Height="85*"/> </Grid.RowDefinitions> <Grid Grid.Row="0" Background="lightBlue"></Grid> <TextBlock Text="BOSON 干式荧光免疫分析仪" Grid.Row="0" HorizontalAlignment="Left" FontSize="36" Foreground="Blue" Margin="20,0,0,0" FontStyle="Italic" IsColorFontEnabled="True" > </TextBlock> <Border Grid.Row="1"> <Border.Background > <ImageBrush Stretch="UniformToFill" AlignmentX="Center" ImageSource="Skin/Icon/背景.jpg"></ImageBrush> </Border.Background> <Image HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" /> </Border> <!--<Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" > <Grid.Background> <ImageBrush Stretch="UniformToFill" AlignmentX="Center" ImageSource="Skin/Icon/背景.jpg" /> </Grid.Background> </Grid>--> </Grid> </Page>
WPF .Net FameWork4.6.1 DataGrid 数据要点击才显示
DataGrid 数据要点击才显示然后 点击其他地方又隐藏了 是照着微软例子写的:https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application 我的项目源代码: 链接:https://pan.baidu.com/s/1EAu-NoczTAPpOdTadHQR_Q 提取码:fntw 如图:数据有的,就是不显示: ![图片说明](https://img-ask.csdn.net/upload/201903/19/1552975802_492289.jpg) ![图片说明](https://img-ask.csdn.net/upload/201903/19/1552975793_320016.jpg) DataGrid 代码: ![图片说明](https://img-ask.csdn.net/upload/201903/19/1552975739_313108.jpg) 整个文件: ``` <Page x:Class="ExpenseIt.ExpenseReportPage" 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:ExpenseIt" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Title="ExpenseIt - View Expense"> <Grid> <Grid.Background> <ImageBrush ImageSource="watermark.png"/> </Grid.Background> <Grid.ColumnDefinitions> <ColumnDefinition Width="230"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <Label Grid.Column="1" Style="{StaticResource headerTextStyle}"> Expen Report For: </Label> <Grid Margin="10" Grid.Column="1" Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition /> </Grid.RowDefinitions> <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Orientation="Horizontal" > <Label Style="{StaticResource labelStyle}">Name:</Label> <Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Name}"></Label> </StackPanel> <!-- DepartMent --> <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Orientation="Horizontal"> <Label Style="{StaticResource labelStyle}">DeparTment</Label> <Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Department}"></Label> </StackPanel> <Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" VerticalAlignment="Top" HorizontalAlignment="Left"> <!--Templates to Diaplay Expense Report data--> <Grid.Resources> <!--Reason item Template--> <DataTemplate x:Key="typeItemTemplate"> <Label Content="{Binding XPath=@ExpenseType}"/> </DataTemplate> <!--Amount item template--> <DataTemplate x:Key="amountItemTemplate"> <Label Content="{Binding XPath=@ExpenseAmount}"/> </DataTemplate> </Grid.Resources> <!-- Expense Type and Amount table --> <DataGrid ItemsSource="{Binding XPath=Expense}" ColumnHeaderStyle="{StaticResource columnHeaderSyle}" AutoGenerateColumns="False" RowHeaderWidth="0" RowHeight="50"> <DataGrid.Columns> <DataGridTemplateColumn Header="ExpenseType" CellEditingTemplate="{StaticResource typeItemTemplate}"/> <DataGridTemplateColumn Header="Amount" CellEditingTemplate="{StaticResource amountItemTemplate}"/> </DataGrid.Columns> </DataGrid> </Grid> </Grid> </Grid> </Page> ```
Silverlight中依赖属性设置出错
环境:Visual Studio 2010 Silverlight应用程序 实现类似微软人立方的人物关系图效果 但是出现如下错误: **未在类型“Button”中找到属性“CircleButtonWidth1” 。** 求大神给看一下,这个怎么改才可以?(附MainPage.xaml和MainPage.xaml.cs如下:) 首先是MailPage.xaml: **<UserControl x:Class="SilverlightApplication4.MainPage" 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:SilverlightApplication4" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <UserControl.Resources> <Style x:Key="CircleButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid Height="auto" HorizontalAlignment="Center" VerticalAlignment="Center" Width="auto" IsHitTestVisible="True" Background="{x:Null}"> <Ellipse Margin="0,0,0,0" Stroke="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{TemplateBinding CircleButtonWidth1}" Height="{TemplateBinding CircleButtonHeight1}" IsHitTestVisible="False" x:Name="ellipse1" Fill="{TemplateBinding Ellipse1Fill}"> </Ellipse> <Grid Margin="0,0,0,0" HorizontalAlignment="Center" Width="1024" Height="1024" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" x:Name="grid" Opacity="1" Background="{x:Null}" IsHitTestVisible="True"> <Ellipse Fill="{TemplateBinding Ellipse2Fill}" Stroke="{TemplateBinding Ellipse2Stroke}" Margin="0,0,0,0" Width="{TemplateBinding CircleButtonWidth2}" Height="{TemplateBinding CircleButtonHeight2}" x:Name="ellipse2" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center"> </Ellipse> <Ellipse Margin="2,2,2,2" Fill="{TemplateBinding Ellipse3Fill}" Width="{TemplateBinding CircleButtonWidth3}" Height="{TemplateBinding CircleButtonHeight3}" x:Name="ellipse3" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center"> </Ellipse> <TextBlock Margin="0,0,0,0" FontFamily="Microsoft YaHei" FontSize="{TemplateBinding FontSize}" Foreground="#FFFFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="textBlock" Text="{TemplateBinding Content}" RenderTransformOrigin="0.5,0.5" IsHitTestVisible="False"> </TextBlock> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <Button Style="{StaticResource CircleButton}" Name="myButton" Content="Click me!!!" Click="myButton_Click_1" > </Button> </Grid> </UserControl>** 下面是MainPage.xaml.cs文件: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Reflection; namespace SilverlightApplication4 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void myButton_Click(object sender, RoutedEventArgs e) { } public partial class CircleButton : UserControl { static CircleButton() { Ellipse1FillProperty = DependencyProperty.Register("myEllipse1Fill", typeof(Brush), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnEllipse1FillPropertyChanged)));//Ellipse1FillProperty.OnEllipse1FillPropertyChanged Ellipse2FillProperty = DependencyProperty.Register("myEllipse2Fill", typeof(Brush), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnEllipse2FillPropertyChanged))); Ellipse3FillProperty = DependencyProperty.Register("myEllipse3Fill", typeof(Brush), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnEllipse3FillPropertyChanged))); CircleButtonWidth1Property = DependencyProperty.Register("myCircleButtonWidth1", typeof(Double), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnCircleButtonWidth1PropertyChanged))); CircleButtonWidth2Property = DependencyProperty.Register("myCircleButtonWidth2", typeof(Double), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnCircleButtonWidth2PropertyChanged))); CircleButtonWidth3Property = DependencyProperty.Register("myCircleButtonWidth3", typeof(Double), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnCircleButtonWidth3PropertyChanged))); } private static void OnEllipse1FillPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnEllipse1FillPropertyChanged(e); } private static void OnEllipse2FillPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnEllipse2FillPropertyChanged(e); } private static void OnEllipse3FillPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnEllipse3FillPropertyChanged(e); } private static void OnCircleButtonWidth1PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnCircleButtonWidth1PropertyChanged(e); } private static void OnCircleButtonWidth2PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnCircleButtonWidth2PropertyChanged(e); } private static void OnCircleButtonWidth3PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnCircleButtonWidth3PropertyChanged(e); } public event DependencyPropertyChangedEventHandler Ellipse1FillPropertyChanged; public event DependencyPropertyChangedEventHandler Ellipse2FillPropertyChanged; public event DependencyPropertyChangedEventHandler Ellipse3FillPropertyChanged; public event DependencyPropertyChangedEventHandler CircleButtonWidth1PropertyChanged; public event DependencyPropertyChangedEventHandler CircleButtonWidth2PropertyChanged; public event DependencyPropertyChangedEventHandler CircleButtonWidth3PropertyChanged; void OnEllipse1FillPropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (Ellipse1FillPropertyChanged != null) { Ellipse1FillPropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnEllipse2FillPropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (Ellipse2FillPropertyChanged != null) { Ellipse2FillPropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnEllipse3FillPropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (Ellipse3FillPropertyChanged != null) { Ellipse3FillPropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnCircleButtonWidth1PropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (CircleButtonWidth1PropertyChanged != null) { CircleButtonWidth1PropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnCircleButtonWidth2PropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (CircleButtonWidth2PropertyChanged != null) { CircleButtonWidth2PropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnCircleButtonWidth3PropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (CircleButtonWidth3PropertyChanged != null) { CircleButtonWidth3PropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } //有些时候,我们希望在模板生效的时候就对某些模板成员进行操作,如绑定事件, //调整属性等,就需要一个事件OnApplyTemplate,我们只能通过override父类的OnApplyTemplate来响应模板生效 public override void OnApplyTemplate() { base.OnApplyTemplate(); try { var tb = GetTemplateChild("ButtonCaption") as Ellipse; //(GetTemplateChild("ButtonCaption") as Ellipse).Fill= this.Ellipse1Fill; tb.Fill= this.Ellipse1Fill; var tb2 = GetTemplateChild("ButtonCaption") as Ellipse; (GetTemplateChild("ButtonCaption") as Ellipse).Fill = this.Ellipse2Fill; var tb3 = GetTemplateChild("ButtonCaption") as Ellipse; (GetTemplateChild("ButtonCaption") as Ellipse).Fill = this.Ellipse3Fill; var we1 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonWidth1; var we2 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonWidth2; var we3 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonWidth3; var w1 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonHeight1; var w2 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonHeight2; var w3 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonHeight3; } catch (Exception ex) { string ke = ex.ToString(); } } public Brush Ellipse1Fill { get { return (Brush)base.GetValue(Ellipse1FillProperty); } set { base.SetValue(Ellipse1FillProperty, value); } } public Brush Ellipse2Fill { get { return (Brush)base.GetValue(Ellipse2FillProperty); } set { base.SetValue(Ellipse2FillProperty, value); } } public Brush Ellipse3Fill { get { return (Brush)base.GetValue(Ellipse3FillProperty); } set { base.SetValue(Ellipse3FillProperty, value); } } public double CircleButtonWidth1 { get { return (double)base.GetValue(CircleButtonWidth1Property); } set { base.SetValue(CircleButtonWidth1Property, value); } } public double CircleButtonWidth2 { get { return (double)base.GetValue(CircleButtonWidth2Property); } set { base.SetValue(CircleButtonWidth2Property, value); } } public double CircleButtonWidth3 { get { return (double)base.GetValue(CircleButtonWidth3Property); } set { base.SetValue(CircleButtonWidth3Property, value); } } public double CircleButtonHeight1 { get { return (double)base.GetValue(CircleButtonHeight1Property); } set { base.SetValue(CircleButtonHeight1Property, value); } } public double CircleButtonHeight2 { get { return (double)base.GetValue(CircleButtonHeight2Property); } set { base.SetValue(CircleButtonHeight2Property, value); } } public double CircleButtonHeight3 { get { return (double)base.GetValue(CircleButtonHeight3Property); } set { base.SetValue(CircleButtonHeight3Property, value); } } ///<summary> /// /// Register property. ///</summary> public static readonly DependencyProperty Ellipse1FillProperty = DependencyProperty.Register("Ellipse1Fill", typeof(Brush), typeof(CircleButton), null); public static readonly DependencyProperty Ellipse2FillProperty = DependencyProperty.Register("Ellipse2Fill", typeof(Brush), typeof(CircleButton), null); public static readonly DependencyProperty Ellipse3FillProperty = DependencyProperty.Register("Ellipse3Fill", typeof(Brush), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonWidth1Property = DependencyProperty.Register("CircleButtonWidth1", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonWidth2Property = DependencyProperty.Register("CircleButtonWidth2", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonWidth3Property = DependencyProperty.Register("CircleButtonWidth3", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonHeight1Property = DependencyProperty.Register("CircleButtonHeight1", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonHeight2Property = DependencyProperty.Register("CircleButtonHeight2", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonHeight3Property = DependencyProperty.Register("CircleButtonHeight3", typeof(double), typeof(CircleButton), null); } private void myButton_Click_1(object sender, RoutedEventArgs e) { } } }
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
iOS Bug 太多,苹果终于坐不住了!
开源的 Android 和闭源的 iOS,作为用户的你,更偏向哪一个呢? 整理 | 屠敏 出品 | CSDN(ID:CSDNnews) 毋庸置疑,当前移动设备操作系统市场中,Android 和 iOS 作为两大阵营,在相互竞争的同时不断演进。不过一直以来,开源的 Android 吸引了无数的手机厂商涌入其中,为其生态带来了百花齐放的盛景,但和神秘且闭源的 iOS 系统相比,不少网友
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
为什么你学不过动态规划?告别动态规划,谈谈我的经验
动态规划难吗?说实话,我觉得很难,特别是对于初学者来说,我当时入门动态规划的时候,是看 0-1 背包问题,当时真的是一脸懵逼。后来,我遇到动态规划的题,看的懂答案,但就是自己不会做,不知道怎么下手。就像做递归的题,看的懂答案,但下不了手,关于递归的,我之前也写过一篇套路的文章,如果对递归不大懂的,强烈建议看一看:为什么你学不会递归,告别递归,谈谈我的经验 对于动态规划,春招秋招时好多题都会用到动态...
(经验分享)作为一名普通本科计算机专业学生,我大学四年到底走了多少弯路
今年正式步入了大四,离毕业也只剩半年多的时间,回想一下大学四年,感觉自己走了不少弯路,今天就来分享一下自己大学的学习经历,也希望其他人能不要走我走错的路。 (一)初进校园 刚进入大学的时候自己完全就相信了高中老师的话:“进入大学你们就轻松了”。因此在大一的时候自己学习的激情早就被抛地一干二净,每天不是在寝室里玩游戏就是出门游玩,不过好在自己大学时买的第一台笔记本性能并不是很好,也没让我彻底沉...
使用 Angular 打造微前端架构的 ToB 企业级应用
这篇文章其实已经准备了11个月了,因为虽然我们年初就开始使用 Angular 的微前端架构,但是产品一直没有正式发布,无法通过生产环境实践验证可行性,11月16日我们的产品正式灰度发布,所以是时候分享一下我们在使用 Angular 微前端这条路上的心得(踩过的坑)了额,希望和 Angular 社区一起成长一起进步,如果你对微前端有一定的了解并且已经在项目中尝试了可以忽略前面的章节。 什么是微前...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
拿下微软、Google、Adobe,印度为何盛产科技圈 CEO?
作者 | 胡巍巍 出品 | CSDN(ID:CSDNnews) 世界500强中,30%的掌舵人,都是印度人。 是的,你没看错。这是近日《哈佛商业评论》的研究结果。 其中又以微软CEO萨提亚·纳德拉(Satya Nadella)、和谷歌CEO桑达尔·皮查伊(Sundar Pichai,以下简称劈柴)最为出名。 微软CEO萨提亚·纳德拉(Satya Nadella) 其他著名印度...
程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
一文带你入门Linux
文章目录1.1 Linux的概述:1.1.1 什么是Linux:1.1.1.1 学习Linux之前先了解Unix1.1.1.2 Linux的概述:1.1.1.3 Linux的历史:1.1.1.4 Linux系统的应用:1.1.1.5 Linux的版本1.1.1.6 Linux的主流版本1.2 Linux的安装:1.2.1 虚拟机安装:1.2.1.1 什么是虚拟机1.2.1.2 安装VmWare1....
普通三本毕业,我怎么一路艰辛进入阿里的
英雄不问出处? 自古以来就有这样一句话,真的英雄不问出处吗?这句话太挫了。普通三本院校的我,大四的时候居然都不知道什么是校招,所以出处太重要了。这也是没有机会参加阿里校招的原因,毕竟校招门槛比社招还是要低的,最重要的是校招进入阿里能让你的起点比别人更高。 有幸可以社招进入阿里,了解了校招的思路,赶紧介绍给学弟们,现在我们三本院校的小学弟今年居然有 3 个人通过了阿里的校招。下面我也把这份宝贵的经...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
强烈推荐10本程序员在家读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。
关于2020年个人项目【臻美_疫情实时大数据报告】(项目开源)
本项目开源,供大家学习交流,数据来自官方通报。 项目网址: 点这可以查看项目 项目图例: 1、国内疫情(省) 2、国内疫情(市) 3、国外疫情 4、热点消息、辟谣消息 5、防疫知识 源码奉上: 本项目后台使用node.js app.js var originRequest = require('request'); var iconv = require('iconv-lite'...
[数据结构与算法] 排序算法
终于学习到了算法部分, 在学习算法时, 我们还是应该回顾一下数据结构与算法之间的关系 数据结构是研究数据的组织方式, 是算法的基础 算法是解决编程问题的方法论, 是程序的灵魂 程序= 数据结构+算法 排序算法 排序也称排序算法(Sort algorithm). 是指 将一组数据按照指定顺序进行排列的过程 主要分为内部排序和外部排序 内部排序: 指将需要处理的数据加载到内存中进行排序 外部排序...
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
智力题(程序员面试经典)
NO.1  有20瓶药丸,其中19瓶装有1克/粒的药丸,余下一瓶装有1.1克/粒的药丸。给你一台称重精准的天平,怎么找出比较重的那瓶药丸?天平只能用一次。 解法 有时候,严格的限制条件有可能反倒是解题的线索。在这个问题中,限制条件是天平只能用一次。 因为天平只能用一次,我们也得以知道一个有趣的事实:一次必须同时称很多药丸,其实更准确地说,是必须从19瓶拿出药丸进行称重。否则,如果跳过两瓶或更多瓶药...
自学python网络爬虫,从小白快速成长,分别实现静态网页爬取,下载meiztu中图片;动态网页爬取,下载burberry官网所有当季新品图片。
文章目录 1.前言 2.知识储备 3.爬取静态网站 4.爬取动态网站 1.前言 近日疫情严重,手机已经玩吐了,闲着无聊逛衣服品牌官网发现,结果一时兴起,想学一学python,写一个爬虫下载官网所有最新上架的衣服图片和价格;说干就干,但身为一个只学过一些c和c++的python 0基础大二小白,csdn上的各种教程里涉及的各种发法、工具和库让我眼花缭乱;因此走了很多弯路,终于花三天时间完成了爬虫的设...
面试官问你MyBatis SQL是如何执行的?把这篇文章甩给他
初识 MyBatis MyBatis 是第一个支持自定义 SQL、存储过程和高级映射的类持久框架。MyBatis 消除了大部分 JDBC 的样板代码、手动设置参数以及检索结果。MyBatis 能够支持简单的 XML 和注解配置规则。使 Map 接口和 POJO 类映射到数据库字段和记录。 MyBatis 的特点 那么 MyBatis 具有什么特点呢?或许我们可以从如下几个方面来描述 MyBati...
对Tomcat的简单概要小结
首先我们必须得知道Tomcat就是一个服务,一个本地服务,我们可以控制启动和停止,我们程序员通过这个服务主要是用来存放我们的java程序,当我们把Java程序放进Tomcat服务中,一旦Tomcat服务启动起来,其他电脑就可以进行网络连通,也就是说其他电脑也可以共同访问这个Java程序。 Tomcat的主要目录的概念 有上面的概念之后,我们再来知道一下tomcat根目录下都有哪些文件,以及这些文...
程序员回家过年,外婆说没带女朋友别回来了?喝了老爸89年的酒,当场反目。
点赞再看,养成习惯,微信搜索【三太子敖丙】关注这个被微信官方推荐过的逗比 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点系统复习,希望我们一起有点东西。 注:本文是水日常的文章,不是技术文,看技术的同学可以右划了。 今天是除夕,帅丙也不水太多东西了,先祝大家...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
Java实现多线程的三种方式
在Java中可通过三种方式来实现多线程:1、继承Thread类,重写run( )方法;2、实现Runnable接口,重写run( )方法;3、实现Callable接口,重写call( )方法并使用FutureTask获取call( )方法的返回结果
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
[网络安全自学篇] 四十五.病毒详解及批处理病毒制作(自启动、修改密码、定时关机、蓝屏、进程关闭)
这是作者的网络安全自学教程系列,主要是关于安全工具和实践操作的在线笔记,特分享出来与博友们学习,希望您们喜欢,一起进步。前文分享了Windows远程桌面服务漏洞(CVE-2019-0708),并详细讲解该漏洞及防御措施。这篇文章将讲解简单的病毒原理知识,并通过批处理代码制作病毒,包括自动启、修改密码、定时关机、蓝屏、进程关闭等功能。希望这篇基础文章对您有所帮助,更希望大家提高安全意识,学会相关防范,也欢迎大家讨论。
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
阿里架构师花近十年时间整理出来的Java核心知识pdf(Java岗)
由于细节内容实在太多啦,所以只把部分知识点截图出来粗略的介绍,每个小节点里面都有更细化的内容! 整理了一份Java核心知识点。覆盖了JVM、锁、并发、Java反射、Spring原理、微服务、Zookeeper、数据库、数据结构等大量知识点。 欢迎大家加入java学习交流社区 点击加入 可获取文中文档 小编推荐: ...
利用python爬取丁香医生上新型肺炎数据,并下载到本地,附带经纬度信息
新型肺炎肆虐全国,获取其患病人员分布数据,对于科学研究具有一定的指导意义,因此利用python爬取丁香医生上实时的数据,并将其打包成exe文件,可以本地直接执行,不需配置环境,当然爬取的数据没有经纬度信息,这里我利用百度地图开发者平台,通过市名获取经纬度坐标。 软件下载地址: 链接:https://pan.baidu.com/s/1zgPIre_39eG9iQfxTxq1Fg 提取码:1tmi...
Python基础知识点梳理
python常见知识点梳理 摘要: 本文主要介绍一些平时经常会用到的python基础知识点,用于加深印象。python的详细语法介绍可以查看官方编程手册,也有一些在线网站对python语法进行了比较全面的介绍,比如菜鸟教程: python3 教程|菜鸟教程 本文主要是介绍基础语法,操作实例在另一篇博客中单独介绍: python语言介绍 python是一门解释型语言,python的设计目标: 一门...
相关热词 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数 c#日期精确到分钟 c#自定义异常必须继承 c#查表并返回值 c# 动态 表达式树 c# 监控方法耗时 c# listbox c#chart显示滚动条
立即提问