通过SimpleAction显示一个listview

 1 private void simpleAction1_Execute(object sender, SimpleActionExecuteEventArgs e) {
 2 
 3            IObjectSpace os = Application.CreateObjectSpace();
 4 
 5              string listViewId = Application.FindListViewId(typeof(Contact));
 6 
 7            CollectionSourceBase cs = Application.CreateCollectionSource(os, typeof(Contact), listViewId);
 8 
 9            e.ShowViewParameters.CreatedView = Application.CreateListView( listViewId,cs, true);
10 
11            //Specify various display settings.
12            e.ShowViewParameters.Context = TemplateContext.View;
13            //Determines where to show the ListView;
14            e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
15 
16        }
原文地址:https://www.cnblogs.com/lsr-flying/p/4481683.html