.NET MAUI Android button pressed effect - c#

Is there a way to change the pressed effect of a button on Android in a .NET MAUI project. Now it is showing a dark ripple effect when dark mode is on and a white ripple effect when the light mode is on.
I would like to have the same ripple color for both dark and light mode. I tried to change the colorPrimary and colorPrimaryDark values but nothing changes.

The simplest way to achieve parity in both modes (and potentially across platforms) might be to override the button's default style with your own.
You can look into the default button style template, make a copy in you apps resources, and change the colors used to from default staticresource or dynamicresource to your desired color palette.

Related

Override user's accent color in UWP

Is there a one-liner way to override the user's accent color in UWP for my application? I've been searching for this but apparently one would have to create a dictionary with each variation of the user's accent color. What I would like to do is simply change it from whichever the user selected to another one from Window's default accent colors.
I'm building an application for a local business and it's more important to them to have their colors on the application instead of whichever the computer's configured to use. Luckly, their "accent" is a color very close to Window's yellow accent color, so changing the accent to be used in the application to that would be very helpful.
What you’re looking for is the ColorPaletteResources API.
By using it, you can override any of the System color in your app, including the Accent color itself.
It requires Win 10 1809 or higher.
It seems, however, to be some bug in it: by some test I’ve already done in the past, it seems to be working only when used in XAML (or before the InitializeComponent() in a page constructor) and it works apparently only for the Accent.
But this API is the most straightforward way of overriding System colors, as for now.
Best regards.
As far as I'm aware there is no one-liner, you'd need to override each as shown below:
<Application.Resources>
<ResourceDictionary>
<Color x:Key="SystemAccentColor">#107C10</Color>
</ResourceDictionary>
</Application.Resources>

Telerik winforms theme color customization

I am using Telerik Winforms in my application. I am looking for the closest theme color combination that matches the client branding requirements.
I have chosen "Office2010Silver" but I need to change the orange color into red for the entire application.
It is painful to edit the children elements and the primitives for each and every different control. I am wondering if I can use color blending or any other feature to write some code to change the color of the entire application theme.
Thanks.
Color blending is available as of the Q2 2015 release. Here is more information about it: link

Button didn't change its size based on the screen resolution

How can I make my Windows Store App look great on large resolutions? For example a Button - how can I change its font size based on the resolution? If I view my app on 13" the button looks OK, but if I view it on 27" display it looks very, very small. Isn't something to be used in the Windows store apps framework to adapt a button, textBlock, etc to the screen resolution?
Set StretchDirection="Both" & StretchProperty="Fill" in ViewBox
This is a consequence of screen scaling based on DPI... which makes your button the same physical size on both monitors, but totally ignores the fact that the user sits/stands much closer to one than the other. Maybe someday we'll have a not-stupid scaling scheme that works based on subtended angles.
Large format monitors already have larger pixels, I suggest you simply opt out of display scaling in your application. (But do respect the global system font size settings)
I'm not sure what the opt-out setting is in XAML (WPF), but in WinForms, I'd be changing the AutoScaleMode property.

Where can I know key of Windows 8 metro background brush?

It is kinda baby question but it is important for the visual appearance of my app.
When I installed Windows 8 DevPreview on my PC os proposed me to choose the color scheme for Metro UI. I preferred teal color. It is something like next:
So I have this color scheme for background and for setting background. Now I want to implement the custom setting for my app. Something like next:
But for good user experience, I want to keep my settings in the same color that system. In the current moment, I set settings background manual. But it isn't a solution because a user can prefer another color scheme. I've checked in StandardStyles and in main generic XAML file. But looks like that I missed it. I would be pleasure if anybody help with this.
This value is not available in the current SDK. Though the initial settings flyout pane does match the system color, you'll notice that any custom settings panes are usually white or a color that matches the application.
Take a look at the Bing Weather app and you'll see what I mean. All of the applications custom settings have a blue background (even though I personally have a teal theme).
Also, don't get confused by the "Permissions" settings. That dialog is also provided by the OS.

C# win form transparency

I am using C# to make my desktop applications.
But I want to make more graphical applications that have full transparency backgrounds and different levels of transparency for picture box controls.
Basically, not cookie cutter opacity of removing a solid color.
How can I accomplish this with C#?
It is simple, just go ahead with WPF. This gived me a good start point.
This should help:
http://www.c-sharpcorner.com/UploadFile/scottlysle/XparentFormsCS10282007212944PM/XparentFormsCS.aspx
also
form2.Opacity = .x; where x is percentage of transparency
or
transparency can be directly edited in appearance property of form in case you are using VSTO

Categories