Slow and steady Silverlight (50)

Source: Internet
Author: User
Tags xmlns silverlight

Introduced

Silverlight 4.0 Binding-related enhancements:

* DependencyObject Binding-new support for DependencyObject bindings

* Indexer Binding-new support for indexer bindings

* StringFormat-Specify the display format of the bound data

* Targetnullvalue-The value to display when the bound data is null

* Fallbackvalue-The value to display when the binding fails (cannot return a value)

* CollectionViewSource-Implements a Icollectionview class that allows you to sort, filter, and group data

Online Demo

Http://www.cnblogs.com/webabcd/archive/2010/08/09/1795417.html

Example

1. Demonstrates how to bind to DependencyObject

Dependencyobjectbinding.xaml

Code

<navigation:page x:class= "Silverlight40.Binding.DependencyObjectBinding"
Xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns:d= "http://schemas.microsoft.com/expression/blend/2008"
Xmlns:mc= "http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation= "Clr-namespace:system.windows.controls;assembly=system.windows.controls.navigation"
title= "Dependencyobjectbinding Page" >
<grid x:name= "LayoutRoot" >
<stackpanel horizontalalignment= "Left" >
<!--
Silverlight 3.0 supports binding to FrameworkElement
TextBox inherits from FrameworkElement
-->
<textbox text= "{Binding elementname=slider, path=value}"/>
<!--
New support for DependencyObject binding in Silverlight 4.0
RotateTransform inherits from DependencyObject
-->
<rectangle width= "height=" rendertransformorigin= "0.5, 0.5" fill= "Red" >
<Rectangle.RenderTransform>
<rotatetransform angle= "{Binding elementname=slider, path=value}"/>
</Rectangle.RenderTransform>
</rectangle >
<slider name= "Slider" height= "minimum=" "0" maximum= "360"/>
</StackPanel>
</Grid>
</navigation:Page>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.