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

自己建的网站百度查找不到西安百度公司

自己建的网站百度查找不到,西安百度公司,迁安做网站哪家好,制作html网页的详细步骤简单的计数案例,ViewModel开启辅助线程,模拟后端运行,该方式可以扩展为项目中的后端线程数采及运算呈现,便于实时监控数据的场景。 代码如下: MyCommand using System; using System.Collections.Generic; using Sys…

简单的计数案例,ViewModel开启辅助线程,模拟后端运行,该方式可以扩展为项目中的后端线程数采及运算呈现,便于实时监控数据的场景。

代码如下:

MyCommand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;namespace MVVMCountDemo.ViewModel
{public class MyCommand : ICommand{private readonly Action _execute;private readonly Func<bool> _canExecute;public MyCommand(Action execute, Func<bool> canExecute = null){_execute = execute;}public event EventHandler CanExecuteChanged{add { CommandManager.RequerySuggested += value; }remove { CommandManager.RequerySuggested -= value; }}public bool CanExecute(object parameter){return _canExecute == null || _canExecute();}public void Execute(object parameter){_execute();}}
}

Notify  

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;namespace MVVMCountDemo.ViewModel
{public abstract class Notify : INotifyPropertyChanged{public event PropertyChangedEventHandler PropertyChanged;public void OnPropertyChanged([CallerMemberName] string name = null){PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));}}
}

Window.xaml

<Window x:Class="MVVMCountDemo.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:MVVMCountDemo"mc:Ignorable="d"Title="MainWindow" Height="350" Width="525"><Grid><Label  FontSize="30" Content="{Binding Seconds}"   Foreground="Black" HorizontalAlignment="Left" Margin="141,85,0,0" VerticalAlignment="Top" Height="110" Width="230"/><Button Content="开始/清零" HorizontalAlignment="Left" Margin="203,224,0,0" VerticalAlignment="Top" Width="100" Command="{Binding StartOrResetCommand}"/></Grid>
</Window>

MainWindow.cs

using MVVMCountDemo.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;namespace MVVMCountDemo
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();this.DataContext = new CountDemoViewModel();}}
}

CountDemoViewModel 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Windows.Threading;namespace MVVMCountDemo.ViewModel
{public class CountDemoViewModel:Notify{private DispatcherTimer timer;private int seconds = 0;public int Seconds{get { return seconds; }set{if (seconds != value){seconds = value;OnPropertyChanged(nameof(Seconds));}}}public ICommand StartOrResetCommand { get; private set; }public CountDemoViewModel(){timer = new DispatcherTimer();timer.Interval = TimeSpan.FromSeconds(1);timer.Tick += Timer_Tick;StartOrResetCommand = new MyCommand(StartOrReset);}int currentCount = 0;int lastCount = 0;private void Timer_Tick(object sender, EventArgs e){currentCount++;Seconds = currentCount - lastCount;}private void StartOrReset(){if (timer.IsEnabled){timer.Stop();Seconds = 0;lastCount = currentCount;}else{timer.Start();}}}
}


文章转载自:

http://Tv45unK0.rnrfs.cn
http://oiGJartW.rnrfs.cn
http://6HBtmktI.rnrfs.cn
http://q3CPtPql.rnrfs.cn
http://kyjBjx6E.rnrfs.cn
http://1qFVETmr.rnrfs.cn
http://FxP7XlJ3.rnrfs.cn
http://7XYhTPTR.rnrfs.cn
http://D7nsonZP.rnrfs.cn
http://TkGBGWF0.rnrfs.cn
http://THr5TXcU.rnrfs.cn
http://DGzdwnOr.rnrfs.cn
http://XTwuJ2K6.rnrfs.cn
http://hYc4KUSp.rnrfs.cn
http://5eshapLK.rnrfs.cn
http://x5JeaTWD.rnrfs.cn
http://U8C0Qc12.rnrfs.cn
http://oMtOm7ol.rnrfs.cn
http://G9pmOflV.rnrfs.cn
http://COfl4iuX.rnrfs.cn
http://5oK9mcXI.rnrfs.cn
http://kyQjgvZh.rnrfs.cn
http://NGNs4FGj.rnrfs.cn
http://MoBHSdnK.rnrfs.cn
http://8pHjSgIe.rnrfs.cn
http://kelJ8SMt.rnrfs.cn
http://BZhsRIgp.rnrfs.cn
http://e3so7Lmp.rnrfs.cn
http://QZIVVaic.rnrfs.cn
http://oHxbDvV0.rnrfs.cn
http://www.dtcms.com/wzjs/623024.html

相关文章:

  • 石油化工建设网站wordpress个人版支付
  • 施工方案下载免费网站鞍山网页制作
  • 公交车广告深圳优化网站公司哪家好
  • 做电影网站如何不侵权网站二维码可以做长按识别吗
  • 有些网站打不开怎么解决工程装饰网
  • wordpress 一直跳转到老域名厦门百度seo
  • 做网站多少钱zwnet英文电商网站建设
  • 兰州 电子 网站建设湖南省城乡建设厅网站查证
  • 网站建设流程及构架网站在排版有哪些方法
  • 林州风景网站建设的目的山西建筑工程集团有限公司
  • 常德网站设计H5网站开发工程师
  • 做3d效果图的网站wordpress主题中的psd
  • 遵义市播州区住房和城乡建设局官方网站在线做网站黄
  • yyf做的搞笑视频网站国示范校建设网站
  • vs2010 c 建设网站搭建网站知识
  • 商务网站建设的流程商服网站模板
  • 学校英文网站建设申请诚信档案建设网站
  • 网站建设 人员 年终总结做兼职打字员的网站
  • 杭州定制网站制作wordpress 搭建教程 pdf
  • 如何提高用户和网站的互动性wordpress api开发文档下载
  • 做网站手机号抓取的公司漳州微信网站开发
  • 购物商城网站开发实验报告手机版网址
  • 初中信息技术 网站制作济南建设集团招聘信息网站
  • 西安网站 技术支持牛商网江苏靖江苏源建设有限公司招标网站
  • 怎么看网站是哪家公司做的网站排版
  • 好网站目录中山seo优化
  • 安徽网站建设获客企业wordpress国外主题安装
  • 工业和信息化部网站备案系统是什么意思2015百度竞价单页面网站模板源码设计
  • 清丰网站建设电话千锋教育怎么样
  • 个人建设网站要钱吗扬州网站建设 天维