![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MVVM
文章平均质量分 56
weixin_44540482
这个作者很懒,什么都没留下…
展开
-
点击结账.
.Xaml中:给上一个按钮.Cs中结账命令public RelayCommand ButtonClickCommand { get; set; }/// 3.3 普通结账/// /// 当前窗口private void ButtonClick(Window window){if (MessageBox.Show(“是否结账?”, “系统提示”, MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.原创 2021-07-16 08:40:58 · 89 阅读 · 0 评论 -
点击开台.
//鼠标按下判断开台private void GridMouseDown(){string statu = dataTable.Rows[0][“Status”].ToString();//获取餐桌状态int people = Convert.ToInt32(dataTable.Rows[0][“People”].ToString());//餐桌容纳人数int tabletypeID = Convert.ToInt32(dataTable.Rows[0][“TableTypeID”].ToStri原创 2021-07-14 20:36:01 · 92 阅读 · 0 评论 -
鼠标移入显示时间
.Xaml中写上鼠标移入事件(命令)+显示的时间(属性)<i:Interaction.Triggers><i:EventTrigger EventName=“MouseEnter”><i:InvokeCommandAction Command="{Binding MouseEnterCommand}"/></i:EventTrigger></i:Interaction.Triggers><TextBlock FontSize原创 2021-06-26 09:12:42 · 281 阅读 · 0 评论 -
选择图片.
先在.Xaml中给到一个Border用于存放,还有一个浏览图片的按钮。来到.Cs中,声明一下图片属性、浏览命令以及全局变量和接收的临时数据public BitmapImage _caseCoverImage; public BitmapImage CaseCoverImage { get { return _caseCoverImage; } set { if (_c原创 2021-06-16 08:25:49 · 89 阅读 · 0 评论 -
数据对应状态
“数据库:要用的的那张表中要有状态的字段”.Xaml页面: .Cs页面:将Text Block中的命令写到.Cs属性(没有的话自己加就完事了(#region那一套))中:别忘记+上实例化数据模型//临时表DataTable dataTable;//全局公共静态变量public static WrapPanel WP;public static Button BtnPH;public static Button BtnInsert;public static UserControl UC原创 2021-06-06 16:00:10 · 63 阅读 · 0 评论 -
刷新当前页面
在.Xaml里面给个刷新按钮:<Button Height=“35” Width=“55” Content=“刷新” Command="{Binding RefreshCommand}" fontSize:“12px”>记得不要忘记给命令指令Command,还有.Xaml里的查看代码里面需要有对应的.cs页面this.DataContext = new ViewModel.cs页面在.cs类里面写上刷新命令public ICommand RefreshCommand { get; se原创 2021-05-25 08:53:43 · 180 阅读 · 0 评论 -
点击确认提交数据
.Xaml:首先给他一个表头,名字给个自己写的。里面的内容:记得要在下面给一个操作按钮,别忘记给Command:<Button Content=“确 认” Height=“31” Width=“72” Margin=“0,0,65,0” Command="{Binding SaveCommand}" CommandParameter="{Binding ElementName=WAddTable}".Cs:属性:给个bool值private bool _isAdd = false;给原创 2021-05-16 08:56:01 · 324 阅读 · 1 评论 -
MVVM多表查询
多表查询在.xaml里面放个加载事件.cs:实例化一下数据 ManagementEntities myModel = new ManagementEntities();属性里面:到下边给个命令 public ICommand LoadedCommand { set; get; }上代码:随便给个名称,连数据库主表,关联一下外表,再用两个名称点出主表与外表共同的ID,后边给个倒序排序,最后给个返回值:VIPVos = viplist.ToList();select new 后面是自己给的一个原创 2021-05-01 09:33:02 · 102 阅读 · 0 评论