refactor: build services with dependency injection
App registers the services, controllers, the main window and the pages in a container, and the navigation view asks it for each page. Pages get their controllers through the constructor instead of reading statics from App. SettingsStore takes over the current settings from App. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
65743279b1
commit
c6e9bf4e82
9 files changed
+112
-35
No files matched your search
@@ -9,9 +9,13 @@ namespace Radiosender.Views.Pages;
|
||||
|
||||
public partial class LibraryPage : Page
|
||||
{
|
||||
private readonly LibraryController _controller = new(App.Songs);
|
||||
private readonly LibraryController _controller;
|
||||
|
||||
public LibraryPage() => InitializeComponent();
|
||||
public LibraryPage(LibraryController controller)
|
||||
{
|
||||
_controller = controller;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private Song? Selected => SongList.SelectedItem as Song;
|
||||
|
||||
|
||||
Reference in new issue
Block a user