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 ...
随机推荐
- 【转】【opencv】仿射变换
仿射变换 目标 在这个教程中你将学习到如何: 使用OpenCV函数 warpAffine 来实现一些简单的重映射. 使用OpenCV函数 getRotationMatrix2D 来获得一个 旋转矩阵 ...
- [置顶] shell变量赋值-linux
Shell变量赋值 命名须规则: 1)使用变量无需事先声明 2)首个字符必须为字母(a-z,A-Z) 3)中间不能有空格,可以使用下划线(_) 4)不能使用标点符号 5)不能使用bash里的关键字(可 ...
- Js- 菜单
很简单的JS二级菜单显示,收藏 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht ...
- MVC传递Model之TempData、ViewData、ViewBag差别及用途
MVC使用过程中常常会用到TempData.ViewData.ViewBag三种方式,这三种什么差别呢? TempData:默认存储于Session中,可通过继承ITempDataProvider接口 ...
- 从零开始学android开发-创建第一个android项目
打开ADT开发工具
- java中使用队列:java.util.Queue
在java5中新添加了java.util.Queue接口,用以支持队列的常见操作.该接口扩展了java.util.Collection接口.Queue使用时要尽量避免Collection的add()和 ...
- 《细说 new与 malloc 的 10 点区别》
http://www.jobbole.com/members/melonstreet/
- java的一些程序
1.文件读取并打印 import java.io.*;public class readandprint{//*********Found********public static void main ...
- Linux学习笔记总结--CentOS 设置静态IP
1.修改网卡配置 vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 #描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth ...
- HDU2029JAVA
Palindromes _easy version Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Jav ...