1
0
mirror of https://github.com/ikoHSE/KDZ1.git synced 2024-11-24 09:35:55 +03:00
KDZ1/Frequencies/MainForm.cs

42 lines
997 B
C#
Raw Permalink Normal View History

2018-04-08 14:33:55 +03:00
using System.Windows.Forms;
using System.Collections.Generic;
using System.Drawing;
namespace Frequencies {
public class MainForm: Form {
public MainForm(): base() {
Text = "Frequencies";
MinimumSize = new System.Drawing.Size(750, 500);
DoubleBuffered = true;
Layout += (_, __) => {
currentView?.Layout(ClientSize);
};
BackColor = Color.White;
}
private View currentView;
public void Present(View view) {
currentView = view;
Controls.Clear();
Controls.AddRange(view.controlsArray);
Invalidate();
Refresh();
}
}
abstract public class View {
protected List<Control> controls = new List<Control>();
public Control[] controlsArray {
get {
return controls.ToArray();
}
}
abstract public void Layout(Size rect);
}
}