Windows 8 Themes - windows-8

While searching for a method to determine which theme is currently in use for Windows 8, I came across this article. It states that the theme is set per application and cannot be changed. I didn't realize that this was the case, nor did I do anything to set my theme to "Dark" (although it seems to be so). If this is correct, then how is the app theme set or, if not, how can I determine which theme is currently in use?

By default new applications use the "Dark" theme, this is set by a property called RequestedTheme on the Application object. To change to the "Light" theme you can set the property in the App.xaml file on the Application element. You can read that same property to determine which theme isn't being used, but since it cannot be changed by the user it's value will only ever be what you set it to be.

Related

How to style notifications in Vaadin Flow

I would like to style notifications in Vaadin Flow (19+), in Java, exactly as shown here in typescript, by assigning a theme and not setting the color of the elements (as shown in the java example). Apart the fact that setting the color is troublesome (foreground, background...) and fragile (e.g. switching to dark mode), the Java example shows setting a CSS color, I would expect to be allowed to use Lumo color variables (e.g. --lumo-success-color). Is this possible? Can anybody show an example?
You can use the addThemeVariants() method to define the variant you want to use:
Notification notification = new Notification();
notification.addThemeVariants(NotificationVariant.LUMO_PRIMARY);
The Java examples have not been moved over to the new docs site yet, you can find them here https://vaadin.com/components/vaadin-notification/java-examples/theme-variants

Vuetify - Customizations

Vuetify allows us to change the default themes and presets by using a variables.scss/sass file in our project.
But I am unable to figure out how to change the font-style/font-weight (or any other global properties except the color) for the entire app, dynamically on the fly.
For Example:
We have a vue application running and the global font is currently set to Roboto,
What I want to do is provide a list of available fonts in a v-select and dynamically feed the selected value(suppose Raleway) in the variables.scss file or somehow trigger Vuetify to pick up the updated font-family (even other customizations), and change the default font to Raleway for the entire application.
I don't want to add classes everywhere. It won't be maintainable.
Any ideas on how can this be achieved?
Thanks in advance!
Changing the font app-wide is possible through the variables file as you mention, but this is a build-time decision. If you're wanting the user to swap out the font in the running app, there isn't any mechanism for this as far as I know, because the app is already compiled and running.

How to define a separate set of styles for each platform/OS in Avalonia?

Is there a way to apply different styles depending on the operation system? How does one define separate themes for Windows, macOS and Linux?
There is currently only one "default" theme, platform-specific themes are planned, but not yet implemented.
If you want per-platform themes/styles, you need to add them to your Application.Styles manually inside Application.Initialize using StyleInclude class (See App.xaml from application template). For platform detection you can use AvaloniaLocator.Current.GetService<IRuntimePlatform>().GetRuntimeInfo().OperatingSystem.

Reduce DevExpress theme dll's on deploy folder

Using the
DevExpress Assembly Deployment Tool
helps finding out the needed dll's depending on your references. In my case I have as a reference just DevExpress.Xpf.Charts.v16.1.
The total amount of dll's to deploy from DevExpress is 33. From those, 20 are DevExpress.Xpf.Themes.XXX related.
I understand that depending on the context you can have different themes, like aero, metro, win xp...
Is there any way to reduce the amount of dll's in the deploy folder.
Or
Is there any way to 'fix'/'hardcore' the theme to be used and have just one of them deployed?
Refer this DevExpress Thread - Could not load file or assembly DevExpress.Xpf.Themes...
Starting with version 16.1, the default application theme is "Office2016White". Thus, it is required to add a reference to the DevExpress.Xpf.Themes.Office2016White.v16.1 assembly in your project if it uses the default theme.
In addition, the default theme is now applied to standard WPF controls, not only DevExpress ones.
To switch to another theme, use the ApplicationThemeHelper.ApplicationThemeName property. The DevExpress.Xpf.ThemeManager.ApplicationThemeName property has become obsolete.
To restore the old behavior, set the DevExpress.Xpf.Core.ApplicationThemeHelper.UseLegacyDefaultTheme property to true before the first reference to the DevExpress.Xpf.Core.v16.1 assembly. See the example below:
public partial class App : Application {
public App() {
ApplicationThemeHelper.UseLegacyDefaultTheme = true;
}
}
The value of the static Theme.Default property has been changed to Office2016White.
For the answer of you question, You can just add that theme assembly which your added controls use. If you have changed theme from different control by modifying some properties then you have to be careful about that required assemblies.
Hope this help..

Windows Phone ThemeManager

is it possible to for example - write a background service, which randomly changes the windows phone theme, I mean is it possible to access the windows phone theme under settings via code? and change it?
if so can you please give me an example of the API's I can use or additional libraries I can dl
thank you
Unfortunately you can't. It is not possible to change the Windows Phone theme by code. The only one who can is the user. This is part of the Windows Phone concept.
The only thing you can do is defining themes that are used in your own apps.
Sorry for the bad news...
You are allowed to change the theme for your application. There is a Nuget package available that makes this even easier. You could accomplish changing it in a background task by setting a property that you check when the app opens.
// background agent code
// get random value
IsolatedStorageSettings.ApplicationSettings["Theme"] = randomValue; // this is just a string or something simple
IsolatedStorageSettings.ApplicationSettings.Save();
When your app opens, you would check this value
var theme = "Standard";
if(IsolatedStorageSettings.ApplicationSettings.ContainsValue("Theme"))
{
theme = IsolatedStorageSettings.ApplicationSettings["Theme"];
// Set the theme
}
You can modify the source of the Theme Manager by downloading the source from github. Here is some more info on the Theme Manager. If you would like to change values yourself, you can accomplish this by setting the resource values when the papp starts
((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = myAccentBrush;
((SolidColorBrush)Resources["PhoneBackgroundBrush"]).Color = myBackgroundBrush;
((SolidColorBrush)Resources["PhoneChromeBrush"]).Color = myChromeBrush;
((SolidColorBrush)Resources["PhoneForegroundBrush"]).Color = myForegroundBrush;