使用silverlight构建一个工作流设计器(十)
2009-05-13 12:05:46 来源:WEB开发网这个是一个标准的xaml文件,宽400高300,包含一个名称为LayoutRoot的Grid对象。
SilverlightControl1.xaml.cs文件内容如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace Shareidea.Web.UI.Control.Workflow.Designer
{
public partial class SilverlightControl1 : UserControl
{
public SilverlightControl1()
{
InitializeComponent();
}
}
}
开头的命名空间包含了silverlight常用的命名空间。
需要说明的有以下几点:
l 这个类使用了partial(部分类)的方式声明
l 另一个需要注意的是,构造函数内的InitializeComponent,我们使用vs.net的追踪到这个函数的实现,可以在vs.net中打开一个新的文件,文件名称为SilverlightControl1.g.cs.他的代码如下所示:
#pragma checksum "D:webappAutoFormworkflowShareDesignerShareDesignerSilverlightControl1.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "4F852CC5E0AFC0A2BA980AB6BBB4D9E6"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Automation.Provider;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Resources;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace Shareidea.Web.UI.Control.Workflow.Designer {
public partial class SilverlightControl1 : System.Windows.Controls.UserControl {
internal System.Windows.Controls.Grid LayoutRoot;
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/ShareDesigner;component/SilverlightControl1.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
}
}
}
Tags:使用 silverlight 构建
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接