在建造WinForm时须要加上一机关函数和Show办法

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.ExpressApp.Win;
using DevExpress.ExpressApp; namespace WinWjXAF.Module.Win
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form1(XafApplication app, DetailViewActionsObject post) : this() {
// We don""t currently have a singleton reference to the running
// app in Windows Forms -- will be changed.
// It would be possible to make changes to WinApplication.cs and
// a static property manually of course. In this case
// I want to keep changes in a single area for simplicity,
// so I""m taking the app reference as a parameter instead.
using (IObjectSpace os =app.ObjectSpaceProvider.CreateObjectSpace() ){
//app.ObjectSpaceProvider.CreateObjectSpace( )) {
int postCount = os.GetObjectsCount(typeof(DetailViewActionsObject), null); // Of course we can work with the post that has been passed in
//contentLabel.Text =
// String.Format("This post has the title ""{0}"". It""s one of {1} posts.",
// post.Title, postCount);
}
} public static void Show(XafApplication app, DetailViewActionsObject post) {
using (Form1 form = new Form1(app, post)) {
form.ShowDialog( );
}
}
}
} 二、建树ViewController,并在ViewController中添加simpleACtion来浮现它 public partial class CustomFormController : ViewController
{
public CustomFormController()
{
InitializeComponent();
RegisterActions(components);
} private void simpleAction1_Execute(object sender, SimpleActionuteEventArgs e)
{ Form1.Show(Application, (DetailViewActionsObject)e.CurrentObject);
}
}

XAF进修二:在XAF中打开自定义的WinForm的更多相关文章

  1. (二)scrapy 中如何自定义 pipeline 下载图片

    这里以一个很简单的小爬虫为例,爬取 壹心理 网站的阅读页面第一页的所有文章及其对应的图片,文章页面如下: 创建项目 首先新建一个 scrapy 项目,安装好相关依赖(步骤可参考:scrapy 安装及新 ...

  2. 在类库或winform项目中打开另一个winform项目的窗体

    假设类库或winform项目为A,另一个winform项目为B.那麽在A中添加一个接口,里面有一个Show方法,然后在B中写一个类b继承这个接口,并重写这个方法,具体内容为弹出某个窗体.然后在A中另一 ...

  3. Dojo初探之2:设置dojoConfig详解,dojoConfig参数详解+Dojo中预置自定义AMD模块的四种方式(基于dojo1.11.2)

    Dojo中想要加载自定义的AMD模块,需要先设置好这个模块对应的路径,模块的路径就是这个模块的唯一标识符. 一.dojoConfig参数设置详解 var dojoConfig = { baseUrl: ...

  4. php中usort自定义排序如何使用

    php中usort自定义排序如何使用 一.总结 一句话总结:多写一个规则函数,而这个函数的写法和普通函数一样,调用的时候规则函数用函数名的字符串. 1.用户自定义规则函数有哪三个? usort — 使 ...

  5. Expo大作战(十二)--expo中的自定义样式Custom font,以及expo中的路由Route&Navigation

    简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...

  6. 一张图搞定OAuth2.0 在Office应用中打开WPF窗体并且让子窗体显示在Office应用上 彻底关闭Excle进程的几个方法 (七)Net Core项目使用Controller之二

    一张图搞定OAuth2.0   目录 1.引言 2.OAuth2.0是什么 3.OAuth2.0怎么写 回到顶部 1.引言 本篇文章是介绍OAuth2.0中最经典最常用的一种授权模式:授权码模式 非常 ...

  7. PhoneGap + Dreamweaver 5.5 无法在模拟器中打开的问题(二)

    转载:http://blog.csdn.net/dupang/article/details/8248335 按照网上的教程搭建Dreamweaver CS5.5+PhoneGap移动开发环境,在进行 ...

  8. 浏览器中打开IOS应用并传参

    原创文章,转载请注明 开发中遇到这么一个问题,就是动态地指定联接服务器地址,或其它数据.如果是其它数据还好说一些,可以通过在服务器上获得的方式来弄.但如果服务器地址都需要动态指定的话.那就得另想办法了 ...

  9. GridView控件中插入自定义删除按钮并弹出确认框

    GridView控件中插入自定义删除按钮,要实现这个功能其实有多种方法,这里先记下我使用的方法,以后再添加其他方法. 一.实现步骤 1.在GridView中添加模板列(TemplateField). ...

随机推荐

  1. 3.2 ARM指令分类学习

    1 算术移位寄存器和逻辑指令 1.1 mov 传送(Move) Mov {条件} {S} <dest>, <op_1> MOV从另一个寄存器.被移位的寄存器.或者一个立即数装载 ...

  2. 正则表达式regex狂记

    正则.正则..往往在某个不经意间显示其强大的潜能 概念等基础知识不做介绍,直奔规则.格式.实例…… 元字符 描述 \ 将下一个字符标记为一个特殊字符.或一个原义字符.或一个向后引用.或一个八进制转义符 ...

  3. leetcode-【中等题】3. Longest Substring Without Repeating Characters

    题目: Given a string, find the length of the longest substring without repeating characters. Examples: ...

  4. 显示全部select change 异常

    异常信息(异常类型:Genersoft.Platform.Core.Error.GSPException)异常提示:调用方法SelectChange发生异常,详细请看内部异常信息!异常信息:调用方法S ...

  5. docker help

    localhost == 127.0.0.1 == 本机ip ifconfig 或者 ip addr 查看本地宿主机的ip地址 $ docker help Usage: docker [OPTIONS ...

  6. 使用 Wireshark 调试 HTTP/2 流量

    https://imququ.com/post/http2-traffic-in-wireshark.html

  7. leetcode 172

    172. Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!. Note: ...

  8. Foundation ----->NSArray

    .数组的创建     //注意:在OC的数组中,只能够存放对象 //    NSArray *array = [NSArray arrayWithObject:12];错误          //创建 ...

  9. 43、哈工大NLP自然语言处理,LTP4j的测试+还是测试

    1.首先需要构建自然语言处理的LTP的框架 (1)需要下载LTP的源码包即c++程序(https://github.com/HIT-SCIR/ltp)下载完解压缩之后的文件为ltp-master (2 ...

  10. Ubuntu 14.04下搭建 Android 开发环境(1) -JDK安装

    1.下载最新的jdk安装,地址:http://www.oracle.com/technetwork/java/javase/downloads/ 2.解压jdk-8u20-linux-x64.gz,我 ...