-
-
Notifications
You must be signed in to change notification settings - Fork 3
V2 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 #10
Conversation
- Removed the MainWindow code-behind logic and migrated to a dedicated MainWindowViewModel. - Implemented ICommand for search and pagination functionality. - Introduced AirportRowViewModel for better handling of individual airport data. - Added PasswordBoxAssistant for two-way binding of PasswordBox. - Created NullOrEmptyToVisibilityConverter for visibility management based on string content. - Removed obsolete AirportService and ApiService classes. - Added NearestAirportService for fetching nearest airport data based on coordinates. - Improved API token handling and validation logic. - Enhanced error handling and user feedback mechanisms.
…e PointStateDispatcher; update JsonSettingsStore to simplify token handling; enhance MsfsPointController with improved state management and error handling; update MsfsSimulatorConnector for better connection retries and late attachment logic; modify MainWindow layout for improved UI; adjust NearestAirportService constant for clarity.
- Added tracking for successfully created object IDs in MsfsSimulatorConnector to improve late attach diagnostics. - Refined late attach logic to skip unnecessary attempts if the object was already spawned normally. - Removed position-based heuristic for late attachment, relying solely on user data matching. - Updated ContributionsResponse to initialize contributions list to avoid nullability warnings. - Improved error handling and logging in SceneryService when fetching available packages from the API. - Cleaned up formatting and ensured consistent code style across both files.
…ndowViewModel; auto-select first available package if none is stored, improving user experience and error handling.
…onal point despawning based on active object count, improving resource management.
…g for received states to reduce log verbosity and improve performance.
…hanced user engagement and status updates.
…te airport default, and implement framework-dependent publishing.
…d SendStopbarCrossing method, and improve polling frequency for better accuracy.
…ty and compatibility.
…prove package selection logic, and update settings file handling.
…limit, implement smooth per-spawn pacing, and update SpawnPerSecond setting for improved performance.
… fallback, improve auto-selection and retry mechanisms, and refine logging for better traceability.
Upgraded the `SimConnect.NET` package reference in the `BARS-Client-V2.csproj` file from version `0.1.14-beta` to `0.1.15-beta`. This update may include bug fixes, new features, or other improvements provided by the library's maintainers.
Added `Dispatcher` usage to manage `_host.StartAsync()` on the UI thread without blocking, ensuring smoother application startup. Wrapped `_host.StopAsync()` in a `try-catch` block during shutdown to handle exceptions gracefully and prevent crashes. Added the `System.Windows.Threading` namespace to support these changes.
…s; implement backoff strategy for transient errors and improve reconnection logic.
Update README to new format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This is a major architectural refactor that modernizes the WPF application's startup and dependency management by migrating from traditional WPF patterns to .NET's generic host with built-in dependency injection. The changes introduce proper service registration, lifecycle management, and new domain models for simulator and airport management.
Key changes:
- Migration to Microsoft.Extensions.Hosting with dependency injection container
- Introduction of new domain models and interfaces for airports, simulator state, and point tracking
- Implementation of background services for simulator management and Discord presence
- Enhanced build system with proper versioning and deployment configurations
Reviewed Changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| App.xaml.cs | Complete rewrite to use generic host with DI service registration |
| MainWindow.xaml.cs | Simplified to basic constructor-only pattern |
| BARS-Client-V2.csproj | Added NuGet packages and deployment configuration |
| Application/ | New interfaces and services for simulator/settings management |
| Domain/ | New domain models for flight state, airports, and point tracking |
| Infrastructure/ | Networking, settings, and simulator connector implementations |
| Services/ | Enhanced scenery service with settings integration |
| Presentation/ | New view models, converters, and behaviors for MVVM pattern |
| build/ | New PowerShell-based build and publish scripts |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
This pull request introduces a major refactor of the WPF application’s startup and dependency management. The app now leverages .NET’s generic host and built-in dependency injection for service registration, lifecycle management, and improved modularity. It also introduces new domain models, interfaces, and project configuration updates to better support simulator and airport management, as well as streamlined deployment.
Changes Made
Application infrastructure and startup:
Microsoft.Extensions.Hosting.SimulatorManager, airport/networking services, Discord presence) in the DI container.App.xaml.csto resolve the main window and view model via DI.StartupUrifromApp.xamlin favor of programmatic startup.Domain model and interface additions:
Airport,SceneryPackage), simulator state (FlightState,RawFlightSample), and point tracking (PointMetadata,PointState,IPointStateListener).ISimulatorConnector).Application layer enhancements:
IAirportRepository) and structured settings (ISettingsStore,ClientSettings).SimulatorManagerinto a hosted background service managing simulator lifecycle and streaming flight data.Project configuration and dependencies:
.csprojmetadata (assembly info, versioning, deployment options).Additional Information
This refactor lays the groundwork for more maintainable and extensible development moving forward. The new domain models and DI-based architecture make it easier to test, extend, and integrate additional simulator and airport functionality.
Author Information
Discord Username:
VATSIM CID:
Checklist: