コード例 #1
0
 /// <summary>
 /// Creates a new instance of PlayPauseButtonBehavior.
 /// </summary>
 public PlayPauseButtonBehavior()
 {
     Command          = ViewModelCommandFactory.CreatePlayPauseCommand();
     SetLabel         = MediaPlayer.GetResourceString("PlayButtonLabel");
     UnsetLabel       = MediaPlayer.GetResourceString("PauseButtonLabel");
     SetContent       = MediaPlayer.GetResourceString("PlayButtonContent");
     UnsetContent     = MediaPlayer.GetResourceString("PauseButtonContent");
     ContentConverter = new XamlConverter(); // instead of creating Xaml here, we will use a converter to convert the string each time it is re-assigned. This fixes a problem with old visual state changes being applied to the content when it switches.
 }
コード例 #2
0
 /// <summary>
 /// Creates a new instance of PlayPauseButtonBehavior.
 /// </summary>
 public PlayPauseButtonBehavior()
 {
     Command = ViewModelCommandFactory.CreatePlayPauseCommand();
     SetLabel = MediaPlayer.GetResourceString("PlayButtonLabel");
     UnsetLabel = MediaPlayer.GetResourceString("PauseButtonLabel");
     SetContent = MediaPlayer.GetResourceString("PlayButtonContent");
     UnsetContent = MediaPlayer.GetResourceString("PauseButtonContent");
     ContentConverter = new XamlConverter(); // instead of creating Xaml here, we will use a converter to convert the string each time it is re-assigned. This fixes a problem with old visual state changes being applied to the content when it switches.
 }