public MainWindow()
{
font = new Font(Font.FontFamily, 20);
// Initialise form controls.
InitializeComponent();
//txtX.Minimum = 0;
//txtY.Minimum = 0;
//sets tooltips for buttons
var tooltip = new ToolTip();
tooltip.SetToolTip(btnAddFile, "Creates a new blank html for the editor");
tooltip.SetToolTip(btnPreview, "Displays the QR code linked to the currently selected file");
tooltip.SetToolTip(btnRemoveFile, "Deletes the selected file from the editor");
tooltip.SetToolTip(btnPrintPreview, "Displays the print preview of the QR codes");
mapBox.ZoomChanged += MapZoomChanged;
mapBox.MapCoordinateChanged += MapCoordinateChanged;
// Event binding.
tsbImage.Click += btnImage_Click;
tsbAudio.Click += btnAudio_Click;
tsbBold.Click += btnBold_Click;
tsbItalics.Click += btnItalics_Click;
btnPreview.Click += btnPreview_Click;
printToolStripMenuItem.Click += btnPrintPreview_Click;
exitToolStripMenuItem.Click += exitToolStripMenuItem_Click;
listViewContents.SelectedIndexChanged += listViewContents_SelectedIndexChanged;
Load += MainWindow_Load;
// Initialise HTMLEditor.
HTMLEditor.Navigate("about:blank");
Debug.Assert(HTMLEditor.Document != null, "HTMLEditor.Document != null");
HtmlDocument htmlDocument = HTMLEditor.Document.OpenNew(false);
Debug.Assert(htmlDocument != null, "htmlDocument != null");
htmlDocument.Write("<html><body></body></html>");
var doc = HTMLEditor.Document.DomDocument as IHTMLDocument2;
Debug.Assert(doc != null, "doc != null");
doc.designMode = "on";
HTMLEditor.Navigating += HTMLEditor_Navigating;
// Initialise MVP objects.
_model = new BaconModel();
_controller = new MainViewController(_model, this);
}