add password entry field and button to unlock screen

This commit is contained in:
2025-12-05 02:21:57 +03:00
parent 08d15ca537
commit 27682c343e
2 changed files with 14 additions and 3 deletions

View File

@@ -52,7 +52,18 @@
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:LockedRepositoryViewModel}">
<StackPanel Margin="20"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBox x:Name="UnlockPasswordEdit"
PasswordChar="*"
Width="450" />
<Button x:Name="UnlockButton"
HorizontalAlignment="Center"
Foreground="Black"
Content="Unlock!" />
</StackPanel>
</DataTemplate>
</Window.DataTemplates>

View File

@@ -21,9 +21,9 @@ public class RepositoryWindowViewModel : ViewModelBase
private void UpdateLockStatus()
{
if (currentPage is LockedRepositoryViewModel && !passStore.Locked)
if ((currentPage == null || currentPage is LockedRepositoryViewModel) && !passStore.Locked)
SwitchToUnlocked();
else if (currentPage is UnlockedRepositoryViewModel && passStore.Locked)
else if ((currentPage == null || currentPage is UnlockedRepositoryViewModel) && passStore.Locked)
SwitchToLocked();
}