Windows phone 7中的图像控件、资源和样式
来源:互联网 发布:沈阳网络营销黑马网络 编辑:程序博客网 时间:2024/06/05 08:23
图像控件:Image,如果在C#代码中动态更改Image的Source,那么会用到BitmapImage类,把BitmapImage赋值给Image.Source。
资源:是Silverlight中任何可重用的值。
FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}"
这种设置属性的样式叫做绑定语法。
但是在项目中又找不到PhoneFontFamilyNormal这样的资源,这是因为在WP7设备本身已经有了嵌入的资源文件。
比如要设置一个button的边框为静态资源,只需要
<Button Content="OK" Margin="40" BorderBrush="{StaticResource PhoneAccentBrush}" />
在VS中自己创建样式,比如要为一个button设置前景色,点击button的property,找到Foreground,先设置好前景色,再如图
如果要自己创建样式,比如自己设置button的style,需要加入一下代码
<phone:PhoneApplicationPage.Resources><Style x:Key="buttonStyle" TargetType="Button"> <Setter Property="BorderBrush" Value="Red" /> <Setter Property="Foreground" Value="Red" /> </Style></phone:PhoneApplicationPage.Resources>在button中需要写入Style="{StaticResource buttonStyle}"
如果想把Style设置成全局的,那么把<Style x:Key="buttonStyle" TargetType="Button"> <Setter Property="BorderBrush" Value="Red" /> <Setter Property="Foreground" Value="Red" /> </Style>
加入到App.xaml的<Application.Resources> </Application.Resources>
标签中
- Windows phone 7中的图像控件、资源和样式
- Windows Phone开发(16):样式和控件模板
- Windows Phone开发(16):样式和控件模板
- Windows Phone 7开发工具和资源
- Windows Phone 7 开发工具和资源
- Windows phone 7中的输入控件
- Windows Phone 7 资源汇总
- Windows Phone 7 资源汇总
- Windows Phone 8.1中的FlipView控件
- Windows Phone 7核心控件Panorama和Pivot
- Windows Phone 7 WebBrowser 控件乱码和相对地址解析
- Windows Phone 7框架、控件和开源项目
- Windows Phone 7框架、控件和开源项目
- Windows phone 7之样式与模板
- 解决在Windows Phone中的WebBrowser控件中的zoom和ScrollViewer滑动冲突
- Windows Phone开发学习之九——图像控件
- Windows Phone 7常用资源大集合
- Windows Phone 7常用资源大集合
- 谈谈对于企业级系统架构的理解
- Lazy Load(1.7.0)中文文档 -- 延迟加载图片的jQuery插件
- Sicily 4481. Prime Factorization
- 2-10 Android Button监听事件的四种方法(三)
- 【Ubuntu手记】Ubuntu11.10下安装Chrome浏览器
- Windows phone 7中的图像控件、资源和样式
- J2EE(02) struts-config.xml 配置说明
- Sicily 4697. Common Subsequence
- Animations的使用(三)
- 有关 Conversion to Dalvik format failed with error 1
- Sicily 4699. 简单哈希
- ubuntu 虚拟机网络设置
- Sicily 4700. 小明与奶牛
- 图像处理基本算法 Hough变换