diff --git a/Examples/CommunityToolkitExample/LoginView.cs b/Examples/CommunityToolkitExample/LoginView.cs index a1ead6c33b..4e2d505fe5 100644 --- a/Examples/CommunityToolkitExample/LoginView.cs +++ b/Examples/CommunityToolkitExample/LoginView.cs @@ -47,7 +47,7 @@ public void Receive (Message message) { loginProgressLabel.Text = ViewModel.LoginProgressMessage; validationLabel.Text = ViewModel.ValidationMessage; - validationLabel.ColorScheme = ViewModel.ValidationColorScheme; + validationLabel.SetScheme (ViewModel.ValidationScheme); break; } case LoginActions.LoginProgress: @@ -58,11 +58,11 @@ public void Receive (Message message) case LoginActions.Validation: { validationLabel.Text = ViewModel.ValidationMessage; - validationLabel.ColorScheme = ViewModel.ValidationColorScheme; + validationLabel.SetScheme (ViewModel.ValidationScheme); break; } } - SetText(); + SetText (); // BUGBUG: This should not be needed: Application.LayoutAndDraw (); } diff --git a/Examples/CommunityToolkitExample/LoginViewModel.cs b/Examples/CommunityToolkitExample/LoginViewModel.cs index 8d48546bbc..c2d6246409 100644 --- a/Examples/CommunityToolkitExample/LoginViewModel.cs +++ b/Examples/CommunityToolkitExample/LoginViewModel.cs @@ -29,7 +29,7 @@ internal partial class LoginViewModel : ObservableObject private string _usernameLengthMessage; [ObservableProperty] - private ColorScheme? _validationColorScheme; + private Scheme? _validationScheme; [ObservableProperty] private string _validationMessage; @@ -107,14 +107,14 @@ private void SendMessage (LoginActions loginAction, string message = "") case LoginActions.Clear: LoginProgressMessage = message; ValidationMessage = INVALID_LOGIN_MESSAGE; - ValidationColorScheme = Colors.ColorSchemes ["Error"]; + ValidationScheme = SchemeManager.GetScheme ("Error"); break; case LoginActions.LoginProgress: LoginProgressMessage = message; break; case LoginActions.Validation: ValidationMessage = CanLogin ? VALID_LOGIN_MESSAGE : INVALID_LOGIN_MESSAGE; - ValidationColorScheme = CanLogin ? Colors.ColorSchemes ["Base"] : Colors.ColorSchemes ["Error"]; + ValidationScheme = CanLogin ? SchemeManager.GetScheme ("Base") : SchemeManager.GetScheme("Error"); break; } WeakReferenceMessenger.Default.Send (new Message { Value = loginAction }); diff --git a/Examples/CommunityToolkitExample/Program.cs b/Examples/CommunityToolkitExample/Program.cs index a9ababfec6..a89b3848fa 100644 --- a/Examples/CommunityToolkitExample/Program.cs +++ b/Examples/CommunityToolkitExample/Program.cs @@ -9,10 +9,11 @@ public static class Program private static void Main (string [] args) { + ConfigurationManager.Enable (ConfigLocations.All); Services = ConfigureServices (); Application.Init (); Application.Run (Services.GetRequiredService ()); - Application.Top?.Dispose(); + Application.Top?.Dispose (); Application.Shutdown (); } diff --git a/Examples/CommunityToolkitExample/README.md b/Examples/CommunityToolkitExample/README.md index c3a7128685..908ae592b8 100644 --- a/Examples/CommunityToolkitExample/README.md +++ b/Examples/CommunityToolkitExample/README.md @@ -115,7 +115,7 @@ private void SendMessage (LoginAction loginAction, string message = "") break; case LoginAction.Validation: ValidationMessage = CanLogin ? VALID_LOGIN_MESSAGE : INVALID_LOGIN_MESSAGE; - ValidationColorScheme = CanLogin ? Colors.ColorSchemes ["Base"] : Colors.ColorSchemes ["Error"]; + ValidationScheme = CanLogin ? Colors.Schemes ["Base"] : Colors.Schemes ["Error"]; break; } WeakReferenceMessenger.Default.Send (new Message { Value = loginAction }); @@ -144,7 +144,7 @@ public void Receive (Message message) case LoginAction.Validation: { validationLabel.Text = ViewModel.ValidationMessage; - validationLabel.ColorScheme = ViewModel.ValidationColorScheme; + validationLabel.Scheme = ViewModel.ValidationScheme; break; } } diff --git a/Examples/Example/Example.cs b/Examples/Example/Example.cs index 80d3de35de..5492208482 100644 --- a/Examples/Example/Example.cs +++ b/Examples/Example/Example.cs @@ -3,11 +3,11 @@ // A simple Terminal.Gui example in C# - using C# 9.0 Top-level statements -using System; using Terminal.Gui; // Override the default configuration for the application to use the Light theme ConfigurationManager.RuntimeConfig = """{ "Theme": "Light" }"""; +ConfigurationManager.Enable(ConfigLocations.All); Application.Run ().Dispose (); @@ -21,7 +21,7 @@ // Defines a top-level window with border and title public class ExampleWindow : Window { - public static string UserName; + public static string UserName { get; set; } public ExampleWindow () { diff --git a/Examples/NativeAot/Program.cs b/Examples/NativeAot/Program.cs index 87bc2ae610..ff5636fdf6 100644 --- a/Examples/NativeAot/Program.cs +++ b/Examples/NativeAot/Program.cs @@ -13,6 +13,7 @@ public static class Program [RequiresDynamicCode ("Calls Terminal.Gui.Application.Init(IConsoleDriver, String)")] private static void Main (string [] args) { + ConfigurationManager.Enable(ConfigLocations.All); Application.Init (); #region The code in this region is not intended for use in a native Aot self-contained. It's just here to make sure there is no functionality break with localization in Terminal.Gui using self-contained diff --git a/Examples/ReactiveExample/LoginView.cs b/Examples/ReactiveExample/LoginView.cs index 130aebb43b..4cef902fdc 100644 --- a/Examples/ReactiveExample/LoginView.cs +++ b/Examples/ReactiveExample/LoginView.cs @@ -96,8 +96,8 @@ public LoginView (LoginViewModel viewModel) ViewModel .WhenAnyValue (x => x.IsValid) - .Select (valid => valid ? Colors.ColorSchemes ["Base"] : Colors.ColorSchemes ["Error"]) - .BindTo (validation, x => x.ColorScheme) + .Select (valid => valid ? SchemeManager.GetScheme ("Base") : SchemeManager.GetScheme ("Error")) + .BindTo (validation, x => x.GetScheme ()) .DisposeWith (_disposable); }) .AddControlAfter