WEB开发网
开发学院图形图像Flash Silverlight 3 Beta 新特性解析(7)- Child Wind... 阅读

Silverlight 3 Beta 新特性解析(7)- Child Window和Shader Effect篇

 2009-04-02 12:01:34 来源:WEB开发网   
核心提示: 而ContactWin.xaml.cs为:privatePersonDomainContext_personContext=newPersonDomainContext();publicContactWin(intcontactID){InitializeComponent();_pers

而ContactWin.xaml.cs为:

private PersonDomainContext _personContext = new PersonDomainContext();

 

public ContactWin(int contactID)

{

  InitializeComponent();

 

  _personContext.Loaded += (sender, e2) =>

  {

    if (_personContext.Contacts.Count > 0)

      this.ContactForm.CurrentItem = _personContext.Contacts[0];

  };

  _personContext.LoadContactByContactID(contactID);

}

修改EmployeePage.xaml.cs代码如下:

private void ViewContactButton_Click(object sender, RoutedEventArgs e)

{

  Employee employee = this.EmployeeGrid.SelectedItem as Employee;

  if (employee != null)

  {

    ContactWin contactWin = new ContactWin(employee.ContactID);

 

    contactWin.Show();

    //this.NavigationService.Navigate(new Uri(String.Format("ContactID={0}", employee.ContactID), UriKind.Relative));

  }

}

启动工程后得到如下的效果图:

Silverlight 3 Beta 新特性解析(7)- Child Window和Shader Effect篇

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Silverlight 特性

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接