wpf C# retrieving accent color windows 10 - c#

Yes, WPF.
How to retrieve accent color that the user has chosen in Windows settings into a desktop WPF application?
for example for a Button?

I'm not sure which version of .Net you're using, but if you're using 4.5 or higher, you can use the SystemParameters class. I think the property you more than likely are after is the WindowsGlassBrush.
this.Background = SystemParameters.WindowGlassBrush;
Note though, that the properties in this class are marked with SecurityCriticalAttribute, so you will more than likely need full trust to access them.

I wanted the XAML version of Richard Preziosi answer, that would be :
BorderBrush="{Binding Source={x:Static SystemParameters.WindowGlassBrush}}"

Related

Does windows phone sdk support the ObjectDataProvider

does Windows phone support the ObjectDataProvider, from Wpf?
I can't find a way to use it inside the xaml.
No, it does not. This is part of System.Windows, and if you check here http://msdn.microsoft.com/en-us/library/system.windows.data.objectdataprovider(v=vs.110).aspx you can see which platforms are supported on the bottom of the page.

Changing property on WPF control in another application?

Is it possible to change a value of a WinRT control in another application?
I am using a Windows Surface Pro 2, which uses Windows 8.1. this OS has a text prediction feature which requires the TextBox.IsTextPredictionEnabled property to be set to true. If this is set to false, then it will not use the text prediction.
Unfortunately for me, there are instances where the application developer thought it prudent to turn this feature off (default is on) and I disagree. I would like to change this. Is there a way?
No. The applications on top of WinRT are heavily sandboxed, so there is no direct way to affect other applications than yours.
As Euphoric said, there is no direct way to do that.
If I needed to change a properties (I'm talking about our own apps), maybe I can try to create a text file and read it with the other app, so with a few if condition I can change values by that text file. But both of your applications should be updated. If they are not our application there is no way to do that.

How can I use the Typography.NumeralAlignment Property on a WP7 textblock?

I have a text block that should display numbers in this format
This is supposed to be accomplished via Typography.NumeralAlignment property set to "Tabular" but how do I apply this to a Textblock in a Windows Phone 7 application.
This is only supported in SL5 and WP7.1 is based on SL4. I don't know of alternatives, sorry.
http://msdn.microsoft.com/en-us/library/system.windows.documents.typography.numeralalignment(v=vs.95).aspx
To get this to work in SL4, you will need to essentially implement it yourself..

WinRT - SnapsToDevicePixels?

I can't find the SnapsToDevicePixels in the WinRT (.NET 4.5) framework for Windows 8.
How come? Was it removed? Are there any other alternatives to decrease bluriness in Windows 8 Metro applications?
Also see UseLayoutRounding. This can get rid of blurriness on images as well.
The closest property within the WinRT profile is UseLayoutRounding
Since this answer was accepted, and I cannot delete the answer and the fact the original revision wasn't correct, I have simply modified the answer.

How to create Silverlight 4 user control for windows phone app?

Can I create a silverlight user control that will work on a windows phone silverlight?
Is there a way to do so? I don't need very complex things. just a very simple user control with a label and a few text boxes.
Yes and yes. Here is a link for starters. If you scroll to the bottom you will see supported version info. And yes, user controls are supported for Silverlight for Windows Phone v 7.0
Just above the version info is also a clear, straightforward example of the simple kind of user control that you're interested in creating.
Cheers.
Sure you can as long as Controls you are using in Custom Control are also supported in Silverlight for WP7. in MSDN doc there is description of which Version of Silverlight supports it with weather its available in WP7. Also in doc every Method, Property ,Event ,etc has an icon in front of it. which will tell if its available in WP7 or not.

Categories