Index: Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml =================================================================== diff -u -ra5a3c17b09c5cc24e5cfa6d986182fb213bc4cbf -r369400e3add949c344017f34f89620f095eac05a --- Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml (.../MainWindow.xaml) (revision a5a3c17b09c5cc24e5cfa6d986182fb213bc4cbf) +++ Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml (.../MainWindow.xaml) (revision 369400e3add949c344017f34f89620f095eac05a) @@ -106,38 +106,18 @@ - + - - - - - - - - - - - - Index: Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -rd6b7ed144b128f034c3a8d18671e42aae9eacc3e -r369400e3add949c344017f34f89620f095eac05a --- Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision d6b7ed144b128f034c3a8d18671e42aae9eacc3e) +++ Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 369400e3add949c344017f34f89620f095eac05a) @@ -25,6 +25,8 @@ using System.IO; using System.Linq; using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; using System.Windows.Input; using System.Windows.Interop; using System.Windows.Media.Imaging; @@ -223,6 +225,26 @@ } } + /// + /// Adds a state button to the . + /// + /// The text of the button. + /// The symbol of the button. + public void AddStateButton(string text, string symbol) + { + MainButtonStackPanel.Children.Insert(MainButtonStackPanel.Children.Count - 1, + new ToggleButton + { + Tag = text, + Style = (Style) FindResource("MainButtonBarToggleButtonStyle"), + Content = new TextBlock + { + Style = (Style) FindResource("ButtonLargeIconStyle"), + Text = symbol + } + }); + } + public void Dispose() { Dispose(true); Index: Core/Gui/src/Core.Gui/GuiCore.cs =================================================================== diff -u -r614fb898c6cd2bb529e713623ae56c8a67b1cae9 -r369400e3add949c344017f34f89620f095eac05a --- Core/Gui/src/Core.Gui/GuiCore.cs (.../GuiCore.cs) (revision 614fb898c6cd2bb529e713623ae56c8a67b1cae9) +++ Core/Gui/src/Core.Gui/GuiCore.cs (.../GuiCore.cs) (revision 369400e3add949c344017f34f89620f095eac05a) @@ -490,6 +490,11 @@ mainWindow.InitializeToolWindows(); + foreach (StateInfo stateInfo in Plugins.SelectMany(p => p.GetStateInfos())) + { + mainWindow.AddStateButton(stateInfo.Name, stateInfo.Symbol); + } + mainWindow.SubscribeToGui(); UpdateTitle(); Index: Core/Gui/src/Core.Gui/Plugin/StateInfo.cs =================================================================== diff -u -r419dd49f7777c795062212c60890eca33bc21653 -r369400e3add949c344017f34f89620f095eac05a --- Core/Gui/src/Core.Gui/Plugin/StateInfo.cs (.../StateInfo.cs) (revision 419dd49f7777c795062212c60890eca33bc21653) +++ Core/Gui/src/Core.Gui/Plugin/StateInfo.cs (.../StateInfo.cs) (revision 369400e3add949c344017f34f89620f095eac05a) @@ -32,16 +32,23 @@ /// /// Creates a new instance of . /// + /// The name of the state. /// The symbol of the state. /// The method for obtaining the root data of the state. /// Thrown when is null. - public StateInfo(string symbol, Func getRootData) + public StateInfo(string name, string symbol, Func getRootData) { + Name = name; Symbol = symbol; GetRootData = getRootData ?? throw new ArgumentNullException(nameof(getRootData)); } /// + /// Gets the name of the state. + /// + public string Name { get; } + + /// /// Gets the symbol of the state. /// public string Symbol { get; } Index: Core/Gui/test/Core.Gui.Test/Plugin/StateInfoTest.cs =================================================================== diff -u -r419dd49f7777c795062212c60890eca33bc21653 -r369400e3add949c344017f34f89620f095eac05a --- Core/Gui/test/Core.Gui.Test/Plugin/StateInfoTest.cs (.../StateInfoTest.cs) (revision 419dd49f7777c795062212c60890eca33bc21653) +++ Core/Gui/test/Core.Gui.Test/Plugin/StateInfoTest.cs (.../StateInfoTest.cs) (revision 369400e3add949c344017f34f89620f095eac05a) @@ -33,13 +33,15 @@ public void Constructor_ExpectedValues() { // Setup + const string name = "Name"; const string symbol = "Symbol"; Func getRootData = o => new object(); // Call - var stateInfo = new StateInfo(symbol, getRootData); + var stateInfo = new StateInfo(name, symbol, getRootData); // Assert + Assert.AreEqual(name, stateInfo.Name); Assert.AreEqual(symbol, stateInfo.Symbol); Assert.AreSame(getRootData, stateInfo.GetRootData); } @@ -48,7 +50,7 @@ public void Constructor_GetRootDataNull_ThrowsArgumentNullException() { // Call - void Call() => new StateInfo(string.Empty, null); + void Call() => new StateInfo(string.Empty, string.Empty, null); // Assert var exception = Assert.Throws(Call); Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r970b1abe2c10e56e6885525db8b0927c2d4d72ef -r369400e3add949c344017f34f89620f095eac05a --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 970b1abe2c10e56e6885525db8b0927c2d4d72ef) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 369400e3add949c344017f34f89620f095eac05a) @@ -276,43 +276,43 @@ public override IEnumerable GetStateInfos() { - yield return new StateInfo("A", project => + yield return new StateInfo("Traject", "\uE94E", project => { if (project is RiskeerProject riskeerProject) { return riskeerProject.AssessmentSections.FirstOrDefault(); } - + return project; }); - - yield return new StateInfo("B", project => + + yield return new StateInfo("Faalpaden", "\uE953", project => { if (project is RiskeerProject riskeerProject) { return riskeerProject.AssessmentSections.FirstOrDefault(); } - + return project; }); - yield return new StateInfo("C", project => + yield return new StateInfo("Berekeningen", "\uE91D", project => { if (project is RiskeerProject riskeerProject) { return riskeerProject.AssessmentSections.FirstOrDefault(); } - + return project; }); - yield return new StateInfo("D", project => + yield return new StateInfo("Assembleren", "\uE94B", project => { if (project is RiskeerProject riskeerProject) { return riskeerProject.AssessmentSections.FirstOrDefault(); } - + return project; }); }