|
using MVCPassiveModelForWinForms.Models;
using MVCPassiveModelForWinForms.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MVCPassiveModelForWinForms.Controllers
{
public class MobileController
{
private MobileModel Model;
private MobileView View;
public MobileController(MobileModel paramModel, MobileView paramView)
{
Model = paramModel;
View = paramView;
}
public void InitializedConponent(bool ispostback)
{
if(!ispostback)
View.InitializedView(Model);
}
public MobileController()
{
}
public void RequestUpdate(MobileView view)
{
if (Model != null)
{
UpdateModel(view.Battary, view.Sim, view.Charger);
this.NotifyView();
}
}
public void UpdateModel(int paramBattary, int paramSim, int paramCharger)
{
Model.Battary += paramBattary;
Model.Sim += paramSim;
Model.Charger += paramCharger;
}
public void NotifyView()
{
View.Update(Model);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am in Software Development for more than 12 years. I am expert on Microsoft Platform for Web Forms, MVC, MVC Core, Web API, Desktop App, PHP etc. I am also expert on jQuery, AngularJS, Bootstrap, Font Awesome, Telerik UI, Kendo UI etc. I know BackboneJS, KnockoutJS also. I am an article writer. I have many articles in CodeProject.
Email: khademulbasher@gmail.com