Remove Transaction Broadcaster navigation hack
MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -169,19 +169,7 @@ public partial class MainViewModel : ViewModelBase
AboutViewModel.RegisterLazy(() => new AboutViewModel());
- BroadcastTransactionViewModel.RegisterAsyncLazy(
- async () =>
- {
- var dialogResult = await DialogScreen.NavigateDialogAsync(new LoadTransactionViewModel(Services.Config.Network));
-
- if (dialogResult.Result is { })
- {
- return new BroadcastTransactionViewModel(Services.Config.Network,
- dialogResult.Result);
- }
-
- return null;
- });
+ BroadcasterViewModel.RegisterLazy(() => new BroadcasterViewModel());
RxApp.MainThreadScheduler.Schedule(async () =>
{

MODIFY
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
@@ -3,24 +3,14 @@ using System.Threading.Tasks;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Transactions;
-using WalletWasabi.Extensions;
using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
-using WalletWasabi.Fluent.Models;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Logging;
namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting;
-[NavigationMetaData(
- Title = "Broadcaster",
- Caption = "Broadcast your transactions here",
- IconName = "live_regular",
- Order = 5,
- Category = "General",
- Keywords = new[] { "Transaction Id", "Input", "Output", "Amount", "Network", "Fee", "Count", "BTC", "Signed", "Paste", "Import", "Broadcast", "Transaction", },
- NavBarPosition = NavBarPosition.None,
- NavigationTarget = NavigationTarget.DialogScreen)]
+[NavigationMetaData(Title = "Broadcast Transaction")]
public partial class BroadcastTransactionViewModel : RoutableViewModel
{
public BroadcastTransactionViewModel(Network network, SmartTransaction transaction)

ADD
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcasterViewModel.cs
+using System.Windows.Input;
+using ReactiveUI;
+using WalletWasabi.Fluent.ViewModels.Navigation;
+
+namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting;
+
+[NavigationMetaData(
+ Title = "Broadcaster",
+ Caption = "Broadcast your transactions here",
+ IconName = "live_regular",
+ Order = 5,
+ Category = "General",
+ Keywords = new[] { "Transaction Id", "Input", "Output", "Amount", "Network", "Fee", "Count", "BTC", "Signed", "Paste", "Import", "Broadcast", "Transaction", },
+ NavBarPosition = NavBarPosition.None,
+ NavigationTarget = NavigationTarget.DialogScreen)]
+public partial class BroadcasterViewModel : TriggerCommandViewModel
+{
+ public override ICommand TargetCommand => ReactiveCommand.CreateFromTask(async () =>
+ {
+ var dialogResult = await MainViewModel.Instance.DialogScreen.NavigateDialogAsync(new LoadTransactionViewModel(Services.Config.Network));
+
+ if (dialogResult.Result is { } transaction)
+ {
+ MainViewModel.Instance.DialogScreen.To(new BroadcastTransactionViewModel(Services.Config.Network, transaction));
+ }
+ });
+}

MODIFY
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
x:DataType="transactionBroadcasting:BroadcastTransactionViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.TransactionBroadcasting.BroadcastTransactionView">
- <c:ContentArea Title="Broadcast Transaction"
+ <c:ContentArea Title="{Binding Title}"
EnableCancel="{Binding EnableCancel}"
EnableBack="{Binding EnableBack}"
EnableNext="True" NextContent="Broadcast"

Remove Transaction Broadcaster navigation hack