How many kinds of built-in VisualState are there in UWP? - xaml

For me, the known VisualStates are:
Pressed
Focused
UnFocused
PointerOver
but I want to know all the built-in VisualStates, and I have searched for a long time and still can't find the relevant information, does anyone know where I can find such information?

How many kinds of built-in VisualState are there in UWP?
It's different with Xamarin Visual State Manager defines one visual state group named "CommonStates" with the following visual states:
"Normal"
"Disabled"
"Focused"
"Selected".
In UWP platform, it does not contain such default state. it is useful because such a VisualState will use whatever values are present in the default template. Each attribute should specify the state's x:Name attribute, which is the stateName value a control consumer would pass in a GoToState call to use that visual state. For more detail please refer to official document.

Related

How to override default WinUI 2.x styles in Blend?

Previously I had asked where to find the default styles for the WinUI 2.x controls, and was pointed to the appropriate repository in GitHub where those could be found. Thanks! However, what I really want is to be able to override some of the styles. I was expecting that I would be able to do so in Blend, but I have not been able to figure out how to do that.
For example, when I load my project in Blend and then try to edit the templates for the ContentDialog, I am offered the option to apply an existing style, but not to create a new one. I was expecting I could create a copy, which would give me the default styling as a starting point and allow me to make the small modifications I require. Regarding buttons, I was able to edit a copy of the template, but that only gave me access to the ControlTemplate where I want access to the equivalent of DefaultButtonStyle.
It has been a while since I've used Blend, so perhaps I am mis-remembering how the tool works. But in previous versions of our app I was able to generate resources that included the full styling of the controls that I was using, such as buttons and content dialogs. Can I do the same for our current app that uses WinUI 2.x? If so, how? And if not, what are my alternatives? I have considered copying the default templates I am interested in into the resources of my project and making modifications that way, but I am hopeful that there is a better way.
Rich
I am offered the option to apply an existing style, but not to create a new one
This is expected. For example, both the Visual Studio or the Blend for Visual Studio can't directly create a default DropDownButton style of WinUI. You need to manually copy the WinUI style from Github and put the style in your XAML.
For native UWP controls, you could just generate a copy of the style automatically.

UWP custom control template not applied (but only in one project)

I have created a custom version of the default UWP button control template, which simply modifies the color scheme of the disabled state.
In a test project this customization is applied correctly, but in my real project it is ignored (although other custom control templates are applied correctly).
I have searched the project for TargetType="Button", hoping to discover something else that is overriding or interfering with this custom template, but there is nothing unusual; just a few style definitions that are setting properties for specific button instances.
Can anyone suggest why a custom UWP control template would be ignored or how I can debug what's causing this?

How do you change the label on an idMSO button on the Ribbon

Microsoft Word 2010
From ribbon XML:
<button idMso="TableRowsDelete" getScreentip="RibbonControl.Get_Screen_Tip" getLabel="RibbonControl.Get_Label" showLabel="true" size="normal"/>
My tab switches between 2 languages, so the label and screen tip changes for each button. For all the custom buttons I have created, I can change the labels and screen tips. However, for all the Microsoft buttons I included in my tab, the label and screen tip remains unchanged.
Is there something special that needs to be added, so I can change these too?
To change the language of built-in controls, you need to make sure that the corresponding UI language is installed, e.g. using a Language Interface Pack.
You can then set the language by setting the following Registry entry to the respective language ID, e.g. 1033 for en-US:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\LanguageResources::UILanguage
For the change to take effect, Office needs to be restarted though, so you won't be able to change the language on the fly.

Change the checkbox mark color in windows phone 8

My app uses gray background, i change the border of checkbox with borderbrush, but i dont find any attribute to change the color of the mark within checkbox. So, any solution ?
You've got a few options. If we go check out the default template the glyph Path that makes the checkmark visual has a Fill assigned to CheckBoxForegroundThemeBrush which you could change at the template level. Or at the resource level where you would find that resource declaration. Or you could change it at the instance level.
Hope this helps, cheers.
You can change it on the Resources property of the control:
DirectCast(Checkbox1.Resources("CheckBoxForegroundThemeBrush"),
SolidColorBrush).Color = Windows.UI.Colors.Black

WIX Feature Tree with Checkbox selection

I am in need to add a Features tree with checkbox selection to my msi. Can any one point me to some sample as how to achieve this please?
I already have one Feature element (ProductMain) that installs all the mandatory components. I have tried using the built-in CustomizeDlg and FeaturesDlg but not sure how to change the Selection tree to use Checkboxes
I am using WIXUI_Common set of dialogs.
I would appreciate any suggestion/guidance in this regard.
Sincere thanks!
You're limited to the UI supported by Windows Installer (which is quite limited). I don't think you can customize the SelectionTree control to display checkboxes. Alternatively, you can emulate the desired behavior by placing a number of checkboxes on a dialog and implement a certain logic to set feature levels.