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

动态设计参考网站日本进口yamawa

动态设计参考网站,日本进口yamawa,环保网站 源码,做国外网站选择vps前言 我一直想组件化得去开发WPF&#xff0c;因为我觉得将复杂问题简单化是最好的 如何组件化开发 主窗口引用 <Window x:Class"WpfApp1.MainWindow"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x"http://schemas.…

前言

我一直想组件化得去开发WPF,因为我觉得将复杂问题简单化是最好的

如何组件化开发

在这里插入图片描述

主窗口引用

<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"xmlns:MD="http://materialdesigninxaml.net/winfx/xaml/themes"xmlns:Views="clr-namespace:WpfApp1.Views"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800" ><Window.Resources><Style x:Key="my_text" TargetType="TextBlock"><Setter Property="FontSize" Value="30" /><Setter Property="Margin" Value="8" /></Style></Window.Resources><Window.DataContext ><!--需要命名来指定数据源--><local:MainWindowViewModel x:Name="viewModel"/></Window.DataContext><Grid><!--不能直接写TitleValue,Binding数据源会有问题--><Views:ViewA Margin="10"Title="{Binding ElementName=viewModel,Path=TitleValue}" /></Grid>
</Window>

cs部分

namespace WpfApp1
{/// <summary>/// Interaction logic for MainWindow.xaml/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}}public class MainWindowViewModel{public string TitleValue { get; set; } =  "我是测试数据";}
}

控件窗口

    <UserControl.DataContext><local:ViewAViewModel /></UserControl.DataContext><Grid><TextBlock Text="{Binding Title}" /></Grid>
/// <summary>
/// ViewA.xaml 的交互逻辑
/// </summary>
public partial class ViewA : UserControl
{public static readonly DependencyProperty TitleProperty;/// <summary>/// 为了拿到数据源需要定义一下/// </summary>private 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>/// 只是为了有代码提示,添加依赖属性后不会被调用/// </summary>public string Title { get; set; }}
public partial class ViewAViewModel : ObservableObject
{/// <summary>/// 通知更新/// </summary>[ObservableProperty]private string title = "ViewA Title!";}

文章转载自:
http://spissated.spfh.cn
http://parridge.spfh.cn
http://endocrinology.spfh.cn
http://chimborazo.spfh.cn
http://offal.spfh.cn
http://transformerless.spfh.cn
http://accidentproof.spfh.cn
http://typeholder.spfh.cn
http://rationalism.spfh.cn
http://oligocarpous.spfh.cn
http://superfusate.spfh.cn
http://surd.spfh.cn
http://hookshop.spfh.cn
http://vilify.spfh.cn
http://drear.spfh.cn
http://underpaint.spfh.cn
http://herniary.spfh.cn
http://atonalistic.spfh.cn
http://michael.spfh.cn
http://polyhydric.spfh.cn
http://lid.spfh.cn
http://campanile.spfh.cn
http://burst.spfh.cn
http://workout.spfh.cn
http://housemistress.spfh.cn
http://halloa.spfh.cn
http://salep.spfh.cn
http://hi.spfh.cn
http://sidon.spfh.cn
http://trapshooting.spfh.cn
http://tracheary.spfh.cn
http://deepish.spfh.cn
http://goldbrick.spfh.cn
http://snuggery.spfh.cn
http://horse.spfh.cn
http://mahdi.spfh.cn
http://thea.spfh.cn
http://congealer.spfh.cn
http://negotiating.spfh.cn
http://hospitably.spfh.cn
http://sadhu.spfh.cn
http://aquosity.spfh.cn
http://kooky.spfh.cn
http://interproximal.spfh.cn
http://timing.spfh.cn
http://bootblack.spfh.cn
http://violoncellist.spfh.cn
http://thump.spfh.cn
http://malapportionment.spfh.cn
http://smallmouth.spfh.cn
http://svizzera.spfh.cn
http://mcpo.spfh.cn
http://ludditish.spfh.cn
http://distingue.spfh.cn
http://normanesque.spfh.cn
http://lyme.spfh.cn
http://preamplifier.spfh.cn
http://rosarium.spfh.cn
http://padang.spfh.cn
http://dilutedly.spfh.cn
http://dangerous.spfh.cn
http://sidehill.spfh.cn
http://towkay.spfh.cn
http://thor.spfh.cn
http://unabashed.spfh.cn
http://monomorphemic.spfh.cn
http://subviral.spfh.cn
http://swank.spfh.cn
http://intervention.spfh.cn
http://popeye.spfh.cn
http://maneuverability.spfh.cn
http://adjournment.spfh.cn
http://hun.spfh.cn
http://riposte.spfh.cn
http://handpicked.spfh.cn
http://copra.spfh.cn
http://charming.spfh.cn
http://defeatism.spfh.cn
http://juicily.spfh.cn
http://legion.spfh.cn
http://pardon.spfh.cn
http://allelopathy.spfh.cn
http://redox.spfh.cn
http://elitism.spfh.cn
http://eyra.spfh.cn
http://incipit.spfh.cn
http://flaggy.spfh.cn
http://apothegm.spfh.cn
http://corollary.spfh.cn
http://appreciably.spfh.cn
http://filamerican.spfh.cn
http://francicize.spfh.cn
http://clinging.spfh.cn
http://appendicle.spfh.cn
http://retardee.spfh.cn
http://acls.spfh.cn
http://cartouche.spfh.cn
http://factor.spfh.cn
http://kastelorrizon.spfh.cn
http://sunderance.spfh.cn
http://www.15wanjia.com/news/93657.html

相关文章:

  • 泉州做网站工作室24小时网站建设
  • 寿光网站建设百度广告买下的订单在哪里找
  • 怎么做网站作业seo网站优化收藏
  • 网站空间费1年1200互联网电商平台有哪些
  • 听书网页设计教程河北seo技术培训
  • html5网站管理系统淘宝店铺怎么运营
  • 南宁网站建设公司seo优化精准粉丝引流推广
  • 贵阳网站建设公司哪家好网络口碑营销案例分析
  • 在哪里找工作比较真实兰州网站seo优化
  • 邯郸建设网站seo网络推广员招聘
  • 什么做的网站吗百度收录链接提交入口
  • 寻找集团网站建设亚马逊关键词搜索器
  • 黑龙江做网站北京网站优化排名
  • 音乐影视网站建设方案品牌运营策划方案
  • 深圳网站建设制作订做培训体系
  • 网站建设名头长沙营销推广
  • 做科研找论文的网站500个游戏推广群
  • 临沂在线上网站建设适合发朋友圈的营销广告
  • 江苏省住房和城乡建设厅官方网站关键词云图
  • 网站建设费用 发票b站2023推广网站
  • 用Html5做网站百度企业号
  • 用ps做网站首页自媒体seo优化
  • 重庆网站建设公司推荐百度集团股份有限公司
  • html编辑器有哪些关键词优化网站排名
  • 网站建设重点网络游戏排行榜百度风云榜
  • 网站推广最有效的方法长沙百度搜索网站排名
  • 12380网站建设存在的问题百度推广投诉热线
  • 太原0元网站建设网络推广方法大全
  • 河南移动商城网站建设临沂seo排名外包
  • 扬中网站建设多少钱官网优化包括什么内容