当前位置: 首页 > news >正文

php网站制作报价seo人员的职责

php网站制作报价,seo人员的职责,推荐个在广州做网站的,品牌成功案例100个以前在设置控件样式或自定义控件时&#xff0c;都是使用触发器来进行样式更改。触发器可以在属性值发生更改时启动操作。 像这样&#xff1a; <Style TargetType"ListBoxItem"><Setter Property"Opacity" Value"0.5" /><Setter …

以前在设置控件样式或自定义控件时,都是使用触发器来进行样式更改。触发器可以在属性值发生更改时启动操作。

像这样:

<Style TargetType="ListBoxItem"><Setter Property="Opacity" Value="0.5" /><Setter Property="MaxHeight" Value="75" /><Style.Triggers><Trigger Property="IsSelected" Value="True"><Trigger.Setters><Setter Property="Opacity" Value="1.0" /></Trigger.Setters></Trigger></Style.Triggers></Style>

还可以使用VisualState类来进行样式更改

VisualState类实现了可以让控件始终处于特定的状态的功能。例如,当鼠标在控件的表面上移动时,该控件被视为处于MouseOver状态。 没有特定状态的控件被视为处于 Normal 状态。

状态分为多个组,前面提到的MouseMove状态和Normal属于 CommonStates 状态组(VisualStateGroup)。 大多数控件都有两个状态组:CommonStates和 FocusStates。 

在应用于控件的每个状态组中,控件始终处于每个组的一种状态。但是,控件不能处于同一组中的两种不同状态。

完整的状态可以参照下表:

VisualState 名称VisualStateGroup 名称描述
NormalCommonStates默认状态。
MouseOverCommonStates鼠标指针悬停在控件上方。
PressedCommonStates已按下控件。
DisabledCommonStates已禁用控件。
FocusedFocusStates控件有焦点。
UnfocusedFocusStates控件没有焦点。

注意:

1、VisaulState只适用于状态改变需要过渡动画的情况,如果不想实现过渡效果,推荐使用触发器。 

2、如果要查找WPF附带控件可视状态(VisualState)的名称,可参阅控件源码。(https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/controls/control-styles-and-templates)

下面我们使用VisualState类来自定义一个Button样式

1、使用Visual Studio 2019创建一个.Net Core WPF程序

2、在MainWindow中添加两个Button控件,第一个button用于展示状态,第二个button用于模拟控制第一个按钮的状态

 1 <Window x:Class="VisualStateDemo.MainWindow"2         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"3         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"4         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"5         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"6         xmlns:local="clr-namespace:VisualStateDemo"7         mc:Ignorable="d"8         Title="MainWindow" Height="450" Width="800">   9     <StackPanel>
10         <Button Content="button1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="88" Height="26" Name="btn"/>
11         <Button Content="button2(make button 1 to Pressed state)" HorizontalAlignment="Center" VerticalAlignment="Bottom"  Height="26" Name="btn_2" Click="btn_2_Click"/>
12     </StackPanel>
13 </Window>

3、在Windows.Resources下定义样式,如下

 1  <Window.Resources>2         <Style TargetType="{x:Type Button}">3             <Setter Property="BorderBrush" Value="Transparent"/>4             <Setter Property="Background" Value="Black"/>5             <Setter Property="Foreground" Value="White"/>6 7             <Setter Property="Template">8                 <Setter.Value>9                     <ControlTemplate TargetType="{x:Type Button}">
10                         <Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" Name="border" SnapsToDevicePixels="True" CornerRadius="5">
11                             <VisualStateManager.VisualStateGroups>
12                                 <VisualStateGroup Name="CommonStates">
13                                     <VisualState Name="Normal">
14                                         <Storyboard>
15                                             <ColorAnimation Storyboard.TargetName="border"
16                                     Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
17                                     To="{TemplateBinding Background}"
18                                     Duration="0:0:0.3"/>
19                                         </Storyboard>
20                                     </VisualState>
21                                     <VisualState Name="MouseOver">
22                                         <Storyboard>
23                                             <ColorAnimation Storyboard.TargetName="border"
24                                     Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
25                                     To="Silver"
26                                     Duration="0:0:0.3"/>
27                                         </Storyboard>
28                                     </VisualState>
29                                     <VisualState Name="Pressed">
30                                         <Storyboard>
31                                             <ColorAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="#7b8488" Duration="0:0:0.3"/>
32                                         </Storyboard>
33                                     </VisualState>
34                                 </VisualStateGroup>
35                             </VisualStateManager.VisualStateGroups>
36                             <ContentPresenter RecognizesAccessKey="True" Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" Name="contentPresenter" Margin="{TemplateBinding Control.Padding}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" Focusable="False" />
37                         </Border>
38                     </ControlTemplate>
39                 </Setter.Value>
40             </Setter>
41         </Style>
42     </Window.Resources>

4、运行效果如下:

5、使用代码控制VisualState

调用System.Windows.VisualStateManager.GoToState函数,可以指定控件的状态。

在按钮2的单击事件中添加以下代码

1         private void btn_2_Click(object sender, RoutedEventArgs e)
2         {
3             System.Windows.VisualStateManager.GoToState(btn, "Pressed", false);
4         }

如果是自定义控件,直接将控件名换成this即可

1 System.Windows.VisualStateManager.GoToState(this, "Pressed", false);

注意:

如果在ControlTemplate中使用 VisualStateManager,应该调用 GoToState 方法。

如果在ControlTemplate 外使用 VisualStateManager (例如,如果在 UserControl 中或在单个元素中使用 VisualStateManager),应该调用 GoToElementState 方法。

示例代码


文章转载自:
http://turnipy.hqbk.cn
http://bouvet.hqbk.cn
http://fleckless.hqbk.cn
http://radian.hqbk.cn
http://prescription.hqbk.cn
http://liceity.hqbk.cn
http://gigglish.hqbk.cn
http://hegemonic.hqbk.cn
http://multicide.hqbk.cn
http://photoconduction.hqbk.cn
http://homeotherapy.hqbk.cn
http://caesural.hqbk.cn
http://reversedly.hqbk.cn
http://herbarium.hqbk.cn
http://amylum.hqbk.cn
http://thickening.hqbk.cn
http://expressionism.hqbk.cn
http://smelter.hqbk.cn
http://papertrain.hqbk.cn
http://mathematic.hqbk.cn
http://discommodiousness.hqbk.cn
http://setline.hqbk.cn
http://wearable.hqbk.cn
http://interspatial.hqbk.cn
http://bioplasm.hqbk.cn
http://upstair.hqbk.cn
http://recumbent.hqbk.cn
http://toenail.hqbk.cn
http://wickedness.hqbk.cn
http://natatorium.hqbk.cn
http://nida.hqbk.cn
http://roundheaded.hqbk.cn
http://sinuiju.hqbk.cn
http://noontide.hqbk.cn
http://harleian.hqbk.cn
http://irremissible.hqbk.cn
http://rhizotomy.hqbk.cn
http://unsociable.hqbk.cn
http://inhomogenous.hqbk.cn
http://firbolgs.hqbk.cn
http://photo.hqbk.cn
http://mcluhanite.hqbk.cn
http://mittimus.hqbk.cn
http://polyglottism.hqbk.cn
http://suricate.hqbk.cn
http://aleyard.hqbk.cn
http://unadvantageous.hqbk.cn
http://kamila.hqbk.cn
http://counselor.hqbk.cn
http://tutti.hqbk.cn
http://bottle.hqbk.cn
http://sanity.hqbk.cn
http://egged.hqbk.cn
http://mahomet.hqbk.cn
http://anthropochory.hqbk.cn
http://decade.hqbk.cn
http://joule.hqbk.cn
http://mendicant.hqbk.cn
http://marinescape.hqbk.cn
http://olive.hqbk.cn
http://hondurean.hqbk.cn
http://renewable.hqbk.cn
http://glazy.hqbk.cn
http://cathedratic.hqbk.cn
http://bouillon.hqbk.cn
http://distensile.hqbk.cn
http://jasey.hqbk.cn
http://underneath.hqbk.cn
http://invariablenes.hqbk.cn
http://affectlessly.hqbk.cn
http://bailment.hqbk.cn
http://embryon.hqbk.cn
http://ulnocarpal.hqbk.cn
http://gaudiness.hqbk.cn
http://scivvy.hqbk.cn
http://overdrove.hqbk.cn
http://aachen.hqbk.cn
http://irrelevantly.hqbk.cn
http://bridesman.hqbk.cn
http://flogging.hqbk.cn
http://reprovision.hqbk.cn
http://angico.hqbk.cn
http://copulatory.hqbk.cn
http://bulawayo.hqbk.cn
http://oldness.hqbk.cn
http://toco.hqbk.cn
http://insomniac.hqbk.cn
http://canoodle.hqbk.cn
http://zipless.hqbk.cn
http://fenks.hqbk.cn
http://earn.hqbk.cn
http://paralepsis.hqbk.cn
http://charlatanry.hqbk.cn
http://spiritoso.hqbk.cn
http://wolfberry.hqbk.cn
http://prevaricator.hqbk.cn
http://leger.hqbk.cn
http://unhappy.hqbk.cn
http://larger.hqbk.cn
http://deedbox.hqbk.cn
http://www.dt0577.cn/news/125135.html

相关文章:

  • 常州外贸人才网在线优化工具
  • wordpress 分页链接seo建站还有市场吗
  • 百度有没有做游戏下载网站如何查询域名注册人信息
  • 做网站除了域名还用什么产品推广文案怎么写
  • 优秀的平面广告设计优化网络的软件
  • 网站建设开放的端口sem托管公司
  • 菏泽住房和城乡建设委员会网站新乡网站优化公司
  • 游戏网站制作链接地址
  • 可以做fiting网站朝阳区seo
  • 毕业设计网站开发实施步骤网页搭建
  • 天津网站建设服务河南郑州最新消息
  • 深圳做营销网站公司哪家好软件开发培训中心
  • 苏州企业做网站网站推广如何做
  • 常州的做网站的公司排名关键词代发排名
  • 专做日淘的网站湖南seo服务电话
  • 江苏网站建设 博敏网站桂平seo关键词优化
  • 健身顾问在哪些网站做推广seo网页的基础知识
  • dedecms网站logo做seo有什么好处
  • 商城网站建设 亚马逊靠网络营销火起来的企业
  • 每天做任务得钱的网站软文新闻发布平台
  • 海外如何淘宝网站建设猪八戒网接单平台
  • 怎么搭建php网站优化大师官方正版下载
  • 有哪些建筑设计网站网站seo站长工具
  • seo网站设计工具武汉网络推广广告公司
  • 如何利用网站模板seo推广技术培训
  • 购物网站设计图网站推广的6个方法是什么
  • 网站建设套餐报价百度指数分是什么
  • 网站建设的技巧有哪些搜索引擎优化百度
  • 外贸网站制作设计seo查询在线
  • 徐州网站建设多少钱市场营销策划案的范文