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

电商软件平台开发广告优化师

电商软件平台开发,广告优化师,班级做网站人的叫什么,网站成功上线报道资源 对象级别独立文件 静态资源使用(StaticResource)指的是在程序载入内存时对资源的一次性使用,之后就不再去访问这个资源了。 动态资源使用(DynamicResource)使用指的是在程序运行过程中仍然会去访问资源。 显然,如果你确定…

资源

  1. 对象级别
  2. 独立文件

静态资源使用(StaticResource)指的是在程序载入内存时对资源的一次性使用,之后就不再去访问这个资源了。

动态资源使用(DynamicResource)使用指的是在程序运行过程中仍然会去访问资源。
显然,如果你确定某些资源只在程序初始化的时候使用一次、之后不会再改变,就应该使用StaticResource,而程序运行过程中还有可能改变的资源应该以DynamicResource形式使用。

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

》》》对象级别
在这里插入图片描述
在这里插入图片描述
》》》取消绑定
BindingOperations.ClearBinding(this.控件, ContentControl.ContentProperty);

<Window x:Class="WpfApp1.Window1"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"xmlns:local="clr-namespace:WpfApp1"mc:Ignorable="d"      xmlns:sys="clr-namespace:System;assembly=mscorlib"Title="Window1" Height="450" Width="800"><Window.Resources><sys:String x:Key="st">xxx</sys:String></Window.Resources><Grid>//简写<Button Content="{StaticResource st}"></Button><Button Content="{StaticResource ResourceKey=st}"></Button></Grid>
</Window>

在这里插入图片描述

》》》对立文件,资源字典

在这里插入图片描述

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:sys="clr-namespace:System;assembly=mscorlib"><sys:String x:Key="str">字符</sys:String><sys:Double x:Key="dbl">3.1415926</sys:Double>
</ResourceDictionary>

在这里插入图片描述

<Window x:Class="WpfApp1.MainWindow"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"xmlns:local="clr-namespace:WpfApp1"mc:Ignorable="d"      xmlns:sys="clr-namespace:System;assembly=mscorlib"Title="Window1" Height="450" Width="800"><Window.Resources>//这个可以放在app.xaml  全局生效<ResourceDictionary><ResourceDictionary.MergedDictionaries><ResourceDictionary Source="ZEN_Resource.xaml"></ResourceDictionary></ResourceDictionary.MergedDictionaries></ResourceDictionary></Window.Resources><Grid><Button Style="{StaticResource st}"></Button></Grid>
</Window>
<Application x:Class="WpfApp1.App"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="clr-namespace:WpfApp1"StartupUri="MainWindow.xaml"><Application.Resources><ResourceDictionary><ResourceDictionary.MergedDictionaries><ResourceDictionary Source="ZEN_Resource.xaml"></ResourceDictionary></ResourceDictionary.MergedDictionaries></ResourceDictionary></Application.Resources>
</Application>

》》Resources.resx
在这里插入图片描述
》》》》》》》》 XAML定义了一个扩展标记x:Static来引用静态属性或字段。如:Content=“{x:Static SomeClass:SomeStaticProp}”。通常可以在C#代码中定义静态字段,然后在XAML中进行访问。但是一定要在XAML中引用该类

<Window x:Class="WpfApp1.MainWindow"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"xmlns:local="clr-namespace:WpfApp1"mc:Ignorable="d"      xmlns:sys="clr-namespace:System;assembly=mscorlib"xmlns:prop="clr-namespace:WpfApp1.Properties"Title="Window1" Height="450" Width="800"><Window.Resources></Window.Resources><Grid><Button Content="{x:Static prop:Resources.Info }"></Button></Grid>
</Window>

》》》媒体资源

在这里插入图片描述
在这里插入图片描述

pack url 方法访问二进制资源

》》》
pack://application:,[/程序集名称;,][可选版本号;][文件夹名称/]文件名称
pack://application:, 可省略
其中程序集名称、可选版本号 通常使用缺省值

下面效果一样


等价于后台代码
this.img01.Source= new BitMapImage( new Uri(“Images/xx.png”) ,UriKind.Relative);
this.img01.Source= new BitMapImage( new Uri(“pack://application:,/Images/xx.png”) ,UriKind.Absolute);

》》》pack://application:, 开头表示绝对路径,需要使用Urikind.Absolute
》》》缩写代表相对路径,UriKind必须为Relative,且代表根目录的 / 可以省略

UriKind.RelativeOrAbsolute
UriKind.Relative
UriKind.Absolute

引用命名空间

xmlns:自己起的别名=“clr-namespace:命名空间名称;assembly=程序集名称”

如果不记得命名空间,程序集

在这里插入图片描述

FrameworkElement

FrameworkElement 类 有个属性 Resources
在这里插入图片描述

只要继承FrameworkElement类的控件都有Resources这个属性,这就意味着该控件能在控件标签内定义资源。

在这里插入图片描述
在这里插入图片描述
所以 顶级控件Window,也是有资源的 Window.Resources

自定义资源

在这里插入图片描述
》》后台可以获取资源

//方式1》》
ZEN z = this.FindResource("z") as ZEN;
//方式2》》
ZEN  z =  this.Resources["z"] as ZEN

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述



http://www.dinnco.com/news/681.html

相关文章:

  • 建大型网站公司简介长沙网址seo
  • 西宁网站制作哪家公司好什么是网络营销渠道
  • 建设银行 钓鱼网站软文优化
  • 服装网站建设策划书 百度文库2023年适合小学生的新闻
  • 我的网站 dedecms免费域名注册二级域名
  • 支持货到付款的购物网站如何注册一个自己的网站
  • 教师遭网课入侵直播录屏曝光口谷歌seo快速排名优化方法
  • 网站建设 技术方案seo免费软件
  • 网站优化怎样的东莞网络营销代运营
  • 牵牛建站搜索引擎营销的实现方法
  • 顺通建设集团有限公司 网站好搜seo软件
  • 网站建设 APP开发销售怎么做整合营销传播的明显特征是
  • 加强残联网站建设360优化大师官方官网
  • 做营销型网站需要注意哪些点网络舆情监控
  • 赣州市规划建设局网站改市场监督管理局是干什么的
  • 什么是做自己的网站百度关键词价格怎么查询
  • 江苏网站建设联系方式广告营销策略
  • 设计网站推广方案网络推广营销方式
  • 祥云平台做的网站效果好优化大师官网入口
  • 网络舆情监测机制湖南网站营销seo方案
  • 南京城乡住房建设厅网站北京seo课程
  • 网站做的好不好数据搜了网推广效果怎么样
  • 网站后台文件名武汉竞价托管公司
  • nba排名最新排名日照seo公司
  • 做建材批发的网站单页网站设计
  • 吉安网站建设秦皇岛seo招聘
  • 织梦网站怎么做伪静态页面整站优化包年
  • 网站建设与管理实训心得怎么写seo优化seo外包
  • wordpress 中文手册宁波企业网站seo
  • 做图片网站百度seo关键词排名查询工具