eventtrigger

TreeViewItem.Expanded

一个人想着一个人 提交于 2019-12-01 09:40:49
问题 Im using the latest version of mvvm light toolkit, however i'm not clear how I can use EventToCommand for the event TreeViewItem.Expanded. THis dosent work... what am I doing wrong? <TreeView Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Path= MonitoredDatabases}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Queues}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding ServerName}" /> <TextBlock Text="\" /> <TextBlock Text="{Binding DatabaseName}"

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

混江龙づ霸主 提交于 2019-12-01 08:45:29
问题 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? In other words, whenever the Binding changes for the "DetailsGrid", we want the "CommentsCollapse" StoryBoard to be triggered to ensure the ListView is

jquery trigger: how can I trigger the browse file in the input when I click on a text link?

▼魔方 西西 提交于 2019-12-01 00:33:52
问题 Following up on this post, I have another issuer - how can I trigger the browse file in the input when I click on a text link? Basically I want to hide the form but it will be triggered when you click on the upload text link. <a href="#" class="upload">upload</a> <form action="upload.php" method="post" enctype="multipart/form-data" id="myForm" style="display:none;"> <input type="file" multiple="multiple" name="file[]" /> <input type="submit" name="upload" value="Submit"/> </form> <div id=

SL4/MVVM: Handle MouseDragElementBehavior.Dragging event with void Foo() in VM

安稳与你 提交于 2019-11-30 09:24:01
问题 I am trying to handle the MouseDragElementBehavior.Dragging event on a control I have. See here for background on why I want to do this. I am having trouble wiring up this event. From the XAML you can see I have added a behavior to the user control. Then I attempted to add a handler to the Dragging event on the behavior via the CallMethodAction EventTrigger. <i:Interaction.Behaviors> <ei:MouseDragElementBehavior ConstrainToParentBounds="True"> <i:Interaction.Triggers> <i:EventTrigger

Outlook “Run Script” rule not triggering VBA script for incoming messages

房东的猫 提交于 2019-11-30 06:06:51
问题 I am creating this new topic on the advice of another member. For additional history regarding how things arrived at this point see this question. I have this VBA script, that I know works if it gets triggered. If I use the TestLaunch subroutine with a message already in my inbox that meets the rule criteria (but, of course, isn't being kicked off by the rule) it activates the link I want it to activate flawlessly. If, when I create the rule I say to apply it to all existing messages in my

Invoke Command When “ENTER” Key Is Pressed In XAML

拈花ヽ惹草 提交于 2019-11-29 23:13:14
I want to invoke a command when ENTER is pressed in a TextBox . Consider the following XAML: <UserControl ... xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" ...> ... <TextBox> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyUp"> <i:InvokeCommandAction Command="{Binding MyCommand}" CommandParameter="{Binding Text}" /> </i:EventTrigger> </i:Interaction.Triggers> </TextBox> ... </UserControl> and that MyCommand is as follows: public ICommand MyCommand { get { return new DelegateCommand<string>(MyCommandExecute); } } private void MyCommandExecute

SL4/MVVM: Handle MouseDragElementBehavior.Dragging event with void Foo() in VM

醉酒当歌 提交于 2019-11-29 15:15:24
I am trying to handle the MouseDragElementBehavior.Dragging event on a control I have. See here for background on why I want to do this. I am having trouble wiring up this event. From the XAML you can see I have added a behavior to the user control. Then I attempted to add a handler to the Dragging event on the behavior via the CallMethodAction EventTrigger. <i:Interaction.Behaviors> <ei:MouseDragElementBehavior ConstrainToParentBounds="True"> <i:Interaction.Triggers> <i:EventTrigger EventName="Dragging"> <ei:CallMethodAction MethodName="NotifyChildrenYouAreDragging" TargetObject="{Binding}"/>

Custom RoutedEvent as EventTrigger

不问归期 提交于 2019-11-29 13:55:50
I have my own shape class public sealed class MirrorTile : Shape and in this class I added the event public static readonly RoutedEvent SelectedEnterEvent = EventManager.RegisterRoutedEvent("SelectedEnter", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MirrorTile)); public event RoutedEventHandler SelectedEnter { add { this.AddHandler(SelectedEnterEvent, value); } remove { this.RemoveHandler(SelectedEnterEvent, value); } } and want to use it in this way <shapes:MirrorTile> <shapes:MirrorTile.Triggers> <EventTrigger RoutedEvent="SelectedEnter"> <BeginStoryboard Storyboard="

Invoke Command When “ENTER” Key Is Pressed In XAML

↘锁芯ラ 提交于 2019-11-28 20:32:59
问题 I want to invoke a command when ENTER is pressed in a TextBox . Consider the following XAML: <UserControl ... xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" ...> ... <TextBox> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyUp"> <i:InvokeCommandAction Command="{Binding MyCommand}" CommandParameter="{Binding Text}" /> </i:EventTrigger> </i:Interaction.Triggers> </TextBox> ... </UserControl> and that MyCommand is as follows: public ICommand

Fading out a wpf window on close

拜拜、爱过 提交于 2019-11-28 19:22:54
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 Window.Closing is not allowed value for RoutedEvent property. What RoutedEvent should I be using for Close? <Window.Triggers> <EventTrigger RoutedEvent="Window.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:2" FillBehavior="HoldEnd" /> </Storyboard> </BeginStoryboard> </EventTrigger> <EventTrigger RoutedEvent="Window.Closing">