WPFControls | WPF Controls
kandi X-RAY | WPFControls Summary
kandi X-RAY | WPFControls Summary
WPFControls contains some simple controls which can be used in WPF projects. Their usage is best described by the tests which are included in the project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WPFControls
WPFControls Key Features
WPFControls Examples and Code Snippets
Community Discussions
Trending Discussions on WPFControls
QUESTION
I hope someone is able to assist here, either to advise how to fix what I have or to suggest a better way of achieving what I'm after.
I have a simple custom control on which I want to be able to start/stop/pause/resume an opacity animation. I've looked at various solutions and figured that using EventTrigger
with a custom RoutedEvent
was the way forward. I can get the following to work with a standard event (eg MouseDown
) but am unable to get my custom event to start the storyboard.
I tried raising the event in the constructor prior to doing it in a loaded event, but neither makes any difference.
I don't think it has any relevant impact but this is also being hosted in an ElementHost
for winforms.
xaml:
...ANSWER
Answered 2020-Mar-11 at 08:39Two issues.
- You are listening exclusively to
EventTrigger.SourceName="fraxCanvas"
, but the event is raised somewhere else (parentUserControl
).
EventTrigger.SourceName
is a filter property, which allows to exclusively handle a Routed Event of a specific element. If you don't setEventTrigger.SourceName
, the trigger will handle the specified event, no matter the source. - The Routed Event will never reach the
FraxCanvas
element, because a parent raised it.
RoutingStrategy.Bubble
: event travels from event source, theFraxIconX
element, to the visual tree root e.g.,Window
.
RoutingStrategy.Tunnel
: event travels from the tree root e.g.,Window
and stops at the event source, theFraxIconX
element.
The solution is to remove the EventTrigger.SourceName
attribute and move the trigger to the event source (the UserControl
) or to any of the event source's parent element:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WPFControls
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page