XAML and Glyphs for buttons - wpf

What's the best way to use glyphs for buttons ?
I have an WPF app which has a lot of buttons and I wonder what's the best way to use them.
I think it's about deploying the app.
Thank's

Example:
<BarButtonItem Name="buttonItem0" Content="Button Item" Glyph="pack://application:,,,/Resources/Images/icon.png" Description="Test button item" Hint="Testing glyph on button" ItemClick="notImplemented" CommandParameter="none" />
<BarButtonItemLink BarItemName="buttonItem0" />

Related

Enlarge and Styling for Xceed.Wpf.AvalonDock Drop Down Button

Hi I'm new to AvalonDock and currently I have to handle on a task on others code which implemented this Xceed.Wpf.AvalonDock. My goal is to make the UI become touch screen friendly and first thing I need to enlarge the "Search Tab Button", I'm not sure the actual name of that button, it is used to show all the existing tab which may hidden or be showing on the header. Just like the Google Chrome, there is a button which used to search the opened tab on the upper right corner. Google Chrome Search Tabs
Can anyone help to give some solution or advice on how to enlarge the "Search Tab Button" ?
search tab button
I was able to change the size of the Menu Item, but not the button size. Below is the code that I tried to change the size of the Menu Item.
<xcad:DockingManager.DocumentPaneMenuItemHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Content.Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="10" FontSize="18"/>
</DataTemplate>
</xcad:DockingManager.DocumentPaneMenuItemHeaderTemplate>
Trial Result
The problem is I don't know how to change the button size.
I search through the web, and the only things I found is this Dirkster99/AvalonDock, unfortunately it is not used for Xceed.Wpf.AvalonDock. Help~ Thanks!
https://stackoverflow.com/a/35417749/14891562
Alright, struggling to find shorter solution from the entire web.
In the end, this is what I found, which help me to change the style of the DropDownButton. Thanks to the author!
To enlarge the button, I follow the instruction of the link above to create a resource dictionary for the entire DocumentPaneControlStyle. From there I change the "Width" and "Height" of the xcad:DropDownButton/
Conclusion, AvalonDock is tough! :'(

Office UI Fabric React - Show tooltip when form input is focused?

This is what I currently have:
<TooltipHost
content="Enter claim name in a way to be understandable for all parties."
directionalHint={DirectionalHint.rightCenter}
calloutProps={{ calloutMaxWidth: 100}}
>
<TextField />
</TooltipHost>
The tooltip is shown on hover. I want it to be exclusively shown on focus.
Is there a way to do it without controlling it with state?
The host automatically adds it to hover and focus. If you want focus only you'd need to use the Tooltip control itself and manually show it on focus.

WPF Buttons not displaying images

I have a strange phenomenon happening with my buttons, in my visual studio when creating a toolbar and assigning the buttons as images to the toolbar they show in the editor, but when i run the app the buttons don't show, this is illustrated below along with the code:
Image from visual studios
Running app image
Code:
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button ToolTip="Open">
<Image Source="Icons/folder_page.png" />
</Button>
<Button ToolTip="Save">
<Image Source="Icons/page_save.png" />
</Button>
</ToolBar>
</ToolBarTray>
Do you copy your Images to the output-directory?
Have you set the Build-Action for the Images to Content and the Copy to Output Directory to 'Copy if newer'
By adding the images to the project they now display as a resource

Is there a WPF equivalent for ToolStripButton?

I'm learning WPF and have been trying to create a toolstrip. Is there a direct equivalent of the WinForms ToolStripButton or is the correct way of use just to add a normal button and format it?
I've found that Microsoft have a page that lists WinForm controls and their WPF equivalents here but that doesn't mention the toolstripbutton.
You can just put buttons inside a ToolBar and it will change the style of the buttons to make them look like a toolbar.
<ToolBar>
<Button>Save</Button>
<Button>Open</Button>
</ToolBar>
Looks like this:
If you want images in the buttons, you have to do the normal thing of modifying the content of the button.
<Button>
<Image Source="..." />
</Button>

WPF Radio button does not show in toolbar

Is there any way to force a radio button or check box to show properly in a toolbar? The circle/check box always disappears once its placed inside a toolbar.
By default, WPF overrides RadioButtons to make them look like toggle buttons. To eliminate this, place a panel inside the ToolBar and then put your RadioButton(s) in there.
<ToolBar>
<StackPanel>
<RadioButton Content="Radio Button" />
</StackPanel>
</ToolBar>

Resources