CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

TriggerAction on Page events?

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 1 Reply | 2 Followers

Top 150 Contributor
60 Posts
Ranjini posted on Tue, Aug 17 2010 9:49 AM

Hi -

 I am trying to get an event to fire via ViewModel when navigating away from a page and I did the following...

<navigation:Page xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:this="clr-namespace:DataOnline.RAM.DOLWebApp"  xmlns:csla ="clr-namespace:Csla.Xaml;assembly=Csla.Xaml" xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:navigation ="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" x:Class="DataOnline.RAM.DOLWebApp.Views.Systems" x:Name="SystemPage" >

<navigation:Page.Resources>

        <this:StatusViewModel x:Key="mySystemViewModel"/>

</navigation:Page.Resources>

 

<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource mySystemViewModel }}">

<csla:TriggerAction x:Name="StopTimerTrigger" MethodName="KillTimer" TriggerEvent="NavigatedFrom" TargetControl="{Binding ElementName =SystemPage}"/>

</Grid>

</navigation:Page>

 

public void KillTimer(object sender, Csla.Xaml.ExecuteEventArgs e)

{

}

 

 

The event “KillTimer” doesn’t get fired and I am wondering why.. Any ideas??

 Thanks

Ranjini

 

Ranjini Suryanarayanan

All Replies

Top 10 Contributor
9,282 Posts

I've never tried attaching a TriggerAction to the actual form/window/page. Maybe it just doesn't work to do that.

You might try stepping through the code in TriggerAction that sets and finds the source to see if it is able to find the source and set up the event handler - it is quite possible that this doesn't work for some reason.

Rocky

Page 1 of 1 (2 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems