eventtrigger

Programmatically Call WPF TargetedTriggerAction

邮差的信 提交于 2019-12-05 15:09:49
I have a TargetedTriggerAction from a 3rd party library that would like to call/invoke without attaching it to a button. I have no problem getting it to work with the button, but I want to do it in response to some non-UI event. Here is the action's class declaration: public class MeasureAction : TargetedTriggerAction<Map> Here is my setup code so far: var measure = new MeasureAction(); measure.TargetObject = _mapControl; measure.MeasureMode = MeasureAction.Mode.Polyline; measure.MapUnits = DistanceUnit.Miles; I want to be able to do something like this, but I know Invoke is protected: measure

C# background worker not triggering dowork event on any pc besides my own

微笑、不失礼 提交于 2019-12-05 06:18:37
I'm having a really weird issue with a background worker in one of my applications. I recently overhauled it slightly with some GUI fixes but now when someone on another PC runs the .exe or installs my OneClick deployment the background worker doesn't enter the dowork event. The logic has not changed between the 2 releases. I've done a compare and besides adding more error logging nothing has changed. I've gone as far as to include message boxes and breakpoints in the dowork event but it never enters it anywhere besides on my own PC. Even when i remote debug it doesnt enter the DoWork event

Change Button Background color on EventTrigger in WPF

梦想与她 提交于 2019-12-05 05:40:21
I am trying to change the Background color of my Button when the user clicks it. I am using triggers to achieve it. My XAML is: <UserControl.Resources> <Style x:Key="myBtnStyle" TargetType="{x:Type Button}"> <!--VerticalAlignment="Top" VerticalContentAlignment="Top" Background="Blue" HorizontalAlignment="Right" Height="24" Width="25" FontSize="16" FontWeight="Bold" --> <Setter Property="VerticalAlignment" Value="Top" /> <Setter Property="VerticalContentAlignment" Value="Top" /> <Setter Property="Background" Value="Blue" /> <Setter Property="HorizontalAlignment" Value="Right" /> <Setter

jquery bind functions and triggers after ajax call

邮差的信 提交于 2019-12-04 06:41:56
问题 function bindALLFunctions() { ..all triggers functions related go here }; $.ajax({ type: 'POST', url: myURL, data: { thisParamIdNo: thisIdNo }, success: function(data){ $(".incContainer").html(data); bindALLFunctions(); }, dataType: 'html' }); I am new to ajax and JQuery. I have the above ajax call in my js-jquery code. bindALLFunctions(); is used to re-call all the triggers and functions after the ajax call. It works all fine and good as expected. However, I have read somewhere that is

Refreshing Owl Carousel 2

人走茶凉 提交于 2019-12-04 04:57:02
I have 3 divs that activate slide toggle when I click on them. And inside every div there is owl carousel slider. If I trigger one div the slider shows, but when I click other div slider doesn't show unless I resize the window. How can I trigger refresh on slide toggle for the slider in every div? I tried with this on slide toggle but it doesn't work: $('.owl-slider').trigger('refresh.owl.carousel'); egvrcn You trigger with a class. You can try with a variable: var $owl = $('.owl-carousel').owlCarousel({ items: 1, loop:true }); $owl.trigger('refresh.owl.carousel'); 来源: https://stackoverflow

Use EventTrigger on a specific key

给你一囗甜甜゛ 提交于 2019-12-03 05:46:37
I would like to invoke a command using EventTrigger when a particular key is touched (for example, the spacebar key) Currently I have: <i:Interaction.Triggers> <i:EventTrigger EventName="KeyDown"> <i:InvokeCommandAction Command="{Binding DoCommand}" CommandParameter="{BindingText}"/> </i:EventTrigger> </i:Interaction.Triggers> Now how can I specify that this should occur only when the KeyDown occurs with the spacebar? You would have to build a custom Trigger to handle that: public class SpaceKeyDownEventTrigger : EventTrigger { public SpaceKeyDownEventTrigger() : base("KeyDown") { } protected

WPF - Trigger to change Foreground and Background of multiple Button's object

拜拜、爱过 提交于 2019-12-02 10:54:48
I am trying to do a RoutedEvent to activate ColorAnimation over a TextBlock and a Panel inside Buttons . My goal is to change the TextBlock's Foreground and the Panel's Background when using the MouseEnter and MouseLeave RoutedEvents. The below code is actually working. But it works only when the mouse cursor is over one of these two objects (which makes sense). I can't figure what should I do to activate both ColorAnimations when the mouse is over the Button (specially if it is not over the Panel or the TextBlock ) Here is an example of how the button looks like normal: This is how the button

How to trigger('click') on jquery tab's currently active tab

流过昼夜 提交于 2019-12-01 16:43:41
I have a tabed screen and want to trigger a click on the selected tab once the form is submitted and the return is valid. Here a part of the html: <ul id="tabUL" class="tabs js-tabs same-height"> <li class="current"> <a class="tabLink" href="#tabProducts" data-url="/bla/bla">Products</a> </li> </ul> My success command is : success: function(data, textStatus, XMLHttpRequest) { $('#tabUL').find('li.current a').trigger('click'); } This seems not working... Any help is appreciated :) Regards Andrea Try using the a[href=""] selector: $('#tabUL a[href="#tabProducts"]').trigger('click'); I put

TreeViewItem.Expanded

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 10:57:01
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}" /> </StackPanel> <HierarchicalDataTemplate.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding

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

北城余情 提交于 2019-12-01 10:12:26
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 returned to its collapsed state. <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"