
前台代码:
<navigation:Page x:Class="story.databind"
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"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.windows.Controls;assembly=System.windows.Controls.Navigation"
d:DesignWIDth="640" d:DesignHeight="480"
title="databind Page" Loaded="Page_Loaded">
<UserControl.Resources>
<Storyboard x:name="sb">
<DoubleAnimation Storyboard.Targetname="pb" Storyboard.TargetProperty="Value" From="0" To="200" autoReverse="True" RepeatBehavior="Forever" Duration="0:0:3" ></DoubleAnimation>
</Storyboard>
</UserControl.Resources>
<GrID x:name="LayoutRoot" >
<Progressbar Height="15" HorizontalAlignment="left" margin="352,220,0" name="pb" VerticalAlignment="top" WIDth="200" Minimum="0" Maximum="200" />
<TextBox Height="23" HorizontalAlignment="left" margin="352,118,0" name="textBox1" VerticalAlignment="top" WIDth="120" DataContext="{Binding Elementname=pb}" Text="{Binding Value,Mode=TwoWay}" >
</TextBox>
</GrID>
</navigation:Page>
我们后台只需要写:
private voID Page_Loaded(object sender,RoutedEventArgs e)
{
sb.Begin();
}
就OK了。
总结以上是内存溢出为你收集整理的silverlight数据绑定 故事板全部内容,希望文章能够帮你解决silverlight数据绑定 故事板所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)