I am working on Windows Phone 8 application.
I have Application Bar with icon, I have set the Background and Foreground color to the icons as well.
ApplicationBar.BackgroundColor // Orange
ApplicationBar.ForegroundColor // White
So now the Application bar looks like this :
Now my phone theme settings i have set the Accent color as pink so when i tap on the icon it looks like this :
But when i tap on the icon i want the effect to be is like this, even if my Phone setting Accent color is pink or some other color and background is set to light or dark.
It is not possible to change the behaviour of the ApplicationBar in the way you describe.
The ApplicationBar is not a regular control and it is not possible to alter it's behaviour in this way.
If you really, really want to get the behaviour you're after you'll need to create your own replacement for the ApplicationBar.
Related
I am adding a simple icon + text at the top of each ContentPage of my Maui app. I want the color of the icon to change according to the current AppTheme (dark or light). I use these same icons in the navigation tabs in this shell app. The color of these icons change when the a tab is selected or unselected and these colors vary depending on the AppTheme. This happens automatically without me needing to code the behavior. I have not been able to find a way to mimic this behavior for the icon at the top of the page. I'm trying to avoid creating multiple icon image files of different colors.
I am using a toolbox icon for one of my navigation tabs. When the AppTheme is Light and the icon is unselected, the icon is black
, when selected it is blue . When the AppTheme is Dark, the icon is always White. This is being handled automatically for me in the shell app.
How can I create this same behavior for this icon color if I use it in a title bar (e.g. setting Shell.TitleView) or in another type of view without creating black, blue and white toolbox image files?
The community toolkit IconTintColorBehavior can change the color of an image (tint it). You can use binding on the color to change it accordingly to the theme (like in this question).
So you will have something like this :
<Shell.TitleView>
<Image Source="logo.png">
<Image.Behaviors>
<toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={DynamicResource Gray950}, Dark={DynamicResource White}}" />
</Image.Behaviors>
</Image>
</Shell.TitleView>
I would like to know how to set the color of the main window in a WINUI 3 C# application. By default, it matches whatever theme color is applied to the Windows computer. In this example, it is a purple color. Can I set/override this color with a specific color of my own?
I don't think it's possible "for the moment".
I tried overriding the ThemeResources but it only applied to the controls inside the app not its window border. But there is a discussion on GitHub to make the app window borderless, so there's a chance that they make it possible to change the border color.
https://github.com/microsoft/microsoft-ui-xaml/issues/1247
I need to get the color of text of title bar in Windows 10 because I want to color some text of my form upon this color.
Because the color of windows in Windows 10 can change dynamically with the background, I need to get the text color of title bar for properly coloring my form.
For instance, if the Windows 10 color is yellow
the text is black, while if the color is blue
the text is white: I want the color of the text.
Where can I find it?
So far I properly set only the background color of my title bar with DWMCOLORIZATIONPARAMS through ColorizationColor, but I can not find a way to get the forecolor.
I believe that the SystemColors.ActiveCaptionText should be the one you need. This changes dynamically according to the current profile.
Gets a Color structure that is the color of the text in the active
window's title bar.
Link: SystemColors.ActiveCaptionText
I have an issue with the XAML designer for MainPage.xaml, it does not show the black screen of the phone. Instead it shows the invisible background. This means that just the body of the phone is visible but the screen matches the phone background.
When a Button is added to the Grid, just the outline for changing the size of the Button in seen and not the contents of the Button.
This answer works for any project in Visual Studio, not just windows phone.
Set the background of the Page or Grid or specific control to the color desired.
Background="Green"
If this is only a design time issue...one can change the colors of the background of the designer to an alternate color.
Go to Options -> Fonts and Colors and select XAML Designer in the Show settings for drop down. The in the Artboard Background change both colors to a color which works for you. Mixing the colors will create a checkerboard view, so its usually best to use, black or white.
I have an application that uses the windows glass brush to set its controls' background to the same color at start up using SystemParameters.WindowGlassBrush in WPF.
The problem is when the user change colors while the application still running, it won't update the background color. So i have to check when the user changes the theme color and then update the controls.
The system sends a WM_DWMCOLORIZATIONCOLORCHANGED to all top-level windows in response to a change in colorization color. Set up an event handler for this message to perform the re-initialization of your rendering resources.