Send and Receive buttons inside wallet view header
RENAME
WalletWasabi.Fluent/Styles/ActionButton.axaml
WalletWasabi.Fluent/Styles/Button.axaml
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ <Design.PreviewWith>
+ <Border Padding="20">
+ <!-- Add Controls for Previewer Here -->
+ </Border>
+ </Design.PreviewWith>
+
<Styles.Resources>
<Thickness x:Key="ActionButtonPadding">20,10</Thickness>
</Styles.Resources>
<Style Selector="Button.action:disabled /template/ ContentPresenter">
<Setter Property="Background" Value="{StaticResource ActionButtonDisabledBackgroundColor}" />
</Style>
+
+
+ <Style Selector="Button.plain">
+ <Setter Property="VerticalAlignment" Value="Stretch" />
+ <Setter Property="HorizontalAlignment" Value="Stretch" />
+ <Setter Property="Cursor" Value="Hand" />
+ <Setter Property="Padding" Value="0" />
+ <Setter Property="BorderThickness" Value="0" />
+ </Style>
+
+ <Style Selector="Button.plain /template/ ContentPresenter">
+ <Setter Property="Background" Value="{DynamicResource InvisibleButtonBackgroundColor}" />
+ </Style>
+
+
+ <Style Selector="Button.function">
+ <Setter Property="Padding" Value="14 10" />
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Cursor" Value="Hand" />
+ </Style>
+
+ <Style Selector="Button.function PathIcon">
+ <Setter Property="Foreground" Value="{DynamicResource SystemAccentColor}" />
+ </Style>
</Styles>

DELETE
WalletWasabi.Fluent/Styles/PlainButton.axaml
-<Styles xmlns="https://github.com/avaloniaui">
- <Style Selector="Button.plain">
- <Setter Property="VerticalAlignment" Value="Stretch" />
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="BorderThickness" Value="0" />
- </Style>
- <Style Selector="Button.plain /template/ ContentPresenter">
- <Setter Property="Background" Value="{DynamicResource InvisibleButtonBackgroundColor}" />
- </Style>
-</Styles>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Styles/Styles.axaml
WalletWasabi.Fluent/Styles/Styles.axaml
<FontFamily x:Key="MonospacedFont">avares://WalletWasabi.Fluent/Assets/Fonts/CascadiaCode.ttf</FontFamily>
</Styles.Resources>
- <StyleInclude Source="avares://WalletWasabi.Fluent/Styles/ActionButton.axaml" />
+ <StyleInclude Source="avares://WalletWasabi.Fluent/Styles/Button.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/Checkmark.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/FontSizes.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/IconButton.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/InvisibleButton.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/Label.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/OptionButton.axaml" />
- <StyleInclude Source="avares://WalletWasabi.Fluent/Styles/PlainButton.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/Separator.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/SplitView.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/TextBox.axaml" />

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -106,7 +106,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
WalletViewModelBase vm = (wallet.State <= WalletState.Starting)
? ClosedWalletViewModel.Create(this, wallet)
- : WalletViewModel.Create(uiConfig, wallet);
+ : WalletViewModel.Create(walletManager, _transactionBroadcaster, config, uiConfig, externalHttpClientFactory, wallet);
InsertWallet(vm);
});
@@ -175,7 +175,8 @@ namespace WalletWasabi.Fluent.ViewModels
throw new Exception("Wallet already opened.");
}
- var walletViewModel = WalletViewModel.Create(uiConfig, wallet);
+ var walletViewModel = WalletViewModel.Create(WalletManager, _transactionBroadcaster, _config, uiConfig,
+ _externalHttpClientFactory, wallet);
InsertWallet(walletViewModel);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWallet/HardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWallet/HardwareWalletViewModel.cs
using WalletWasabi.Blockchain.TransactionBroadcasting;
using WalletWasabi.Gui;
using WalletWasabi.Wallets;
+using WalletWasabi.WebClients.Wasabi;
namespace WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet
{
public class HardwareWalletViewModel : WalletViewModel
{
- internal HardwareWalletViewModel(UiConfig uiConfig, Wallet wallet) : base(uiConfig, wallet)
+ internal HardwareWalletViewModel(WalletManager walletManager, TransactionBroadcaster transactionBroadcaster,
+ Config config, UiConfig uiConfig, HttpClientFactory clientFactory, Wallet wallet) : base(walletManager,
+ transactionBroadcaster, config, uiConfig, clientFactory, wallet)
{
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -4,12 +4,17 @@ using System.Collections.Generic;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Windows.Input;
+using WalletWasabi.Blockchain.TransactionBroadcasting;
using WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles;
+using WalletWasabi.Fluent.ViewModels.Wallets.Receive;
+using WalletWasabi.Fluent.ViewModels.Wallets.Send;
using WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet;
using WalletWasabi.Gui;
using WalletWasabi.Wallets;
+using WalletWasabi.WebClients.Wasabi;
namespace WalletWasabi.Fluent.ViewModels.Wallets
{
@@ -17,7 +22,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
[AutoNotify] private IList<TileViewModel> _tiles;
- protected WalletViewModel(UiConfig uiConfig, Wallet wallet) : base(wallet)
+ protected WalletViewModel(WalletManager walletManager, TransactionBroadcaster transactionBroadcaster,
+ Config config, UiConfig uiConfig, HttpClientFactory clientFactory, Wallet wallet) : base(wallet)
{
Disposables = Disposables is null
? new CompositeDisposable()
@@ -71,8 +77,24 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
WalletPieChart,
BalanceChartTile
};
+
+ SendCommand = ReactiveCommand.Create(() =>
+ {
+ Navigate(NavigationTarget.DialogScreen)
+ .To(new SendViewModel(this, transactionBroadcaster, config, uiConfig, clientFactory));
+ });
+
+ ReceiveCommand = ReactiveCommand.Create(() =>
+ {
+ Navigate(NavigationTarget.DialogScreen)
+ .To(new ReceiveViewModel(this, walletManager, wallet.BitcoinStore, uiConfig));
+ });
}
+ public ICommand SendCommand { get; }
+
+ public ICommand ReceiveCommand { get; }
+
private CompositeDisposable Disposables { get; set; }
public override string IconName => "web_asset_regular";
@@ -101,13 +123,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
History.Activate(disposables);
}
- public static WalletViewModel Create(UiConfig uiConfig, Wallet wallet)
+ public static WalletViewModel Create(WalletManager walletManager, TransactionBroadcaster broadcaster,
+ Config config, UiConfig uiConfig, HttpClientFactory httpClientFactory, Wallet wallet)
{
return wallet.KeyManager.IsHardwareWallet
- ? new HardwareWalletViewModel(uiConfig, wallet)
+ ? new HardwareWalletViewModel(walletManager, broadcaster, config, uiConfig, httpClientFactory, wallet)
: wallet.KeyManager.IsWatchOnly
- ? new WatchOnlyWalletViewModel(uiConfig, wallet)
- : new WalletViewModel(uiConfig, wallet);
+ ? new WatchOnlyWalletViewModel(walletManager, broadcaster, config, uiConfig, httpClientFactory,
+ wallet)
+ : new WalletViewModel(walletManager, broadcaster, config, uiConfig, httpClientFactory, wallet);
}
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWallet/WatchOnlyWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWallet/WatchOnlyWalletViewModel.cs
@@ -2,12 +2,15 @@ using WalletWasabi.Blockchain.TransactionBroadcasting;
using WalletWasabi.Gui;
using WalletWasabi.Stores;
using WalletWasabi.Wallets;
+using WalletWasabi.WebClients.Wasabi;
namespace WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet
{
public class WatchOnlyWalletViewModel : WalletViewModel
{
- internal WatchOnlyWalletViewModel(UiConfig uiConfig, Wallet wallet) : base(uiConfig, wallet)
+ internal WatchOnlyWalletViewModel(WalletManager walletManager, TransactionBroadcaster transactionBroadcaster,
+ Config config, UiConfig uiConfig, HttpClientFactory clientFactory, Wallet wallet) : base(walletManager,
+ transactionBroadcaster, config, uiConfig, clientFactory, wallet)
{
}
}

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
</Style>
</Panel.Styles>
<Border Background="{DynamicResource RegionColor}" BoxShadow="{DynamicResource BoxShadow}" IsHitTestVisible="False" />
- <ContentControl Content="{Binding MainScreen.CurrentPage}" Margin="20 36 20 20" />
+ <ContentControl ClipToBounds="False" Content="{Binding MainScreen.CurrentPage}" Margin="20 36 20 20" />
</Panel>
</DockPanel>
</Panel>

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="850"
x:DataType="wallets:WalletViewModel"
x:CompileBindings="True"
+ ClipToBounds="False"
x:Class="WalletWasabi.Fluent.Views.Wallets.WalletView">
- <c:ContentArea Title="{Binding WalletName}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled">
+ <c:ContentArea ScrollViewer.VerticalScrollBarVisibility="Disabled" ClipToBounds="False">
+ <c:ContentArea.Title>
+ <StackPanel Background="#242424">
+ <DockPanel>
+ <TextBlock Text="{Binding WalletName, FallbackValue=My Wallet}" />
+ <StackPanel HorizontalAlignment="Right" Margin="0 -15 0 0" DockPanel.Dock="Right" Orientation="Horizontal" Spacing="10">
+ <Button Classes="function" Command="{Binding SendCommand}">
+ <StackPanel Orientation="Horizontal" Spacing="15">
+ <PathIcon Data="{StaticResource wallet_action_send}" />
+ <TextBlock Text="Send" />
+ </StackPanel>
+ </Button>
+ <Button Classes="function" Command="{Binding ReceiveCommand}">
+ <StackPanel Orientation="Horizontal" Spacing="15">
+ <PathIcon Data="{StaticResource wallet_action_receive}" />
+ <TextBlock Text="Receive" />
+ </StackPanel>
+ </Button>
+ </StackPanel>
+ </DockPanel>
+ <Separator DockPanel.Dock="Bottom" Margin="-200 19 -200 0" HorizontalAlignment="Stretch" Foreground="Red" />
+ </StackPanel>
+
+ </c:ContentArea.Title>
<DockPanel VerticalAlignment="Top">
+
<ScrollViewer Name="ScrollViewer"
DockPanel.Dock="Top"
Width="{Binding #HistoryTable.Bounds.Width}"

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -9,6 +9,7 @@ using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Windows.Input;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
using WalletWasabi.Wallets;

Send and Receive buttons inside wallet view header