using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace InABox.Wpf.Dashboard; public interface IDynamicDashboardDataPresenter { object Properties { get; set; } /// /// Component for the data of this presenter; can be safely assumed to be non- when is called. /// DynamicDashboardDataComponent DataComponent { get; set; } /// /// Sets up the data presenter; returns the UI element to be rendered to the user. /// /// /// if some error occurred and the data cannot be presented; otherwise, returns the control. /// FrameworkElement? Setup(); /// /// Update the dashboard with . /// /// The data to be rendered. void Refresh(DynamicDashboardData data); void Shutdown(CancelEventArgs? cancel); } public interface IDynamicDashboardDataPresenter : IDynamicDashboardDataPresenter where TProperties: class, new() { /// /// The properties for the presenter; can be safely assumed to be non- when /// is called. This may be modified by the presenter, and any changes made will be persisted. /// new TProperties Properties { get; set; } object IDynamicDashboardDataPresenter.Properties { get => Properties; set => Properties = (value as TProperties)!; } }