Improve DI, use constructor injection

This commit is contained in:
John Lewin 2018-07-12 09:22:28 -07:00
parent 7853d1b612
commit bbabf95c93
52 changed files with 244 additions and 245 deletions

View file

@ -48,9 +48,6 @@ namespace MatterHackers.MatterControl
: base("Close".Localize())
{
this.WindowTitle = "About".Localize() + " " + ApplicationController.Instance.ProductName;
var theme = ApplicationController.Instance.Theme;
this.MinimumSize = new Vector2(480 * GuiWidget.DeviceScale, 520 * GuiWidget.DeviceScale);
this.WindowSize = new Vector2(500 * GuiWidget.DeviceScale, 550 * GuiWidget.DeviceScale);

View file

@ -12,8 +12,6 @@ namespace MatterHackers.MatterControl
public CheckForUpdatesPage()
: base("Close".Localize())
{
var theme = ApplicationController.Instance.Theme;
this.WindowTitle = this.HeaderText = "Check for Update".Localize();
this.Padding = 0;
this.AnchorAll();
@ -113,7 +111,7 @@ namespace MatterHackers.MatterControl
additionalInfoContainer = new FlowLayoutWidget(FlowDirection.TopToBottom)
{
BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor,
BackgroundColor = theme.Colors.SecondaryBackgroundColor,
HAnchor = HAnchor.Stretch,
Padding = new BorderDouble(left: 6, top: 6),
Visible = false

View file

@ -60,10 +60,6 @@ namespace MatterHackers.MatterControl.ContactForm
public ContactFormPage()
{
var theme = ApplicationController.Instance.Theme;
AnchorAll();
this.WindowTitle = "MatterControl : " + "Submit Feedback".Localize();
this.HeaderText = "How can we improve?".Localize();
@ -106,7 +102,7 @@ namespace MatterHackers.MatterControl.ContactForm
{
AutoExpandBoundsToText = true,
Margin = new BorderDouble(0, 5),
TextColor = ActiveTheme.Instance.PrimaryTextColor,
TextColor = theme.Colors.PrimaryTextColor,
HAnchor = HAnchor.Left
};
@ -154,7 +150,7 @@ namespace MatterHackers.MatterControl.ContactForm
labelContainer.AddChild(new TextWidget(labelText, pointSize: fontSize)
{
TextColor = ActiveTheme.Instance.PrimaryTextColor,
TextColor = theme.Colors.PrimaryTextColor,
VAnchor = VAnchor.Bottom,
HAnchor = HAnchor.Left,
Margin = new BorderDouble(bottom: 2)