Problema de columnas

This commit is contained in:
Miguel 2024-06-17 09:40:34 +02:00
parent 509c0f21d7
commit 7dbd993489
3 changed files with 12 additions and 7 deletions

View File

@ -60,9 +60,12 @@ namespace EscribePassword
}
else if (tipo == TiposEstadosPersistentes.Obsidean)
{
Obsidean obs = new Obsidean();
var tabla = EscribePassword.Passwords.ConvertPasswordsListToArray(Passwords);
obs.EscribirPasswords(tabla);
// if (Passwords.Any(o => o.IsModified))
{
Obsidean obs = new Obsidean();
var tabla = EscribePassword.Passwords.ConvertPasswordsListToArray(Passwords);
obs.EscribirPasswords(tabla);
}
}
}
// Método estático para cargar el estado desde un archivo JSON

View File

@ -30,7 +30,7 @@
<TextBlock Text="Agregar" />
</StackPanel>
</Button>
<Button Command="{Binding UtilizarCommand}" ToolTip="Use">
<Button Command="{Binding UtilizarCommand}" ToolTip="Use - Se puede usar el boton central del mouse.">
<StackPanel>
<Image Source="Icons/use.png" Width="24" Height="24" />
<TextBlock Text="Utilizar" />

View File

@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System.Text.Json.Serialization;
namespace EscribePassword
{
@ -13,6 +14,7 @@ namespace EscribePassword
[ObservableProperty]
private string categoria;
public static List<Passwords> ConvertArrayToPasswordsList(string[,] tableArray)
{
var passwordsList = new List<Passwords>();
@ -51,9 +53,9 @@ namespace EscribePassword
// Fill data
for (int i = 0; i < rows; i++)
{
tableArray[i + 1, 0] = passwordsList[i].Usuario;
tableArray[i + 1, 1] = passwordsList[i].Password;
tableArray[i + 1, 2] = passwordsList[i].Categoria;
tableArray[i + 1, 0] = passwordsList[i].Categoria;
tableArray[i + 1, 1] = passwordsList[i].Usuario;
tableArray[i + 1, 2] = passwordsList[i].Password;
}
return tableArray;