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

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

1个回答

应该是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) { } } }
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n
进程通信方式总结与盘点
​ 进程通信是指进程之间的信息交换。这里需要和进程同步做一下区分,进程同步控制多个进程按一定顺序执行,进程通信是一种手段,而进程同步是目标。从某方面来讲,进程通信可以解决进程同步问题。 ​ 首先回顾下我们前面博文中讲到的信号量机制,为了实现进程的互斥与同步,需要在进程间交换一定的信息,因此信号量机制也可以被归为进程通信的一种方式,但是也被称为低级进程通信,主要原因为: 效率低:一次只可操作少量的...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
听说了吗?阿里双11作战室竟1根网线都没有
双11不光是购物狂欢节,更是对技术的一次“大考”,对于阿里巴巴企业内部运营的基础保障技术而言,亦是如此。 回溯双11历史,这背后也经历过“小米加步枪”的阶段:作战室从随处是网线,交换机放地上的“一地狼藉”;到如今媲美5G的wifi网速,到现场却看不到一根网线;从当年使用商用AP(无线路由器),让光明顶双11当天断网一分钟,到全部使用阿里自研AP……阿里巴巴企业智能事业部工程师们提供的基础保障...
在阿里,40岁的奋斗姿势
在阿里,40岁的奋斗姿势 在阿里,什么样的年纪可以称为老呢?35岁? 在云网络,有这样一群人,他们的平均年龄接近40,却刚刚开辟职业生涯的第二战场。 他们的奋斗姿势是什么样的呢? 洛神赋 “翩若惊鸿,婉若游龙。荣曜秋菊,华茂春松。髣髴兮若轻云之蔽月,飘飖兮若流风之回雪。远而望之,皎若太阳升朝霞;迫而察之,灼若芙蕖出渌波。” 爱洛神,爱阿里云 2018年,阿里云网络产品部门启动洛神2.0升...
关于研发效能提升的思考
研发效能提升是最近比较热门的一个话题,本人根据这几年的工作心得,做了一些思考总结,由于个人深度有限,暂且抛转引入。 三要素 任何生产力的提升都离不开这三个因素:人、流程和工具,少了其中任何一个因素都无法实现。 人,即思想,也就是古人说的“道”,道不同不相为谋,是制高点,也是高层建筑的基石。 流程,即方法,也是古人说的“法”。研发效能的提升,也就是要提高投入产出比,既要增加产出,也要减...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆  每天早上8:30推送 作者| Mr.K   编辑| Emma 来源| 技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯
程序员该看的几部电影
##1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?
入职阿里5年,他如何破解“技术债”?
简介: 作者 | 都铎 作为一名技术人,你常常会听到这样的话: “先快速上线” “没时间改” “再缓一缓吧” “以后再解决” “先用临时方案处理” …… 当你埋下的坑越来越多,不知道哪天哪位同学就会踩上一颗雷。特别赞同“人最大的恐惧就是未知,当技术债可说不可见的时候,才是最让人不想解决的时候。” 作为一个程序员,我们反对复制粘贴,但是我们经常会见到相似的代码,相同的二方包,甚至整个代码...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布了 2019年国民经济报告 ,报告中指出:年末中国大陆总人口(包括31个
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
Java坑人面试题系列: 包装类(中级难度)
Java Magazine上面有一个专门坑人的面试题系列: https://blogs.oracle.com/javamagazine/quiz-2。 这些问题的设计宗旨,主要是测试面试者对Java语言的了解程度,而不是为了用弯弯绕绕的手段把面试者搞蒙。 如果你看过往期的问题,就会发现每一个都不简单。 这些试题模拟了认证考试中的一些难题。 而 “中级(intermediate)” 和 “高级(ad
深度学习入门笔记(十八):卷积神经网络(一)
欢迎关注WX公众号:【程序员管小亮】 专栏——深度学习入门笔记 声明 1)该文章整理自网上的大牛和机器学习专家无私奉献的资料,具体引用的资料请看参考文献。 2)本文仅供学术交流,非商用。所以每一部分具体的参考资料并没有详细对应。如果某部分不小心侵犯了大家的利益,还望海涵,并联系博主删除。 3)博主才疏学浅,文中如有不当之处,请各位指出,共同进步,谢谢。 4)此属于第一版本,若有错误,还需继续修正与...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
节后首个工作日,企业们集体开晨会让钉钉挂了
By 超神经场景描述:昨天 2 月 3 日,是大部分城市号召远程工作的第一天,全国有接近 2 亿人在家开始远程办公,钉钉上也有超过 1000 万家企业活跃起来。关键词:十一出行 人脸...
Java基础知识点梳理
Java基础知识点梳理 摘要: 虽然已经在实际工作中经常与java打交道,但是一直没系统地对java这门语言进行梳理和总结,掌握的知识也比较零散。恰好利用这段时间重新认识下java,并对一些常见的语法和知识点做个总结与回顾,一方面为了加深印象,方便后面查阅,一方面为了学好java打下基础。 Java简介 java语言于1995年正式推出,最开始被命名为Oak语言,由James Gosling(詹姆
2020年全新Java学习路线图,含配套视频,学完即为中级Java程序员!!
新的一年来临,突如其来的疫情打破了平静的生活! 在家的你是否很无聊,如果无聊就来学习吧! 世上只有一种投资只赚不赔,那就是学习!!! 传智播客于2020年升级了Java学习线路图,硬核升级,免费放送! 学完你就是中级程序员,能更快一步找到工作! 一、Java基础 JavaSE基础是Java中级程序员的起点,是帮助你从小白到懂得编程的必经之路。 在Java基础板块中有6个子模块的学
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
你也能看懂的:蒙特卡罗方法
蒙特卡罗方法,也称统计模拟方法,是1940年代中期由于科学技术的发展和电子计算机的发明,而提出的一种以概率统计理论为指导的数值计算方法。是指使用随机数(或更常见的伪随机数)来解决很多计算问题的方法 蒙特卡罗方法可以粗略地分成两类:一类是所求解的问题本身具有内在的随机性,借助计算机的运算能力可以直接模拟这种随机的过程。另一种类型是所求解问题可以转化为某种随机分布的特征数,比如随机事件出现的概率,或...
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名...
JAVA后端面试《Spring》
Spring1.Spring是什么?有什么好处?2.IOC是什么?有什么好处?具体过程?3.DI是什么?4.IOC和DI的关系?5.bean标签的属性有哪些?6.IOC创建对象有哪几种方式?7.Spring是如何实现IOC的?也就是如何创建对象的? 1.Spring是什么?有什么好处? 概念: SPring是一个支持控制反转(IOC)和面向切面编程(AOP)的容器框架。 好处: 两降低&gt;&...
AI 医生“战疫”在前线
作者| Just出品|CSDN(CSDNnews)紧急驰援疫区,AI医生也出动了。截止到2月6日,随着新冠病毒肺炎疫情的不断发展,全国累计已有31161例确诊病例,26359例疑...
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计...
用Python爬取新型冠状病毒肺炎实时数据,pyecharts v1.x绘制省市区疫情地图
文章目录运行结果(2020-2-8数据)基本方案数据格式全国疫情地图实现福建省疫情地图实现福州市疫情地图实现其他 运行结果(2020-2-8数据) 基本方案 web请求用requests 网页内容解析用pyquery、beautifulsoup和正则表达式 地图用pyecharts v1.6.2 数据来源 全国数据来源于腾讯实时疫情动态,直接get到json 福州市数据来源于福建省疾病预...
MySQL基础笔记
如有错误,恳请告知。非常感谢! 环境(相关下载、配置): phpstudy7.0.9 Apache2.4.39 MySQL5.7.26 phpMyAdmin4.8.5 此文在Windows10下实验并且假设以上环境均准备好。 如何打开安装好的MySQL命令行? 如下图所示。打开phpstudy的安装目录,打开Extensions目录,打开MySQL5.7.26文件,打开bin文件,在上方的路径...
HTML5适合的情人节礼物有纪念日期功能
前言 利用HTML5,css,js实现爱心树 以及 纪念日期的功能 网页有播放音乐功能 以及打字倾诉感情的画面,非常适合情人节送给女朋友 具体的HTML代码 具体只要修改代码里面的男某某和女某某 文字段也可自行修改,还有代码下半部分的JS代码需要修改一下起始日期 注意月份为0~11月 也就是月份需要减一。 当然只有一部分HTML和JS代码不够运行的,文章最下面还附加了完整代码的下载地址 &lt;!...
JVM 调优命令&工具使用
top命令查看进程占用资源情况 jps 命令 查看 java进程 jstack 命令 关注WATTING 查看死锁问题 jstat -gc pid 查看 GC 情况 jinfo pid 查看 jvm 常用信息 arthas [推荐] 安装&amp;启动 使用 jmap 命令 [生产环境慎用! 会造成生产环境卡顿!!!!] 使用jvisualvm 进行查看 d...
相关热词 c# 识别回车 c#生成条形码ean13 c#子控制器调用父控制器 c# 写大文件 c# 浏览pdf c#获取桌面图标的句柄 c# list反射 c# 句柄 进程 c# 倒计时 线程 c# 窗体背景色
立即提问