易简.道(ething)

爱在进行时
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

MVC-REST-SilverLight 之MainPage.xaml.cs

Posted on 2012-02-21 21:09  如是如是  阅读(146)  评论(0编辑  收藏  举报

using System.Windows;

using System.Windows.Controls;

using RestClient.ViewModels;

 

namespace RestClient

{

public partial class MainPage : UserControl

{

MainViewModel _vm;

 

public MainPage()

{

InitializeComponent();

 

_vm = new MainViewModel();

DataContext = _vm;

 

_vm.LoadCustomers();

}

 

private void UpdateButton_Click(

object sender, RoutedEventArgs e)

{

_vm.UpdateSelectedCustomer();

}

 

private void DeleteButton_Click(

object sender, RoutedEventArgs e)

{

_vm.DeleteSelectedCustomer();

}

 

private void AddNewButton_Click(

object sender, RoutedEventArgs e)

{

_vm.AddNewLocalCustomer();

}

}

}