상속: INotifyPropertyChanged
    public ActionResult YourView(int id)
    {
        var model = new YourModel();
        var image = db.GetImage(id);

        model.Id       = id;
        model.ImageB64 = String.Format("data:image/png;base64,{0}", Convert.ToBase64String(image));
    }
예제 #2
0
 //---- sign up for events
 public void Subscribe(YourModel model)
 {
     model.evtDataChanged += new YourModel.DataChangedDelegate(DataChangedHandler);
 }
 public YourViewModel(YourModel model)
 {
     this.model              = model;
     this.model.OnItemAdded += item => this.foldersToScan.Add(item);
 }
예제 #4
0
    public ActionResult PostMethod()
    {
        YourModel model = new YourModel();

        return(View(model));
    }
예제 #5
0
 public ActionResult PostMethod(YourModel model)
 {
     //Do something with model.MyText;
     System.Threading.Thread.Sleep(5000);
     return(Json("And We're Done"));
 }
예제 #6
0
 public ActionResult Submit(YourModel model)
 {
     var csvData = model.Table.ToCsv();     // assuming you have this method already since it's in your code above
     // Do something with the data and return a view
 }
예제 #7
0
    public void GetChart()
    {
        YourModel model = new YourModel();

        _view.ChartControl = model.GenerateChart();
    }
    public ViewResult Index()
    {
        YourModel model = db.LoadData();

        return(View(model));
    }