|
<UserControl x:Class="CommandReturnValue.Controls.ToggleButtonControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Commands="clr-namespace:CommandReturnValue.Commands"
Name="toggleBtnControl">
<UserControl.Resources>
<Style TargetType="ToggleButton">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Image Name="image" Source=".\..\Icons\Play.png"/>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="image" Property="Source" Value=".\..\Icons\Pause.png"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<ToggleButton Name="toggleBtn" Content="Play" ToolTip="Click Me" Width="128" Height="128"
Command="{x:Static Commands:Commands.ToggleCommand}"
CommandParameter="{Binding ElementName=toggleBtn, Path=IsChecked}"/>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.