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

徐州人才网最新招聘安阳网站优化

徐州人才网最新招聘,安阳网站优化,济南软件开发外包公司,在线seo关键词排名优化其实#xff0c;在wpf中#xff0c;最核心的就是xaml#xff0c;因为只有xaml#xff0c;才能体现出用的是wpf#xff0c;而不是普通的cs文件#xff0c;cs文件在winform中等等程序都可以使用的#xff0c;唯独xaml才是wpf中最重要的#xff0c;最精华的东西#xff0…        其实在wpf中最核心的就是xaml因为只有xaml才能体现出用的是wpf而不是普通的cs文件cs文件在winform中等等程序都可以使用的唯独xaml才是wpf中最重要的最精华的东西但是xaml说深也深说浅也浅很多人都是用winform的做法去开发wpf从效果上看没有任何区别的。 今天说一下wpf中的资源其实也属于xaml中的内容万物皆资源。在资源中我们可以插入UC控件以及ViewModel。 1.首先创建一个wpf程序 2. 把UC控件当做资源来使用 2.1首先创建一个UC界面 2.2在App.xaml中把它当做资源 Application x:ClassWpfApp2.Appxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:localclr-namespace:WpfApp2StartupUriMainWindow.xamlApplication.ResourcesResourceDictionarylocal:UserControl1 x:KeyucTest/ResourceDictionary.MergedDictionaries/ResourceDictionary.MergedDictionaries/ResourceDictionary/Application.Resources /Application2.3在主界面直接调用 Window x:ClassWpfApp2.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:WpfApp2mc:IgnorabledTitleMainWindow Height450 Width800GridContentControl Content{StaticResource ucTest} //Grid /Window2.4 效果 此时其实就是把UC控件充当了引用界面的方式效果一毛一样。  3.把ViewModel当做资源来使用 3.1接着上面的代码继续我们采用简单的MVVM模式 建立MainViewModel using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using System.Windows.Data;namespace WpfApp2 {public class MainViewModel : BindingBase{public MainViewModel(){}private string name 故里2130;public string Name{get { return name; }set{name value; OnPropertyChanged();//OnPropertyChanged(nameof(name),使用特性去掉括号的值}}}public class BindingBase : INotifyPropertyChanged{public event PropertyChangedEventHandler PropertyChanged;//protected virtual void OnPropertyChanged(string propertyName)protected virtual void OnPropertyChanged([CallerMemberName] string propertyName )//此处使用特性{PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));}} }3.2在App.xaml中把它当做资源 Application x:ClassWpfApp2.Appxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:localclr-namespace:WpfApp2StartupUriMainWindow.xamlApplication.ResourcesResourceDictionarylocal:UserControl1 x:KeyucTest/local:MainViewModel x:KeyvmTest/ResourceDictionary.MergedDictionaries/ResourceDictionary.MergedDictionaries/ResourceDictionary/Application.Resources /Application3.3然后在界面中调用 Window x:ClassWpfApp2.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:WpfApp2mc:IgnorabledDataContext{StaticResource vmTest}TitleMainWindow Height450 Width800StackPanelTextBlock Text{Binding Name}/ContentControl Content{StaticResource ucTest} //StackPanel /Window3.4效果 然后可以直接绑定属性的值非常的方便不得不说这个功能很nice。 源码 https://download.csdn.net/download/u012563853/88623422 来源 巧妙的使用WPF中的资源-CSDN博客
http://www.hkea.cn/news/14486737/

相关文章:

  • 网络推广SEO优化网站建设免费国外服务器地址
  • 网站建行接口手工小制作
  • 北京做网站比较有名的公司做网站开通手机验证功能
  • wordpress弹网站关键词优化方式
  • php网站开发进程服务器怎么租用
  • 网站建设 海外房产伤豆丁文库网站开发
  • 北京一家专门做会所的网站信息科技公司网站怎么做
  • 作品集的个人网站怎么做阿里云 wordpress cdn
  • 网站设计制作都有哪些信阳网站公司
  • 网站建设学那些课程北京电商网站建设哪家好
  • 青岛房地产网站建设注册公司哪个网站
  • 泊头网站建设的有哪些朋友圈广告推广
  • 东莞免费公司网站建设深圳设计公司深圳设计公司排名
  • 辽宁省建设工程招标协会网站网站程序哪个好
  • 建个公司网站一年多少钱印象笔记同步wordpress
  • 大都会app约大型企业网站优化
  • 二手房网站制作教程wordpress 前台注册登录
  • 北京金方网站设计广告策划书撰写
  • dw做网站有哪些用处检察 网站建设
  • 惠州网站搭建找谁wordpress注册跳过邮箱验证码
  • 可直接进入网站的代码网站导航优化的描述
  • html怎么学百度seo 站长工具
  • 番禺制作网站报价东莞做网站排名优化推广
  • 哪个网站可以做h5页面制作网页app
  • 自助建站代理海外网站的建设
  • 建个公司网站要多少钱网站制作销售术语
  • 商城网站合作协议Wordpress调用百度云
  • 深圳网站定制价格低网站建设哪家公司比较好
  • 太原网站制作哪里便宜联邦快递网站建设的目标
  • 做网站一般都选哪家商城网站开发方案