什么是使用WPF,WCF,PRISM的更好方法(What is the better way to use WPF,WCF,PRISM)
我正在开发一个EMR应用程序作为我的项目。 我使用WCF从集中式服务器传输所有数据,WPF用于UI,PRISM用于构建模块。
我在WPF / PRISM应用程序的解决方案中有3个项目
- shell和bootsrapper所在的Main项目(mainApplication)。
- 用于保存所有模块的类库(modulesLib)
- 与wcf服务通信的类库(基础结构)(在visual studio 2008中使用scvutil.exe添加的服务引用)
项目参考添加如下
- mainApplication引用了'modulesLib'和'infrastructure'
- modulesLib对“基础设施”有所依据
我目前的程序如下
- 使用Windows服务公开了6个wcf服务(6个主机)
- wcf服务实现(查询,字段,表)中的硬编码数据库详细信息
- 使用viewmodels / presenters直接调用WCF服务(通过基础结构库)。
- 创建的类称为抽象ViewModelBase(实现INotifyPropertyChanged,也有IUnityContainer,IRegionManager,IEventAggregator引用),抽象ModuleBase(实现IModule),每当我添加一个viewmodel或模块时,我都会使用这两个类继承
- 我将所有数据绑定属性放入viewmodel并使用viewmodel的构造函数来实例化给定视图,设置其数据上下文并将其添加到shell中的某个区域
- 项目清单
每当我想在模块之间进行通信时,我都使用CompositePresentationEvents
我想知道什么
- 我是否做过这样的事情,对你们来说似乎没问题。
- 仍然存在大量错误,崩溃等等。我可以有一个地方来处理这些异常,因此应用程序不会中断(日志记录或类似的东西)
- 使用WPF,WCF,MSSQL和PRISM处理项目的方法是什么?
谢谢,Nadun
I'm developing an EMR Application as my project. there Im using WCF to transfer all the data from the centralized server , WPF for the UI and PRISM to build modules.
I have 3 projects in my solution for WPF/PRISM application
- The Main project(mainApplication) where the shell and bootsrapper are.
- Class library(modulesLib) to hold all the modules
- Class library(infrastructure) to communicate with wcf service ( service reference added with scvutil.exe in visual studio 2008)
project references are added as below
- mainApplication have references of 'modulesLib' and 'infrastructure'
- modulesLib have refence to 'infrastructure'
my current procedure is below
- There are 6 wcf services (6 hosts) exposed using a windows service
- hard coded database details inside wcf service implementations (queries, fields, tables)
- calling the WCF services directly withing viewmodels/ presenters for modules (through infrastructure library).
- Created classes called abstract ViewModelBase (which implements INotifyPropertyChanged , also having IUnityContainer,IRegionManager,IEventAggregator references) , abstract ModuleBase (which implements IModule) and I use these 2 classes to inherit from whenever I add a viewmodel or a module
- I put all the databinding properties in to viewmodel and use the viewmodel's constructor to instantiate a given view, set its data context and add it to a region in the shell
- List item
whenever I want to communicate between modules, I use CompositePresentationEvents
what I would like to know
- whether the way i have done things, is it seems OK for you guys .
- Still there are loads of errors, crashing bugs etc.. can I have a single place to handle these exceptions so the application wont break (logging or something like that)
- what would be your way to working on a project using WPF,WCF,MSSQL and PRISM
thank you, Nadun
原文:https://stackoverflow.com/questions/3502470
最满意答案
您可以使用
onShowHideCol
回调或"jqGridShowHideCol"
事件在showCol
或hideCol
之后showCol
某些操作。 例如,您可以使用var resizeGrid = function () { grid.jqGrid("setGridWidth", grid.closest(".ui-jqgrid").parent().width()); }; // resize the grid on showing/hiding columns grid.bind("jqGridShowHideCol", function () { resizeGrid(); }); // resize the grid on resizing the window $(window).bind("resize", function () { resizeGrid(); });
You can use
onShowHideCol
callback or"jqGridShowHideCol"
event to make some action aftershowCol
orhideCol
. For example you can usevar resizeGrid = function () { grid.jqGrid("setGridWidth", grid.closest(".ui-jqgrid").parent().width()); }; // resize the grid on showing/hiding columns grid.bind("jqGridShowHideCol", function () { resizeGrid(); }); // resize the grid on resizing the window $(window).bind("resize", function () { resizeGrid(); });
See the answer and this one for code examples about resizing the grid on resizing the window. See the demo and this one.
相关问答
更多-
自定义网格在WPF网格中调整大小(Custom grid resize in WPF grid)[2023-09-17]
您可以尝试使用GridSplitter 。 我假设您有一个Grid布局,如下所示:// This is where the button lives -
resize是一个选项,而不是一个方法,所以你应该这样做: grid.masonry({ resize: false }); 希望能帮助到你。 resize is an option, not a method, so you should do it like this: grid.masonry({ resize: false }); Hope it helps.
-
发布OnResize事件,该事件在TControl默认受保护。 在自己的后代中,您不应该使用事件本身,而是使用触发事件的方法。 这样做将使组件的用户有机会实现自己的事件处理程序。 覆盖Resize方法: type TMyGrid = class(TStringGrid) protected procedure Resize; override; published property OnResize; end; { TMyGrid } procedure TMyGrid. ...
-
FreeJqGrid:如何在.show()事件后调整整个网格的大小(FreeJqGrid : How to resize the whole grid after a .show() event)[2023-05-09]
您可以使用onShowHideCol回调或"jqGridShowHideCol"事件在 showCol或hideCol 之后 showCol某些操作。 例如,您可以使用 var resizeGrid = function () { grid.jqGrid("setGridWidth", grid.closest(".ui-jqgrid").parent().width()); }; // resize the grid on showing/hiding columns grid. ... -
好吧,我刚刚发现问题的来源:“fullcalendar.print.css”覆盖了基本的“fullcalendar.css”,并在“display:none”中设置了调整大小句柄。所以擦除print css后,它就可以了。 谢谢阅读。 OK, I just found where the problem comes from : The "fullcalendar.print.css" overrides the basic "fullcalendar.css" and sets the resizing ...
-
调整大小事件之前(Before after resize event)[2023-06-11]
没有你可以听到的调整结束事件这样的事情。 要知道用户完成调整大小的唯一方法是等待一段时间过去,而不再发生任何调整大小事件。 这就是为什么这个解决方案几乎总是涉及到使用setTimeout()因为这是知道一段时间已经过去而没有更多大小调整事件的最佳方式。 我以前的回答是监听.scroll()事件,但它与.resize()完全相同: 在jquery中处理$(window).scroll函数的更有效方法是? 你可以像这样使用相同的概念来调整大小: var resizeTimer; $(window).resize ... -
$scope.gridOptions.$gridServices.DomUtilityService.RebuildGrid( $scope.gridOptions.$gridScope, $scope.gridOptions.ngGrid ); 我使用此代码重建网格,它解决了我的问题。 感谢大家的重播。 $scope.gridOptions.$gridServices.DomUtilityService.RebuildGrid( ...
-
调整大小时的网格问题(Grid problems on resize)[2023-02-13]
你最好的选择可能是玩背景位置,背景大小和物体适合物体位置css。 Internet Explorer不支持对象适合/对象位置,但如果设置此项,则不会进行拉伸,但要使图像按照您希望的方式定位,您必须使用用户对象位置来单独定位它们: .secreto2 img { width:100%; height:100%; object-fit:cover; object-position:50%; } 同时从.secreto2:中移除绝对定位,否则在悬停时拧紧。 http://jsfi ... -
jqGrid - 列调整大小事件(jqGrid - column resize event)[2023-02-08]
啊,发现了问题。 代码是正确的,但我已经下载了一个没有启用jQuery UI插件的jqGrid版本。 我修复了它,但下载了完整版的jqGrid。 Ah, found the problem. The code was correct, but I had downloaded a version of jqGrid without jQuery UI addons enabled. I fixed it but downloading the complete version of jqGrid. -
停止重新调整列大小后,将触发columnResize函数。 您可以在初始化期间在网格配置中设置此项,如下所示: resizable: true, columnResize: function(e) { console.log(e.column.field, e.newWidth, e.oldWidth); } 或者,在网格初始化后绑定到事件: function grid_columnResize(e) { console.log(e.column.field, e.newWidth, ...