use ContentArea
MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/CreateWallet/RecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/CreateWallet/RecoveryWordsViewModel.cs
@@ -13,14 +13,14 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.CreateWallet
{
private List<RecoveryWord> _mnemonicWords;
- public RecoveryWordsViewModel(IScreen screen)
+ public RecoveryWordsViewModel(IScreen screen, Blockchain.Keys.KeyManager km, NBitcoin.Mnemonic mnemonic)
{
HostScreen = screen;
MnemonicWords = new List<RecoveryWord>();
- for (int i = 0; i < 12; i++)
+ for (int i = 0; i < mnemonic.Words.Length; i++)
{
- MnemonicWords.Add(new RecoveryWord(i + 1,"Nothing"));
+ MnemonicWords.Add(new RecoveryWord(i + 1, mnemonic.Words[i]));
}
ContinueCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new ConfirmRecoveryWordsViewModel(HostScreen, MnemonicWords)));

MODIFY
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
@@ -9,6 +9,8 @@ using Avalonia;
using Avalonia.Markup.Xaml.Styling;
using WalletWasabi.Fluent.ViewModels.Dialogs.CreateWallet;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Gui;
+using Splat;
namespace WalletWasabi.Fluent.ViewModels
{
@@ -23,12 +25,13 @@ namespace WalletWasabi.Fluent.ViewModels
NextCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new HomePageViewModel(screen)));
CreateWalletCommand = ReactiveCommand.Create(() =>
{
- //var walletGenerator = new WalletGenerator(Global.WalletManager.WalletDirectories.WalletsDir, Global.Network);
- //walletGenerator.TipHeight = Global.BitcoinStore.SmartHeaderChain.TipHeight;
- //var (km, mnemonic) = walletGenerator.GenerateWallet(WalletName, Password);
- //new GenerateWalletSuccessViewModel(Owner, km, mnemonic);
+ var global = Locator.Current.GetService<Global>();
- screen.Router.Navigate.Execute(new RecoveryWordsViewModel(screen));
+ var walletGenerator = new WalletGenerator(global.WalletManager.WalletDirectories.WalletsDir, global.Network);
+ walletGenerator.TipHeight = global.BitcoinStore.SmartHeaderChain.TipHeight;
+ var (km, mnemonic) = walletGenerator.GenerateWallet("TestWallet", "12345");
+
+ screen.Router.Navigate.Execute(new RecoveryWordsViewModel(screen, km, mnemonic));
});
OpenDialogCommand = ReactiveCommand.Create(async () =>
@@ -41,13 +44,13 @@ namespace WalletWasabi.Fluent.ViewModels
{
var currentTheme = Application.Current.Styles.Select(x => (StyleInclude)x).FirstOrDefault(x => x.Source is { } && x.Source.AbsolutePath.Contains("Themes"));
- if (currentTheme?.Source is { })
+ if (currentTheme?.Source is { } src)
{
var themeIndex = Application.Current.Styles.IndexOf(currentTheme);
var newTheme = new StyleInclude(new Uri("avares://WalletWasabi.Fluent/App.xaml"))
{
- Source = new Uri($"avares://WalletWasabi.Fluent/Styles/Themes/{(currentTheme.Source.AbsolutePath.Contains("Light") ? "BaseDark" : "BaseLight")}.xaml")
+ Source = new Uri($"avares://WalletWasabi.Fluent/Styles/Themes/{(src.AbsolutePath.Contains("Light") ? "BaseDark" : "BaseLight")}.xaml")
};
Application.Current.Styles[themeIndex] = newTheme;

MODIFY
WalletWasabi.Fluent/Views/Dialogs/CreateWallet/ConfirmRecoveryWordsView.axaml
WalletWasabi.Fluent/Views/Dialogs/CreateWallet/ConfirmRecoveryWordsView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors;assembly=WalletWasabi.Fluent"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d"
d:DesignWidth="600" d:DesignHeight="500"
Width="600" Height="500"
x:Class="WalletWasabi.Fluent.Views.Dialogs.CreateWallet.ConfirmRecoveryWordsView">
- <Panel Margin="25 35 25 20">
+ <Panel Margin="25 0 25 20">
- <Button Classes="invisible" Command="{Binding GoBackCommand}" DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Button Classes="invisible" Margin="0 35 0 0" Command="{Binding GoBackCommand}" DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Top">
<PathIcon Data="{StaticResource arrow_left_regular}" />
</Button>
- <StackPanel Margin="64 0 64 0">
- <TextBlock Text="Confirm recovery words" FontSize="20" DockPanel.Dock="Top" FontWeight="SemiBold"/>
- <TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" FontSize="12" Margin="0 10 0 0" Opacity="0.6"
- Text="Type the required recovery words" />
-
- <ItemsControl Items="{Binding ConfirmationWords}" VerticalAlignment="Center" >
+ <c:ContentArea Title="Confirm recovery words" Caption="Type the required recovery words"
+ Margin="44 0 44 0">
+ <ItemsControl Items="{Binding ConfirmationWords}">
<ItemsControl.ItemTemplate>
<DataTemplate>
- <StackPanel>
- <TextBlock Text="{Binding Index, StringFormat=Recovery word {0}}" Margin="0 20 0 8"/>
+ <StackPanel Margin="0 0 0 24">
+ <TextBlock Text="{Binding Index, StringFormat=Recovery word {0}}" Margin="0 0 0 8"/>
<StackPanel Orientation="Horizontal">
<TextBox Watermark="Type the word here..." Text="{Binding Input}" IsEnabled="{Binding !IsConfirmed}" Width="280" FontSize="12">
<i:Interaction.Behaviors>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
-
- </StackPanel>
+ </c:ContentArea>
<Button Content="Cancel" Command="{Binding CancelCommand}" Classes="invisible" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
<Button Content="Finish" Command="{Binding FinishCommand}" Classes="action" HorizontalAlignment="Right" VerticalAlignment="Bottom">

MODIFY
WalletWasabi.Fluent/Views/Dialogs/CreateWallet/RecoveryWordsView.axaml
WalletWasabi.Fluent/Views/Dialogs/CreateWallet/RecoveryWordsView.axaml
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d"
d:DesignWidth="600" d:DesignHeight="500"
Width="600" Height="500"
x:Class="WalletWasabi.Fluent.Views.Dialogs.CreateWallet.RecoveryWordsView">
- <Panel Margin="25 35 25 20">
+ <Panel>
- <Button Classes="invisible" Command="{Binding GoBackCommand}" DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Button Classes="invisible" Width="20" Margin="27 35 0 0" Command="{Binding GoBackCommand}" HorizontalAlignment="Left" VerticalAlignment="Top">
<PathIcon Data="{StaticResource arrow_left_regular}" />
</Button>
- <DockPanel Margin="64 0 64 0">
- <TextBlock Text="Recovery words" FontSize="20" DockPanel.Dock="Top" FontWeight="SemiBold"/>
- <TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" FontSize="12" Margin="0 10 0 0" Opacity="0.6"
- Text="Write down the following numbered security words in order. These can be used to recover your wallet in the future. It is very important you keep them in a safe place." />
+ <c:ContentArea Title="Recovery words"
+ Caption="Write down the following numbered security words in order. These can be used to recover your wallet in the future. It is very important you keep them in a safe place."
+ Margin="44 0 21 0">
+ </c:ContentArea>
- <ItemsControl Items="{Binding MnemonicWords}" VerticalAlignment="Center" >
+ <ItemsControl Items="{Binding MnemonicWords}">
<ItemsControl.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="16" />
</ItemsControl.Styles>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
- <WrapPanel MaxHeight="168" Orientation="Vertical" />
+ <WrapPanel MaxHeight="168" Orientation="Vertical" HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
- <StackPanel Width="155" Orientation="Horizontal">
+ <Panel Width="185">
+ <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<TextBlock Text="{Binding Index, StringFormat={}{0}.}" />
<TextBlock Text="{Binding Word}" FontWeight="SemiBold" Margin="5 0 0 0"/>
</StackPanel>
+ </Panel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
- </DockPanel>
- <Button Content="Cancel" Command="{Binding CancelCommand}" Classes="invisible" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
- <Button Content="Continue" Command="{Binding ContinueCommand}" Classes="action" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
+ <Button Content="Cancel" Margin="31 0 0 20" Command="{Binding CancelCommand}" Classes="invisible" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
+ <Button Content="Continue" Margin="0 0 25 20" Command="{Binding ContinueCommand}" Classes="action" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
+
</Panel>
</UserControl>

use ContentArea