Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

button event trigger wpf

<Window.Resources>
    <SolidColorBrush x:Key="ButtonBrush" Color="OrangeRed" />

    <Storyboard x:Key="ChangeBackgroundStoryboard">
        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ChangeBackgroundButton"
                                       Storyboard.TargetProperty="Background">

            <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                    Value="{StaticResource ButtonBrush}" />
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>
</Window.Resources>

<Grid>
    <Grid.Triggers>
        <EventTrigger SourceName="ChangeBackgroundButton" 
                      RoutedEvent="Button.Click">

            <BeginStoryboard Storyboard="{StaticResource ChangeBackgroundStoryboard}" />
        </EventTrigger>
    </Grid.Triggers>

    <Button Name="ChangeBackgroundButton"
            Content="TestButton"
            VerticalAlignment="Center"
            HorizontalAlignment="Center" />
</Grid>
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity easing out 
Csharp :: wpf keydown detect if control key is down 
Csharp :: string is int f# 
Csharp :: use or in shell script 
Csharp :: C# How to display text in console 
Csharp :: wpf StrokeDashArray 
Csharp :: visual studio console.writeline not showing in output window 
Csharp :: uwp roaming data sample 
Csharp :: rgb to console color 
Csharp :: how to use monitor from system.threading in c# 
Csharp :: wpf listbox binding change style of selected item 
Csharp :: asp.net call controller from another controller 
Csharp :: c# xml check if attribute exists 
Csharp :: .net core get runtime version 
Csharp :: autoit console write 
Csharp :: foreach for IEnumerable 
Csharp :: ef core many to many fluent api 
Csharp :: except method c# 
Csharp :: hashtable in c# 
Csharp :: c# linq join mutiple 
Csharp :: ontriggerenter unity not working 
Csharp :: delete all fields that start with mongo 
Csharp :: combined 2 arrays 
Csharp :: how to add object in dictionary in c# 
Csharp :: unity image button 
Csharp :: jq map over array 
Csharp :: C# wpf show hidden window 
Csharp :: c# windows forms rtc 
Csharp :: how to hide tree level button when no record found for devexpress child grid view in Winform c# 
Csharp :: photon 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =