diff --git a/PettingZoo/UI/Tab/Publisher/PublisherView.xaml b/PettingZoo/UI/Tab/Publisher/PublisherView.xaml
index 394ed57..7901b69 100644
--- a/PettingZoo/UI/Tab/Publisher/PublisherView.xaml
+++ b/PettingZoo/UI/Tab/Publisher/PublisherView.xaml
@@ -38,13 +38,13 @@
-
+
-
+
-
+
diff --git a/PettingZoo/UI/Tab/Publisher/PublisherViewModel.cs b/PettingZoo/UI/Tab/Publisher/PublisherViewModel.cs
index 595b91e..c71365d 100644
--- a/PettingZoo/UI/Tab/Publisher/PublisherViewModel.cs
+++ b/PettingZoo/UI/Tab/Publisher/PublisherViewModel.cs
@@ -41,7 +41,7 @@ namespace PettingZoo.UI.Tab.Publisher
public bool SendToExchange
{
get => sendToExchange;
- set => SetField(ref sendToExchange, value, otherPropertiesChanged: new[] { nameof(SendToQueue), nameof(ExchangeVisibility), nameof(QueueVisibility) });
+ set => SetField(ref sendToExchange, value, otherPropertiesChanged: new[] { nameof(SendToQueue), nameof(ExchangeVisibility), nameof(QueueVisibility), nameof(Title) });
}
@@ -62,14 +62,14 @@ namespace PettingZoo.UI.Tab.Publisher
public string RoutingKey
{
get => routingKey;
- set => SetField(ref routingKey, value);
+ set => SetField(ref routingKey, value, otherPropertiesChanged: new[] { nameof(Title) });
}
public string Queue
{
get => queue;
- set => SetField(ref queue, value);
+ set => SetField(ref queue, value, otherPropertiesChanged: new[] { nameof(Title) });
}
@@ -138,10 +138,11 @@ namespace PettingZoo.UI.Tab.Publisher
public ICommand PublishCommand => publishCommand;
- // TODO make more dynamic, include entered routing key for example
- #pragma warning disable CA1822 // Mark members as static - can't, it's part of the interface you silly, that would break the build
- public string Title => "Publish";
- #pragma warning restore CA1822
+ public string Title => SendToQueue
+ ? string.IsNullOrWhiteSpace(Queue) ? PublisherViewStrings.TabTitleEmpty : string.Format(PublisherViewStrings.TabTitle, Queue)
+ : string.IsNullOrWhiteSpace(RoutingKey) ? PublisherViewStrings.TabTitleEmpty : string.Format(PublisherViewStrings.TabTitle, RoutingKey);
+
+
public IEnumerable ToolbarCommands => toolbarCommands;
diff --git a/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.Designer.cs b/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.Designer.cs
index 7eef19b..e26fe49 100644
--- a/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.Designer.cs
+++ b/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.Designer.cs
@@ -167,5 +167,23 @@ namespace PettingZoo.UI.Tab.Publisher {
return ResourceManager.GetString("OptionMessageTypeTapeti", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Publish: {0}.
+ ///
+ public static string TabTitle {
+ get {
+ return ResourceManager.GetString("TabTitle", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Publish.
+ ///
+ public static string TabTitleEmpty {
+ get {
+ return ResourceManager.GetString("TabTitleEmpty", resourceCulture);
+ }
+ }
}
}
diff --git a/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.resx b/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.resx
index 79c9b4d..d28e7b3 100644
--- a/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.resx
+++ b/PettingZoo/UI/Tab/Publisher/PublisherViewStrings.resx
@@ -153,4 +153,10 @@
Tapeti message
+
+ Publish: {0}
+
+
+ Publish
+
\ No newline at end of file