Dialog deferrals
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
Title="Create Wallet"
|
Title="Create Wallet"
|
||||||
x:DataType="vm:CreateWalletViewModel"
|
x:DataType="vm:CreateWalletViewModel"
|
||||||
CloseButtonText="Cancel"
|
CloseButtonText="Cancel"
|
||||||
|
IsPrimaryButtonEnabled="{Binding !Active}"
|
||||||
PrimaryButtonText="Create">
|
PrimaryButtonText="Create">
|
||||||
<StackPanel Width="400">
|
<StackPanel Width="400">
|
||||||
<TextBox
|
<TextBox
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
x:DataType="vm:WalletNavigationViewModel"
|
x:DataType="vm:WalletNavigationViewModel"
|
||||||
Content="{Binding Name}"
|
Content="{Binding Name}"
|
||||||
IsExpanded="{Binding Expanded}"
|
IsExpanded="{Binding Expanded}"
|
||||||
|
IsSelected="{Binding Selected}"
|
||||||
MenuItemsSource="{Binding}"
|
MenuItemsSource="{Binding}"
|
||||||
NavigationViewExtension.IsItemInvokedEnabled="True"
|
NavigationViewExtension.IsItemInvokedEnabled="True"
|
||||||
SelectsOnInvoked="True">
|
SelectsOnInvoked="True">
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
<ConditionAction.Condition>
|
<ConditionAction.Condition>
|
||||||
<ConditionalExpression ForwardChaining="And">
|
<ConditionalExpression ForwardChaining="And">
|
||||||
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="False" />
|
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="False" />
|
||||||
|
<ComparisonCondition LeftOperand="{Binding Selected}" RightOperand="True" />
|
||||||
</ConditionalExpression>
|
</ConditionalExpression>
|
||||||
</ConditionAction.Condition>
|
</ConditionAction.Condition>
|
||||||
<NavigateAction Region="Main" Route="OpenWallet">
|
<NavigateAction Region="Main" Route="OpenWallet">
|
||||||
|
|||||||
@@ -22,5 +22,6 @@ public partial class CreateWalletViewModel(IServiceProvider provider,
|
|||||||
private string password;
|
private string password;
|
||||||
|
|
||||||
public async Task<bool> Confirm() =>
|
public async Task<bool> Confirm() =>
|
||||||
await Mediator.Handle<CreateEventArgs<Wallet<(string, string)>>, bool>(Create.As(new Wallet<(string, string)>((Name, Password))));
|
await Mediator.Handle<CreateEventArgs<Wallet<(string, string)>>,
|
||||||
|
bool>(Create.As(new Wallet<(string, string)>((Name, Password))));
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,8 @@ public partial class OpenWalletViewModel(IServiceProvider provider,
|
|||||||
{
|
{
|
||||||
if (Password is { Length: > 0 })
|
if (Password is { Length: > 0 })
|
||||||
{
|
{
|
||||||
if (await Mediator.Handle<ActivateEventArgs<Wallet<string>>, bool>(Activate.As(new Wallet<string>(Password))))
|
if (await Mediator.Handle<ActivateEventArgs<Wallet<string>>,
|
||||||
|
bool>(Activate.As(new Wallet<string>(Password))))
|
||||||
{
|
{
|
||||||
Publisher.Publish(Opened.As<Wallet>());
|
Publisher.Publish(Opened.As<Wallet>());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public class SynchronizeMainViewModelHandler(IPublisher publisher,
|
|||||||
public Task Handle(SynchronizeEventArgs<IMainNavigationViewModel> args)
|
public Task Handle(SynchronizeEventArgs<IMainNavigationViewModel> args)
|
||||||
{
|
{
|
||||||
bool selected = true;
|
bool selected = true;
|
||||||
|
|
||||||
foreach (IComponentHost Wallet in Wallets.OrderBy(x => x.Services.GetRequiredService<IConfigurationDescriptor<WalletConfiguration>>()
|
foreach (IComponentHost Wallet in Wallets.OrderBy(x => x.Services.GetRequiredService<IConfigurationDescriptor<WalletConfiguration>>()
|
||||||
is IConfigurationDescriptor<WalletConfiguration> descriptor ? descriptor.Name : null))
|
is IConfigurationDescriptor<WalletConfiguration> descriptor ? descriptor.Name : null))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user