Files
MVPLearning/MVPLearning/TestingArea/ViewProperties/ViewPropertiesPresenter.cs
2024-04-01 22:21:02 -04:00

27 lines
680 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MVPLearning.TestingArea.ViewProperties
{
internal class ViewPropertiesPresenter
{
private readonly ViewPropertiesView _view;
public ViewPropertiesPresenter(ViewPropertiesView view)
{
_view = view;
_view.ButtonClick += ButtonClick;
_view.LoadData(new() { FirstName = "Mary" });
if (_view is Form form) { form.Show(); }
}
private void ButtonClick(object? sender, string e)
{
_view.LoadData(new() { FirstName = e });
}
}
}