#570 – Use Blend to Search for Properties

Blend makes all properties of a user interface element available for editing via the Properties panel.  The properties panel is laid out in a way that makes finding a particular property fairly easy.  But if you’re having trouble finding a property and you know a portion of the property’s name, you can use the search box to search for the property.

In the example below, we select a Label control and then enter “align” into the search box.  We then see all of the properties that apply to a Label and have “align” as part of the property’s name.

Advertisements

#569 – Setting Transforms from within Blend

You can set both layout and render transforms for an UIElement from within Blend.

To configure a transform, just select the user interface element and then find the Transform area of the Properties panel.  You’ll see that you can set properties for both layout and render transforms.

You can configure a number of different transforms.

A Translation moves an element left/right or up/down.

A rotation transform rotates the element.

A scale transform scales the element.  You can change the element’s X and Y dimensions independently.

A skew transformation slants the element, relative to the X or Y dimension (or both).

You can change the centerpoint of the element, with respect to other translations that you apply.

You can also flip the control horizontally or vertically.

#568 – Setting Text-Related Properties in Blend

You can set text-related properties for a control using the fields in the Text area of the Properties panel.

For example, you can set the font family, font style and font size for a Label control.

Or you can click on the tab with the paragraph mark to see properties relating to formatting, where we can set a TextAlignment property for centering a block of text.

 

#567 – Setting Layout Related Properties in Blend

The Layout are of the Properties panel will let you set properties that are related to layout of a control.  This includes things like margins, alignment, height and width and padding.

By default, only some of the full set of layout properties are shown.

You can, however, click on the downard facing arrow icon to see more advanced properties.

Properties shown can depend on panel that the control is hosted in.  For example, a control hosted within a Grid will include Row, Column, RowSpan and ColumnSpan properties.

#566 – Setting Properties of an Effect in Blend

Like other elements, you can set various properties of an effect in Blend using the Properties panel.

In the example below, we’ve added a DropShadowEffect to a Label.  If you select the effect in the XAML editor or the Objects and Timeline panel, you’ll see several properties that we can set for this effect.

For example, we can increase the ShadowDepth, so that the shadow appears further away from the Label.

#565 – Workaround for Inability to Scroll ScrollViewer in Design Mode in Blend

When you’re working in Blend and have some scrollable content in a ScrollViewer, you won’t be able to see all of the content at design time because Blend doesn’t let you scroll the ScrollViewer.

This can be frustrating, since you want to see your content at design time.  In the example above, I have a series of Image controls in a vertical StackPanel, but I can only see the first couple.

The trick to working around this limitation is to put your content into a UserControl and then put that UserControl into the ScrollViewer.  You can then scroll the contents of the UserControl on the artboard.

Create a UserControl.

Move your content into the new UserControl.

Remove design-time width and height.

Go back to the window that contains your ScrollViewer.  Find the UserControl in the Assets panel and drag it into the ScrollViewer.

You can now scroll at design time.

#564 – Other Places to Get Third Party Effects

An effect in WPF changes the appearance of a visual element.  The .NET Framework comes with only a couple of effects, but you can find a few other third party effects on the web.

Here are some of the effects from the Pixel Shader Effects Library: