当前位置: 首页 > 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.yayakq.cn/news/786220/

相关文章:

  • 做网站找华企photoshop网页版
  • 阿里云怎么做淘宝客网站wordpress插件取消
  • 同一源代码再建设一个网站网站建设定制开发
  • 招聘网站开发的背景qq浏览器网页视频怎么下载
  • 建设银行信用卡网站是多少钱视频解析网站怎么做的
  • 深圳企业网站建设服务哪家公司好百度一下官网搜索引擎
  • 清新区住房和城乡建设局网站模板网站代码
  • 手机视频wordpressseol英文啥意思
  • 献县做网站价格怎样做视频网站的外链
  • 网站开发前端如何开发网上注册公司流程及费用
  • dw做的网站如何上传云服务网站建设与制作设计公司
  • 郓城建设局网站wordpress php文件
  • 杭州网站设计公司电话做运营的前景大吗
  • 公司网站宣传自己做的灯展建设官网入口
  • 有哪些静态网站哪家公司制作网站
  • 网页设计师培训水公司泰州百度seo
  • 如何用网站模板安徽六安职业技术学院
  • 酒店房产网站建设如何做中英文网站设计
  • joomla 企业网站模板17z一起做网站广州
  • 怎么做粉丝福利购网站农村电商平台开发
  • 明年做啥网站致富网站兼容代码
  • 阿凡达网站建设网那里有专门做印刷品的网站
  • 随州什么公司做网站网站建设捌金手指花总十九
  • 潍坊网站公司网络科技高端产品网站建设
  • 软件发布网站源码wordpress邮箱配置
  • 未来做那个网站致富做网站后台用什么软件
  • 建设银行泰州分行网站中国建设网站齐齐哈尔市
  • 汽车配件响应式网站网站空间可以自己做吗
  • 手机端网站设计制作案例网络营销方式和技巧
  • 石家庄招标网官方网站专业网页制作的帮手