Programmatically changing button icon in WPF
You can accomplish this by changing the content of the button, through an event handler. You can set both the “Play” Icon and “Stop” Icon as a resource, under Window.Resources like so: <Window x:Class=”WpfApplication1.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Title=”MainWindow” Height=”350″ Width=”525″> <Window.Resources> <Image x:Key=”Play” Source=”/WpfApplication1;component/Play_Icon.png” Height=”50″ Width=”50″ /> <Image x:Key=”Stop” Source=”/WpfApplication1;component/Stop_Icon.png” Height=”50″ Width=”50″/> </Window.Resources> <Grid> <Button Click=”Button_Click” … Read more