码迷,mamicode.com
首页 > Windows程序 > 详细

WPF 后台绑定样式

时间:2016-08-18 12:41:35      阅读:692      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!