首页 > Windows开发 > 详细

WPF 后台绑定样式

时间:2016-08-18 12:40:39      阅读:526      评论:0      收藏:0      [点我收藏+]

 

 private ContentControl cc = null;

private void muiscPlay(object sender, RoutedEventArgs e)
{
string name = ((ContentControl)sender).Tag.ToString();
if (string.IsNullOrWhiteSpace(name))
return;
if (filename != name)
{
player.Stop();
isStart = true;
if (cc != null)
cc.SetResourceReference(System.Windows.Controls.Button.StyleProperty, "playButtonStyle2");
player.LoadedBehavior = MediaState.Manual;
player.Source = new Uri("./Resource/musics/" + name, UriKind.Relative);
filename = name;
}
if (isStart)
{
player.Play();
((ContentControl)sender).SetResourceReference(System.Windows.Controls.Button.StyleProperty, "pauseButtonStyle2");
cc = ((ContentControl)sender);
isStart = false;
}
else
{
player.Pause();
((ContentControl)sender).SetResourceReference(System.Windows.Controls.Button.StyleProperty, "playButtonStyle2");
isStart = true;
}
}

WPF 后台绑定样式

原文:http://www.cnblogs.com/DataBase-123/p/5783304.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!