Fixed test data so that jessie actually gets mother and father ids correctly, and fixed search so that it resets visibility every time
This commit is contained in:
@@ -39,18 +39,8 @@ public partial class HomePage : Page
|
|||||||
|
|
||||||
private void SearchClicked(object? sender, RoutedEventArgs e)
|
private void SearchClicked(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(SearchBox.Text))
|
ResetCritterStackVisibility();
|
||||||
{
|
if (string.IsNullOrEmpty(SearchBox.Text)) return;
|
||||||
foreach (var child in CritterStack.Children)
|
|
||||||
{
|
|
||||||
if (child is ProfileButton profileButton)
|
|
||||||
{
|
|
||||||
profileButton.IsVisible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var child in CritterStack.Children)
|
foreach (var child in CritterStack.Children)
|
||||||
{
|
{
|
||||||
@@ -60,6 +50,17 @@ public partial class HomePage : Page
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ResetCritterStackVisibility()
|
||||||
|
{
|
||||||
|
foreach (var child in CritterStack.Children)
|
||||||
|
{
|
||||||
|
if (child is ProfileButton profileButton)
|
||||||
|
{
|
||||||
|
profileButton.IsVisible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void CreateHeaderButtons()
|
private void CreateHeaderButtons()
|
||||||
{
|
{
|
||||||
var settingsBttn = new Button()
|
var settingsBttn = new Button()
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public partial class TestPage : Page
|
|||||||
};
|
};
|
||||||
await DatabaseService.AddCritter(polities);
|
await DatabaseService.AddCritter(polities);
|
||||||
|
|
||||||
var torielId = DatabaseService.GetCritter("Toriel").Id;
|
var torielId = (await DatabaseService.GetCritter("Toriel")).Id;
|
||||||
var poliId = DatabaseService.GetCritter("Polities").Id;
|
var poliId = (await DatabaseService.GetCritter("Polities")).Id;
|
||||||
|
|
||||||
var jessie = new Critter
|
var jessie = new Critter
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,8 @@ public partial class TestPage : Page
|
|||||||
DateOfBirth = new DateTime(2025, 04, 05),
|
DateOfBirth = new DateTime(2025, 04, 05),
|
||||||
Gender = Gender.Male,
|
Gender = Gender.Male,
|
||||||
Notes = "Polities' first son. Named after Jessie from The Last Of Us.",
|
Notes = "Polities' first son. Named after Jessie from The Last Of Us.",
|
||||||
|
MotherId = torielId,
|
||||||
|
FatherId = poliId,
|
||||||
};
|
};
|
||||||
await DatabaseService.AddCritter(jessie);
|
await DatabaseService.AddCritter(jessie);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user