From 65e1214242e48b3529ac30947bf828720c74e016 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Thu, 30 Jun 2022 17:50:23 -0400 Subject: [PATCH] avalonia porting process visual items tweaked, fixed some crashing when you forget to search --- .../.idea/avalonia.xml | 6 +++ DeskHubSharpRevised/DetailWindow.axaml.cs | 39 +++++++++++++------ DeskHubSharpRevised/FeedbackWindow.axaml | 4 +- DeskHubSharpRevised/MainWindow.axaml | 25 ++++++------ DeskHubSharpRevised/MainWindow.axaml.cs | 18 ++++----- DeskHubSharpRevised/SearchWindow.axaml | 2 +- DeskHubSharpRevised/SearchWindow.axaml.cs | 8 ++-- 7 files changed, 60 insertions(+), 42 deletions(-) diff --git a/.idea/.idea.DeskHubSharpRevised/.idea/avalonia.xml b/.idea/.idea.DeskHubSharpRevised/.idea/avalonia.xml index f76c184..d40ce1f 100644 --- a/.idea/.idea.DeskHubSharpRevised/.idea/avalonia.xml +++ b/.idea/.idea.DeskHubSharpRevised/.idea/avalonia.xml @@ -3,8 +3,14 @@ diff --git a/DeskHubSharpRevised/DetailWindow.axaml.cs b/DeskHubSharpRevised/DetailWindow.axaml.cs index 6981ece..d11ee44 100644 --- a/DeskHubSharpRevised/DetailWindow.axaml.cs +++ b/DeskHubSharpRevised/DetailWindow.axaml.cs @@ -1,3 +1,4 @@ +using System.Collections; using System.Diagnostics; using Avalonia; using Avalonia.Controls; @@ -10,9 +11,21 @@ namespace DeskHubSharpRevised; public partial class DetailWindow : Window { + // Private members + private readonly RepoDetail _repoDetail; + private readonly ComboBox? _cmbbox_branches_items; + private TextBlock? _txtblk_language_text; + private Label? _lbl_reponame_content; + private TextBlock? _txtblk_watchers_text; + private TextBlock? _txtblk_stargazers_text; + private TextBlock? _txtblk_forks_text; + private Request _request; + private Owner _owner; + public DetailWindow() { InitializeComponent(); + DataContext = this; #if DEBUG this.AttachDevTools(); #endif @@ -22,10 +35,6 @@ public partial class DetailWindow : Window { AvaloniaXamlLoader.Load(this); } - - private RepoDetail _repoDetail; - private Request _request; - private Owner _owner; public DetailWindow(RepoDetail repoDetail) { @@ -33,26 +42,32 @@ public partial class DetailWindow : Window _repoDetail = repoDetail; _request = new Request(_repoDetail.name); + _cmbbox_branches_items = this.Find("cmbbox_branches"); + _txtblk_language_text = this.Find("txtblk_language"); + _txtblk_watchers_text = this.Find("txtblk_watchers"); + _txtblk_stargazers_text = this.Find("txtblk_stargazers"); + _txtblk_forks_text = this.Find("txtblk_forks"); + _lbl_reponame_content = this.Find