多页数据绑定检索和更新 [英] Multipage Data Binding Retrieve and Update

查看:57
本文介绍了多页数据绑定检索和更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WPF的新手,在我使用Winform之前,只熟悉VB.Net.

Hi, I am new to WPF and before I used Winform and familiar only with VB.Net.

我的问题很简单,您对调用过程的建议是什么,以便在多个页面中检索和保存数据库.使用Winform时,我只需使用MDI父级-子级和加载"和保存"菜单按钮 每个MDI-子代将自动与父代合并.因此,点击加载和保存"菜单后,将加载或保存为每个指定的MDI子级(页面)使用强类型数据集I.实际上我有 每个MDI子级上的加载/保存"按钮.

My question is pretty simple, what is your suggestion to call procedure for retrieving and saving database in multiple pages. When using Winform, I simply use MDI Parent - Child and the "Load" and "Saving" menu button for each MDI - Child will automatically merge with the Parent. So the Load and Saving Menu, when clicked, will load or save  the strongly typed dataset I use for each of the specified MDI Child (page). Practically I have the Load/Save button on each of the MDI Child.

在WPF中,当菜单位于主Windows上时,我使用Page代替MDI Child的角色.我的问题是如何加载/保存特定的数据集当我单击主窗口上的加载/保存按钮"菜单时,显示每个页面的内容.

In WPF I use Page to replace the role of the MDI Child, while the menu is on the Main Windows. My Problem is how to load/save the specific dataset  of each page while I click the Load/Save Button menu lying on the Main Windows.

多谢您的帮助.

推荐答案

我也使用VB,但我有一些问题要问您.

I too use VB but I have some questions for you.

1.  在Winforms应用程序中,您可以同时查看多个窗口这一事实很重要吗?

1.  In the winforms app is the fact that you can view more than one window at the same time important?

2.  您知道如何使用WPF数据绑定吗?

2.  Do you know how to use WPF databinding?

我问这些是因为从winforms转换为WPF并不是一件小事.  在学习WPF时,我学到了很难的方法,即试图复制Winforms只会导致性能不佳的应用程序花费与创建Winforms版本一样多的时间.

I ask those because converting from winforms to WPF is not a trivial thing.  I learned the hard way when I was learning WPF that trying to replicate winforms just resulted in a poorly performing app that took as much time as creating the winforms version.

我非常建议您保留数据例程(保存和加载),其余部分都保留下来.

I would very much suggest that you keep the data routines (save and load) and pretty much turf the rest.

WPF的整个前提是您需要处理三种类型的对象.  一个是您的数据,两个是您的数据上下文,第三个是UI.  第一个通常称为模型,其中包含从您所在的任何数据存储中检索到的信息 使用.  第二个称为ViewModel,是将数据与UI结合在一起的粘合剂.  第三个是UI,并且是在XAML中定义的.

The whole premise of WPF is that you have three types of objects to deal with.  One is your data, two your datacontext and third is UI.  The first is usually called the Model and contains the information retrieved from whatever datastore you are using.  The second is called the ViewModel and is the glue that joins the data with the UI.  The third is the UI and is defined in XAML.



这篇关于多页数据绑定检索和更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆