<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 之自定义控件(补充)的更多相关文章

  1. 背水一战 Windows 10 (79) - 自定义控件: Layout 系统, 控件模板, 事件处理

    [源码下载] 背水一战 Windows 10 (79) - 自定义控件: Layout 系统, 控件模板, 事件处理 作者:webabcd 介绍背水一战 Windows 10 之 控件(自定义控件) ...

  2. 背水一战 Windows 10 (78) - 自定义控件: 基础知识, 依赖属性, 附加属性

    [源码下载] 背水一战 Windows 10 (78) - 自定义控件: 基础知识, 依赖属性, 附加属性 作者:webabcd 介绍背水一战 Windows 10 之 控件(自定义控件) 自定义控件 ...

  3. Android开发环境搭建(windows OS)之补充

    这几天搭建了个安卓开发环境,也想玩玩安卓开发.在查询CSDN,CNBLOG,视频网站之后终于把开发环境搭建起来了,发现所有的指导都比较离散,比如有些只说安装方法,有些只说下载方法.本文来个集大成,算是 ...

  4. 基于windows平台搭建elasticsearch 补充

    https://www.cnblogs.com/skychen1218/p/8108860.html 参考此大神写的内容,感谢感谢. 不过 好像漏掉了一块内容. 导致出现问题 连接不上的问题.后来修改 ...

  5. C#学习日志 day 5 ------ windows phone 8.1真机调试手机应用

    在vs2013中,可以写windows phone 8.1的程序,但是调试时需要用到windows自带的虚拟机hyper-V 正版的系统开启hyper—V的时候不会有问题,但是盗版的系统可能导致系统不 ...

  6. Windows NT 之父 - David Cutler

    David Cutler,大卫·卡特勒,一位传奇程序员,1988年去微软前号称硅谷最牛的内核开发人员,是VMS和Windows NT的首席设计师,被人们成为“操作系统天神”.他曾供职于杜邦.DEC等公 ...

  7. [转帖]Windows NT 之父 - David Cutler

    Windows NT 之父 - David Cutler https://www.cnblogs.com/wangwust/p/6826200.html 曾经下过 夺路狂奔的电子书 但是还没看完.. ...

  8. 【历史】- Windows NT 之父 - David Cutler

    David Cutler,大卫·卡特勒,一位传奇程序员,1988年去微软前号称硅谷最牛的内核开发人员,是VMS和Windows NT的首席设计师,被人们成为“操作系统天神”.他曾供职于杜邦.DEC等公 ...

  9. c#自定义控件中的事件处理

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; u ...

随机推荐

  1. Bzoj 1227: [SDOI2009]虔诚的墓主人 树状数组,离散化,组合数学

    1227: [SDOI2009]虔诚的墓主人 Time Limit: 5 Sec  Memory Limit: 259 MBSubmit: 895  Solved: 422[Submit][Statu ...

  2. GPU 的硬件基本概念,Cuda和Opencl名词关系对应

    GPU 的硬件基本概念 Nvidia的版本: 实际上在 nVidia 的 GPU 里,最基本的处理单元是所谓的 SP(Streaming Processor),而一颗 nVidia 的 GPU 里,会 ...

  3. linux设置LD_LIBRARY_PATH变量

    在 Linux 下,如果你写好了自己的动态链接库,需要在其它程序里调用,则需要让这些程序能找到这些动态链接库.如果设置不对,会出现类似如下的错误: test: error while loading ...

  4. Sruts2文件上传的ContentType的取值列表

    ".*"="application/octet-stream" ".001"="application/x-001" & ...

  5. Zend Framework 2参考Zend\Authentication(HTTP认证适配器)

    Zend Framework 2参考Zend\Authentication(HTTP认证适配器) 介绍 Zend\Authentication\Adapter\Http提供了RFC-2617, Bas ...

  6. MVC URL处理

     需要web.config在system.webServer节点添加  <modules runAllManagedModulesForAllRequests="true"/ ...

  7. FM笔记

    1.获取生产订单状态 CALL FUNCTION 'STATUS_TEXT_EDIT' EXPORTING client = sy-mandt objnr = p_objnr spras = sy-l ...

  8. 全文索引(三)lucene 分词 Analyzer

    分词: 将reader通过阅读对象Analyzer字处理,得到TokenStream处理流程被称为分割. 该解释可能是太晦涩.查看示例,这个东西是什么感性的认识. 样品:一段文本"this ...

  9. android invalidate 执行流程详解

    invalidate()函数的主要作用是请求View树进行重绘,该函数可以由应用程序调用,或者由系统函数间接 调用,例如setEnable(), setSelected(), setVisiblity ...

  10. SVN工具的使用 和在Eclipse中安装GPD插件:(多步审批流,因此选择使用工作流(JBPM)来实现)

    前言 重点解说SVN工具的还原版本号.   1.提交svn之前.要先更新文件.假设更新之后有版本号冲突的话.就线下解决掉冲突,在把该文件标记为已经解决冲突. 正文 使用SVN还原历史版本号 water ...