eventtrigger

Can you use routed events with a MultiTrigger?

Does WPF support using a triggers that respond to routed events but only given a condition is met? For example, WPF supports triggering on routed events through Event Triggers. ie: <Button> <Button.Triggers> <EventTrigger RoutedEvent="Click"> ... </.. </.. </.. However I am looking for the trigger to go off only giv...

WPF - How can I selectively set the "Visibility" of a TabItem via DataBinding/Triggers

I have a tab page that should be hidden if a property (BlahType) is set to 1 and shown if set to 0. This is what I WANT to do: <TabItem Header="Blah"> <TabItem.Triggers> <DataTrigger Binding="{Binding BlahType}" Value="0"> <Setter Property="TabItem.Visibility" Value="Hidden" /> </DataTrigger> </TabItem.Triggers> ...

How to open a WPF Popup when another control is clicked, using XAML markup only?

I've got two controls, a TextBlock and a PopUp. When the user clicks (MouseDown) on the textblock, I want to display the popup. I would think that I could do this with an EventTrigger on the Popup, but I can't use setters in an EventTrigger, I can only start storyboards. I want to do this strictly in XAML, because the two controls are in...

WPF EventTriggers - Cannot convert string 'MouseEnter' in attribute 'RoutedEvent' to object of type 'System.Windows.RoutedEvent'

I can't get any event triggers to work. A simplified example of what I'm doing is below - <Window x:Name="win" x:Class="EventTriggers.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <Contro...

Fading out a wpf window on close

Hi, I want to fade a window in/out in my application. Fading in occurs on Window.Loaded and I wanted to fade out on close (Window.Closed or Window.Closing). Fading in works perfectly but a RoutedEvent is not allowed on Window.Closing. What RoutedEvent should I be using for Close? <Window.Triggers> <EventTrigger RoutedEvent="Win...

Setting a property with an EventTrigger

I want to be able to set a property with an EventTrigger, there's a number of problems with this. 1) EventTriggers only support Actions, so I must use a storyBoard to set my properties. 2) Once I use a storyboard, I have two options: Stop: Once the animation has stopped the value reverts back to before the animation started HoldEn...

How to: Create reminders that should trigger an event to be handled in a Windows application?

Hello all. I need to develop a windows application with .NET 3.5 that needs to have a calendar and user can schedule appointments. I want (not with a windows-service) that while the application is on, all the reminders that are set up for this user + reminders that admins set them up, should trigger an event in the application so I can...

WPF -- why isn't this EventTrigger working?

I'm trying to get one style going that performs all of my triggers. This is what I have, but the SoundPlayerAction is not firing: <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Pro...

XAML Binding.UpdateSourceTrigger when a Button.Click is fired?

Hi I want to set the UpdateSourceTrigger to an event of a control: <TextBox Text="{Binding Field, UpdateSourceMode=btnOK.Click}"> <Button Name="btnOK"> <Button.Triggers> <Trigger> <!-- Update source --> </Trigger> </Button.Triggers> </Button> I thought about two ways: Set UpdateSourceMode or some...

Problem with EventTrigger for MouseUp, it triggers only on right-button

Please take a look at the following snippet: <EventTrigger RoutedEvent="Image.MouseUp"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="TranslateTransform" Storyboard.TargetProperty="X" From="1" To="0" Duration="0:0:0.15" /> <DoubleAni...

jQuery activate a mouseover function only if the mouse holds on the element

Hi, I would like to activate a .mouseover function only if the mouse lays down on the "trigger" element for a predetermined duration (e.g. 500 milliseconds). E.g. $('.featured').mouseover(function () { $('.feat-txt').fadeOut("fast"); }); Only if the mouse is positioned over the .featured element for at least 500 milliseconds...

Inherited style throwing an InvalidOperationException when executing a PauseStoryBoard action

The XAML below does the following: when the mouse is over a textblock, its text will enlarge, when the mouse leaves the textblock its text shrinks. When the mouse is clicked the textsize freezes. This works as expected when the style of the Textbox is directly set to the SwellingTexblock resource. However, when the style is set to the S...

WPF: how to fire an EventTrigger (or Animation) when binding changes?

We have a simple animation that runs when a ToggleButton is checked and unchecked (expands a ListView's height and then collapses a ListView's height). How do you fire the EventTrigger (or Animation) for the <Storyboard x:Key="CommentsCollapse"> when the DataContext Binding changes in the x:Name="DetailsGrid" Grid in the following XAML?...

Translate XAML EventTrigger to C# Code..

Can anyone tell me how this would look like in C#? <EventTrigger RoutedEvent="Button.Click" SourceName="btnSplit"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation From="0" To="1" Duration="0:0:0.25" Storyboard.TargetName="gridS...

Is there any way to inherit from TriggerAction class?

I am not interested in animations and I am trying to make simple setter action to be set without key frames. I wanted to inherit TriggerAction; make properties that set the new value on target, any additional optional properties so I can use: <EventTrigger SourceName="btn" RoutedEvent="Click"> <BooleanActionTrigger TargetName="cb" ...

How to bind Checked event for radio button in WPF?

I am using the following markup in WPF: <StackPanel.Triggers> <EventTrigger RoutedEvent="RadioButton.Checked" SourceName="xmlRadioButton"> <EventTrigger.Actions> <BeginStoryboard Storyboard="{StaticResource ShowXmlPanel}"/> </EventTrigger.Actions> </EventTrigger> <Event...

Trigger events not working on ajax loaded html

Well After you edit in a row in this table i've created on focusout it suppose to reload the entire row with updated data, the thing is the trigger event stop working after the first load so any changes done after the first one doesnt get saved. I use currently this code $(function () { $.ajaxSetup ({ cache: fals...

Condition in an EventTrigger

Can I check condition inside an event trigger? how can I do something like that using only XAML? <EventTrigger RoutedEvent="MouseDown"> <Trigger Property="IsPressed" Value="true"> <Setter Property = "Foreground" Value="Green"/> ...

EventTrigger doesn't work on controls inside <sdk:Page.Resources>

i am using EventTrigger in silverlight application to handle some events through MVVM model, trigger is working fine on the layoutroot controls, but there are some controls inside the pages resources but the trigger is not working with them :( is there anything i should add or change the namespace or something ? here is my code <i:In...

XAML Bindings not working in custom EventTriggers

Hey all, I am having this really annoying problem... I have the following EventTrigger below: using System.ComponentModel; using System.Windows; using System.Windows.Interactivity; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; namespace App.Common.Actions { public class SoundEffectAction : TriggerAction<Framew...