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

做装饰公司网站6深圳室内设计工作室排名

做装饰公司网站6,深圳室内设计工作室排名,石家庄网站运营,南通网站建设排名公司前言 我一直想组件化得去开发WPF#xff0c;因为我觉得将复杂问题简单化是最好的 如何组件化开发 主窗口引用 Window x:ClassWpfApp1.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.…前言 我一直想组件化得去开发WPF因为我觉得将复杂问题简单化是最好的 如何组件化开发 主窗口引用 Window x:ClassWpfApp1.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:WpfApp1xmlns:MDhttp://materialdesigninxaml.net/winfx/xaml/themesxmlns:Viewsclr-namespace:WpfApp1.Viewsmc:IgnorabledTitleMainWindow Height450 Width800 Window.ResourcesStyle x:Keymy_text TargetTypeTextBlockSetter PropertyFontSize Value30 /Setter PropertyMargin Value8 //Style/Window.ResourcesWindow.DataContext !--需要命名来指定数据源--local:MainWindowViewModel x:NameviewModel//Window.DataContextGrid!--不能直接写TitleValueBinding数据源会有问题--Views:ViewA Margin10Title{Binding ElementNameviewModel,PathTitleValue} //Grid /Window cs部分 namespace WpfApp1 {/// summary/// Interaction logic for MainWindow.xaml/// /summarypublic partial class MainWindow : Window{public MainWindow(){InitializeComponent();}}public class MainWindowViewModel{public string TitleValue { get; set; } 我是测试数据;} }控件窗口 UserControl.DataContextlocal:ViewAViewModel //UserControl.DataContextGridTextBlock Text{Binding Title} //Grid/// summary /// ViewA.xaml 的交互逻辑 /// /summary public partial class ViewA : UserControl {public static readonly DependencyProperty TitleProperty;/// summary/// 为了拿到数据源需要定义一下/// /summaryprivate ViewAViewModel ViewModel new ViewAViewModel();public ViewA(){InitializeComponent();ViewModel (ViewAViewModel)DataContext;}static ViewA(){//静态构造TitleProperty DependencyProperty.Register(Title, typeof(string), typeof(ViewA),new PropertyMetadata(,new PropertyChangedCallback((item, res) {//拿到数据再次赋值var model (ViewA)item;model.ViewModel.Title (string)res.NewValue;})));}/// summary/// 只是为了有代码提示添加依赖属性后不会被调用/// /summarypublic string Title { get; set; }} public partial class ViewAViewModel : ObservableObject {/// summary/// 通知更新/// /summary[ObservableProperty]private string title ViewA Title!;}
http://www.yingshimen.cn/news/43538/

相关文章:

  • vps服务器怎么创建多个网站做音乐网站的目的
  • 江苏省建设厅官网网站蚌埠网站优化
  • 镇江营销型建站公叿wordpress 汽车模板
  • 做书封面的模板下载网站石家庄建设学校
  • 商业网站首页怎么做校园网的典型网络拓扑结构
  • wp企业网站模板拓者设计吧手机版
  • 专业建材网站建设哪个网站可以做照片分享
  • 爬取漫画数据做网站wordpress 积分购买
  • 泉州哪里做网站wordpress导航站主题
  • 网站建设常用的工具汕头品牌设计公司
  • 唐山中小企业网站制作网络推广是做什么工作的
  • 电商网站构建预算方案公司网站维护怎么维护
  • 成都制作网站提供商口碑营销案例简短
  • app软件免费模板下载网站在线做数据图的网站有哪些问题
  • 做站长建不好网站网站建设是固定资产嘛
  • 网站开发环境有什么做微商卖产品在哪个网站销量能好点
  • 网站建设的目标及功能定位公司品牌推广公司
  • 做海淘网站赚钱吗wordpress 缺少样式表
  • 大兴网站建设费用响应式网站建站平台
  • 十大免费游戏网站点开即玩乡镇卫生院网站建设模板
  • 住房城乡建设部官网站wordpress 高级搜索
  • 电商站点是什么意思网站账户上的余额分录怎么做
  • 网站建设仟金手指专业12网络营销策划方案书范文
  • 建设局网站公示的规划意味着什么注册安全工程师考试科目
  • 网站开发建设公司做网站的基本步骤
  • 专业网站设计开发网站个人做的网站可以收款
  • 毕业设计网站设计说明书惠州网站建设 骏域网站建设
  • 做seo为什么要了解网站建造师信息查询网
  • 网络网站建设广州科技公司取名大全
  • Wordpress怎么配合HTML北京网站优化网