Change app theme on user input from dark to light and vice versa in Windows Phone - windows

I am developing an application, where I need to give user an option to change theme of app at any point of time through settings from dark to light and vice versa and can switch the theme at any time.
Please let me know if there is a way to do it.
Currently the app changes theme according to OS theme. If user has dark theme selected in OS, app will have dark theme and vice versa.
Requirement is irrespective of OS theme user should be able to change theme inside application (Like in Google Mail/ VLC player settings etc.)
Please help me out in implementing this.

If you made the application switch with the OS Theme by using the global resource keys for colors, icons and brushes you would have to replace all of that; as far as I know there is no way to intercept that.
To have the application switch between themes you could define a property on the main viewmodel that can be accessed and bound to from anywhere. Put all the colors and resources you want to theme in a ViewModel and bind to these properties. Next create some value converters to turn a general resource reference into a themed resource reference. That will allow you to specify a color by a logical name and have the converter translate it to a theme aware color:
<Text Background="{Binding Path=UIResources.TextBackground,
Converter={StaticResource ColorToThemedColor}}" />

You could bind the RequestedTheme of your pages to a bool-Value.
Then write a value-converter, which returns Light or Dark for true/false, an set it as Page-Resource.
Last you have write a static Property, to save the value through navigation.
Initialize the static value on start up, and every constructor of you viewmodel get's the value at sets the isLight-Property on the Page
<Page RequestedTheme={Binding isLight,Converter={Staticresource TruetoLightConverter}>

Related

Change context style menu windows 10

I managed to interpret a mmstyles file through a tool called "msstylesEditor" but I can't find where I can modify the values for the background and font color of the context menu.
Also if anyone could link me to some tutorials on how to make theme like those found on DeviantArt i'd be glad ! I couldn't find anything !
Here is how msstylesEditor looks
The background can be changed under Menu -> POPUPBACKGROUND. This is an image (1x1px). You have to export it, change its color, then replace the old image.
You also might want to look at the POPUPBORDER and POPUPITEM parts, in order to fully change the menus appearance. I havent verified where the font color is located, but i guess its the TEXTCOLOR properties
of the just stated parts.
The aim of the tool you linked, is mainly to modify existing themes. The styles on DeviantArt are probably made using a (commercial) tool called "Windows Style Builder".

Liferay - is it possible to set color scheme for control panel?

The problem is that I have created new theme in liferay together with five color schemes. I have succesfully deployed theme into portal.
Now, I need to set this theme as main theme for Control Panel (control panel->configuration->portal settings->display settings->look and feel). This is not problem, but after selecting my theme there is no option to select any of my color schemes.
Is it possible to set color scheme for control panel or not?
Thanks.
On the Control Panel UI there’s no option to do that, unfortunately.
But writing a plugin that does that for you shouldn’t be that hard. After all the Control Panel is just a Group with a theme.
I run into the same problem, here is what you can do:
1) write a JavaScript Code (JQuery or Alloyui), in the main.js file of the theme that execute on page load and detect the Control panel and change the class of <body> to the Color defined in the main.js.
2) write a Hook to change this JSP : /html/portlet/portal_settings/display_settings.jsp.

Why are icons in property sheets rendered with so few colors?

I am creating a property sheet shell extension and want to have a little icon to set off my property tab from the standard system tabs. Unfortunately, my icon is being rendered almost entirely in grey.
Original image:
In the property sheet tab:
At first I thought this was somehow my problem, but then I saw that TortoiseSVN appears to have the same problem:
This happens in both Windows 7 and Windows 8.
Does anyone know why these images are appearing so muted? Also, does anyone have any hints on how to make the icon look good in spite of this colorlessness?
The PropertySheet function initialises its tab control with a 16 color (ILC_COLOR) ImageList and copies the supplied icon for each page into it. There doesn't seem to be a way to override this and supply your own ImageList (or to specify the bit depth of the created ImageList). Presumably this is a legacy of the original Windows 95 code that never got updated as things moved on.
Instead of Property Sheets, you can use Tab Control, which makes tabs management more flexible and clear. And of course you can use any type of icons, because you have to create your own ImageList.
Here you can read about Tab Controls:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb760548(v=vs.85).aspx
And here you can access example usage of Tab Controls:
Icons in Win32 Property Pages are ugly - 4 bit icons

Making TextBox text theme aware

I created a page.i want to change the background of Textbox when theme of emulator is changed to light.The letters cant be visible while changing the themes.is there any solution?
If you use the default TextBox control inside Visual Studio it is fully theme aware. If you have set the colours yourself then you need to perform the theme aware changes in code behind.
For more information, please see the following :-
http://www.developer.nokia.com/Community/Wiki/ThemeawareWindowsPhoneapplication
I assume you are referring to TextBlock rather than TextBox (as the latter automatically has style support).
You should never declare a TextBlock without a Style attribute, such as Style={StaticResource PhoneTextNormalStyle}. A full list of available styles can be found on MSDN: Theme Resources for Windows Phone
Also of relevance is: How to: Apply Theme Resources for Windows Phone
NB: Due to the way Mango was designed, backing into your application after changing themes will not apply the new theme. You will need to restart the application to see the changed theme.
Update
Based on your screenshots, you have two choices:
Reskin ("Edit Template" in Blend) each of the controls that you use to redefine a style in which the various colour-related properties are hardcoded
Use an alternate, lighter, background image when in the white theme in order to improve the contrast. I've blogged about how you can define theme-aware resources (and also mentioned it on other SO questions).
Put simply, you can either submit to the theme or force it to remain the way you want it.
We can set a theme as default to our application.When we log in our application the phone theme will be changed to its suitable theme and when we log out change back to original
here s the link .

Theme-ing applications in Delphi XE

Does anyone know if it is possible to apply custom themes to Delphi applications. Example, changing the default colour, font, tab styles, etc. of a whole application (i.e. set of forms) at once. Kind of like css files for webpages.
Change the color and font of most of the vcl controls is relative easy to do, you can iterate over all the controls of a form and then set the propertiesFont and Color for each control. Now to customize the drawing of a VCL control you must owner draw each control your self. Another way is using a skinning library which do this for you, for example try the VCLSkin component which let you skin the entire application with no need for modifications in your VCL controls. Btw the new incoming version of Delphi (XE2) has great changes in this area introducing FireMonkey and VCL Styles.
Devexpress has something like that, ExpressSkins for VCL
Try Alphaskins it is easy and have a lite free version but make the work you want...

Resources