Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Tue, 17 Jun 2008 15:22:54 +0200,    group: microsoft.public.windows.developer.winfx.avalon        back       


Accessing EventArgs of RoutedEvent in XAML   
Hi,

I'm relatively new to XAML, so please bear with me if I'm what I'm planning
to do is stupid. I'm not a big fan (yet) of the rather crazy syntax,
especially when using {binding} and name:spaces. But I like the strict
separation of logic and UI and would like to continue doing it that way.

I'm firing a custom RoutedEvent from my Window class and use this as an
event trigger in the XAML code. This works fine so far:

<EventTrigger RoutedEvent="foo:Window3.BarEvent">
   <EventTrigger.Actions>
      <BeginStoryboard>
         ...

I'm doing this to display an error message under certain conditions
(showing a big red and blinking panel to the user).

What I've not found out is how one can use the event args of the
RoutedEvent in the XAML code. I would like to pass the error message as a
parameter to that event, so the trigger can assign it to the text property
of a label control (probably by using an ObjectAnimationBase derived
animation). What I'm having in mind is something like this:

<EventTrigger RoutedEvent="foo:Window3.BarEvent">
   <EventTrigger.Actions>
      <BeginStoryboard>
         <Storyboard Duration="00:00:10">
            <ObjectAnimationUsingKeyFrames
Storyboard.TargetName="SomeLabel" Storyboard.TargetProperty="Text">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00"
Value="{BarEventArgs:ErrorMessage}" />
 			
However, I have not found a way to access the arguments passed to the
RoutedEvent in XAML code.

I'd appreciate any suggestions...

Thanks!
Jens
date: Tue, 17 Jun 2008 15:22:54 +0200   author:   Jens Weiermann

Re: Accessing EventArgs of RoutedEvent in XAML   
As a follow up to my own post: is this the right group to ask such
questions? I'm wondering because noone answered what I'd considered an easy
question...

Jens
date: Mon, 30 Jun 2008 13:33:43 +0200   author:   Jens Weiermann

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us