Windows phone 之自定义控件(补充)
<UserControl
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"
mc:Ignorable="d"
x:Class="Weather.CityTile"
d:DesignWidth="184"
d:DesignHeight="105">
<UserControl.Resources>
<Style x:Key="ButtonStyle1" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="LayoutRoot" Background="Transparent" RenderTransformOrigin="0.5,0.5">
<!--变形的中心位置-->
<Grid.RenderTransform>
<CompositeTransform/>
</Grid.RenderTransform>
<VisualStateManager.VisualStateGroups>
<!--管理器类型.状态组-->
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<!--视觉过渡转换,设置单个的状态组里不同状态切换时的动画效果-->
<VisualTransition GeneratedDuration="0:0:1" To="Pressed">
<VisualTransition.GeneratedEasingFunction>
<BackEase EasingMode="EaseOut"/>
</VisualTransition.GeneratedEasingFunction>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:1" To="Normal">
<VisualTransition.GeneratedEasingFunction>
<BackEase EasingMode="EaseOut"/>
</VisualTransition.GeneratedEasingFunction>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:1" To="MouseOver">
<VisualTransition.GeneratedEasingFunction>
<BackEase EasingMode="EaseOut"/>
</VisualTransition.GeneratedEasingFunction>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Disabled"/>
<!--设置单个的状态的动画效果-->
<VisualState x:Name="Normal"/>
<!--设置单个的状态的动画效果-->
<VisualState x:Name="MouseOver"/>
<!--设置单个的状态的动画效果-->
<VisualState x:Name="Pressed">
<!--设置单个的状态的动画效果-->
<Storyboard>
<DoubleAnimation Duration="0"
To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).
(CompositeTransform.ScaleX)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True"/>
<DoubleAnimation
Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).
(CompositeTransform.ScaleY)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Image Source="/Weather;component/UserControl/base.png" Stretch="Fill"/>
<Image Margin="90,-14,0,32" Source="{Binding cityWeatherIcon}"/>
<TextBlock Text="{Binding cityTemperature}" FontSize="20" Width="100" Margin="8,8,8,8" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"/>
<ContentPresenter HorizontalAlignment="Left" Height="40" Margin="8,8,0,0" VerticalAlignment="Top"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="FontSize" Value="26"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</UserControl.Resources>
<!--<Button Name="cityName" Content="" Style="{StaticResource ButtonStyle1}"/>-->
</UserControl>
Windows phone 之自定义控件(补充)的更多相关文章
- 背水一战 Windows 10 (79) - 自定义控件: Layout 系统, 控件模板, 事件处理
[源码下载] 背水一战 Windows 10 (79) - 自定义控件: Layout 系统, 控件模板, 事件处理 作者:webabcd 介绍背水一战 Windows 10 之 控件(自定义控件) ...
- 背水一战 Windows 10 (78) - 自定义控件: 基础知识, 依赖属性, 附加属性
[源码下载] 背水一战 Windows 10 (78) - 自定义控件: 基础知识, 依赖属性, 附加属性 作者:webabcd 介绍背水一战 Windows 10 之 控件(自定义控件) 自定义控件 ...
- Android开发环境搭建(windows OS)之补充
这几天搭建了个安卓开发环境,也想玩玩安卓开发.在查询CSDN,CNBLOG,视频网站之后终于把开发环境搭建起来了,发现所有的指导都比较离散,比如有些只说安装方法,有些只说下载方法.本文来个集大成,算是 ...
- 基于windows平台搭建elasticsearch 补充
https://www.cnblogs.com/skychen1218/p/8108860.html 参考此大神写的内容,感谢感谢. 不过 好像漏掉了一块内容. 导致出现问题 连接不上的问题.后来修改 ...
- C#学习日志 day 5 ------ windows phone 8.1真机调试手机应用
在vs2013中,可以写windows phone 8.1的程序,但是调试时需要用到windows自带的虚拟机hyper-V 正版的系统开启hyper—V的时候不会有问题,但是盗版的系统可能导致系统不 ...
- Windows NT 之父 - David Cutler
David Cutler,大卫·卡特勒,一位传奇程序员,1988年去微软前号称硅谷最牛的内核开发人员,是VMS和Windows NT的首席设计师,被人们成为“操作系统天神”.他曾供职于杜邦.DEC等公 ...
- [转帖]Windows NT 之父 - David Cutler
Windows NT 之父 - David Cutler https://www.cnblogs.com/wangwust/p/6826200.html 曾经下过 夺路狂奔的电子书 但是还没看完.. ...
- 【历史】- Windows NT 之父 - David Cutler
David Cutler,大卫·卡特勒,一位传奇程序员,1988年去微软前号称硅谷最牛的内核开发人员,是VMS和Windows NT的首席设计师,被人们成为“操作系统天神”.他曾供职于杜邦.DEC等公 ...
- c#自定义控件中的事件处理
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; u ...
随机推荐
- PHP中使用函数array_merge()合并数组
如果明白数组其实就是map的话,我想你就会明白array_merge为什么要这么实现了 PHP中合并数组分成两种情况 1.如果这两个数组中有相同的字符串键名: <?php header('Con ...
- oc学习之路-----搞死指针之内存存储int类型
关于每个数据类型个字节在内存中的存储地址(以int为例) 先上图 如题,为什么说好的*p = &c是1啊,为什么是513呢,一开始,我也觉得挺惊讶的,后面听老师分析了一下才知道怎么回事,但是还 ...
- 线程同步 synchronized 同步代码块 同步方法 同步锁
一 同步代码块 1.为了解决并发操作可能造成的异常,java的多线程支持引入了同步监视器来解决这个问题,使用同步监视器的通用方法就是同步代码块.其语法如下: synchronized(obj){ // ...
- return 和 exit
此篇文不会阐述具体的原理,而是只记录实际应用如何避免一些问题 在<C语言程序设计-现代方法>第9.5章节中有这样一段说明, return语句和exit函数之间的差异是:不管哪个函数调用ex ...
- 解决IE11不能进行webTest脚本录制的方法
当win7的ie8升级到ie11后,我的vs2012里的web性能测试用不了了,在打开IE11后,录制栏不见了,在网上找了很多资料没有结果,最后,在IE工具里发展了原因 工具->管理加载项-&g ...
- oninput,onpropertychange,onchange的用法和区别
1.前言 由于工作需要,需实现一个类似于微博输入框的功能,在用户动态输入文字的时候,修改提示“您还可以输入XX字”.如下图所示: 因此,稍微研究了一下oninput,onpropertychange, ...
- 理解position 绝对定位和相对定位
一.position的三种取值 1.取值 Position : static / absolute / fixed / relative static:静态 absolute:绝对定位 ...
- 检测到有潜在危险的Request.Form值
由于在.net中,Request时出现有HTML或Javascript等字符串时,系统会认为是危险性值.立马报出“从客户端 中检测到有潜在危险的Request.Form值”这样的错. 用encodeU ...
- 报错:System.Data.Entity.Infrastructure.DbUpdateException 更新条目时出错
背景 往数据库添加数据,前端验证通过的情况下,提交报错,程序停在了SaveChanges()这行,并报如上错误. 分析 猜想是提交的领域模型不符合数据库要求,但不知道具体哪里出错.网上查资料,有人发现 ...
- [Webpack 2] Chunking common modules from multiple apps with the Webpack CommonsChunkPlugin
If you have a multi-page application (as opposed to a single page app), you’re likely sharing module ...