Fixed issue when locking and unlocking the same wallet

This commit is contained in:
TheXamlGuy
2024-07-12 20:13:26 +01:00
parent 4846532d93
commit f17ffcbaf6
4 changed files with 82 additions and 37 deletions
+38 -10
View File
@@ -37,16 +37,44 @@
<PersonPicture <PersonPicture
Height="40" Height="40"
DisplayName="{Binding Name}" DisplayName="{Binding Name}"
ProfilePicture="{Binding ImageDescriptor.Image}" /> ProfilePicture="{Binding ImageDescriptor.Image}">
<TextBlock <PersonPicture.Clip>
Margin="0,0,0,-2" <CombinedGeometry GeometryCombineMode="Exclude">
HorizontalAlignment="Right" <CombinedGeometry.Geometry1>
VerticalAlignment="Bottom" <RectangleGeometry Rect="0,0,40,40" />
FontFamily="{DynamicResource FluentThemeFontFamily}" </CombinedGeometry.Geometry1>
FontSize="16" <CombinedGeometry.Geometry2>
Foreground="{DynamicResource StarredIconForegroundBrush}" <PathGeometry Figures="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z ">
IsVisible="{Binding IsFavourite}" <PathGeometry.Transform>
Text="&#xEF60;" /> <TransformGroup>
<TranslateTransform X="25" Y="25" />
<ScaleTransform ScaleX="0.900" ScaleY="0.900" />
</TransformGroup>
</PathGeometry.Transform>
</PathGeometry>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</PersonPicture.Clip>
</PersonPicture>
<Rectangle ClipToBounds="False" Fill="{DynamicResource StarredIconForegroundBrush}">
<Rectangle.Clip>
<CombinedGeometry GeometryCombineMode="Intersect">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="0,0,50,50" />
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
<PathGeometry Figures="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z ">
<PathGeometry.Transform>
<TransformGroup>
<TranslateTransform X="43" Y="43" />
<ScaleTransform ScaleX="0.600" ScaleY="0.600" />
</TransformGroup>
</PathGeometry.Transform>
</PathGeometry>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Rectangle.Clip>
</Rectangle>
</Grid> </Grid>
<StackPanel Grid.Column="1" Margin="12,0,0,0"> <StackPanel Grid.Column="1" Margin="12,0,0,0">
<TextBlock FontWeight="SemiBold" Text="{Binding Name}" /> <TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
+1 -1
View File
@@ -13,7 +13,7 @@
MenuItemsSource="{Binding}" MenuItemsSource="{Binding}"
SelectedItem="{Binding SelectedItem}"> SelectedItem="{Binding SelectedItem}">
<Interaction.Behaviors> <Interaction.Behaviors>
<DataTriggerBehavior Binding="{ReflectionBinding SelectedItem.IsOpened}" Value="True"> <DataTriggerBehavior Binding="{ReflectionBinding SelectedItem.IsOpened, Mode=TwoWay}" Value="True">
<InvokeNavigationViewItemAction SelectedIndex="1" /> <InvokeNavigationViewItemAction SelectedIndex="1" />
</DataTriggerBehavior> </DataTriggerBehavior>
</Interaction.Behaviors> </Interaction.Behaviors>
+17 -1
View File
@@ -26,6 +26,20 @@
</NavigateAction> </NavigateAction>
</ConditionAction> </ConditionAction>
</AttachedEventTriggerBehaviour> </AttachedEventTriggerBehaviour>
<DataTriggerBehavior Binding="{Binding IsOpened}" Value="False">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsActivated}" RightOperand="True" />
<ComparisonCondition LeftOperand="{Binding IsOpened}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<NavigateAction Region="Main" Route="OpenWallet">
<Parameter Key="Name" Value="{Binding Name}" />
<Parameter Key="ImageDescriptor" Value="{Binding ImageDescriptor}" />
</NavigateAction>
</ConditionAction>
</DataTriggerBehavior>
</Interaction.Behaviors> </Interaction.Behaviors>
<Grid> <Grid>
<PersonPicture <PersonPicture
@@ -33,12 +47,13 @@
Height="{StaticResource IconSize}" Height="{StaticResource IconSize}"
DisplayName="{Binding Name}" DisplayName="{Binding Name}"
ProfilePicture="{Binding ImageDescriptor.Image}" /> ProfilePicture="{Binding ImageDescriptor.Image}" />
<Grid IsVisible="{Binding IsActivated}">
<Button <Button
Width="{StaticResource IconSize}" Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}" Height="{StaticResource IconSize}"
Background="Transparent" Background="Transparent"
CornerRadius="{StaticResource IconCornerRadius}" CornerRadius="{StaticResource IconCornerRadius}"
IsVisible="{Binding IsActivated}"> IsVisible="{Binding IsOpened}">
<Button.Flyout> <Button.Flyout>
<MenuFlyout> <MenuFlyout>
<MenuItem <MenuItem
@@ -56,4 +71,5 @@
</Button.Flyout> </Button.Flyout>
</Button> </Button>
</Grid> </Grid>
</Grid>
</ListBoxItem> </ListBoxItem>
+4 -3
View File
@@ -29,10 +29,11 @@ public partial class MainViewModel :
{ {
if (args.Sender is WalletNavigationViewModel wallet) if (args.Sender is WalletNavigationViewModel wallet)
{ {
SelectedItem = null; Reset(args =>
{
Reset(args => args.SetSource(wallet), false); args.SetSource(wallet, () => wallet);
SelectedItem = wallet; SelectedItem = wallet;
}, false);
} }
else else
{ {