tags:

views:

8

answers:

0

Hi!

I have a DLL assembly referenced into my project, this is a snapcode about a dependencyProperty named EsRegistroNuevo.

namespace App_WpfResources
{
    public class App_PageKernel : PageFunction<object>
    {
public static readonly DependencyProperty EsRegistroNuevoProperty = DependencyProperty.Register("EsRegistroNuevo", typeof(bool), typeof(App_PageKernel));

        public bool EsRegistroNuevo
        {
            get { return (bool)GetValue(EsRegistroNuevoProperty); }
            set { SetValue(EsRegistroNuevoProperty, value); }
        }

MY main project can set EsRegistroNuevo = [true/false]; (this is a boolean property to set NewRecord state) and this main project has a details panel with textboxes. My intention is when I click on NewRecord Button, all textboxes got Empty automatically, so I made something like this:

kernel:App_PageKernel x:Class="Solar.Formularios.Administracion.Sistema.frmModulos"
...
    xmlns:kernel="clr-namespace:App_WpfResources;assembly=App_WpfResources" 
xmlns:wex="clr-namespace:Wex.Lib.Interactions;assembly=Wex.Lib"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
....
            i:Interaction.Triggers>
                wex:EventTrigger ElementName="btnInsertar" EventName="Click">
                    wex:PropertyAction Property="Text" Value="" TargetName="txtEjecutable">
                        wex:PropertyAction.Conditions>
                            wex:InvokingConditions>
                                wex:InvokingCondition Property="kernel:App_PageKernel.EsRegistroNuevoProperty" Value="True"/>
                            wex:InvokingConditions>
                        wex:PropertyAction.Conditions>
                    wex:PropertyAction>
                wex:EventTrigger>
             i:Interaction.Triggers>
StackPanel x:Name="pnlBarraHerramientasDetalle" Height="55" Margin="0,0,3,0" Width="416">
                        ToolBar x:Name="tlbDetalle" Orientation="Horizontal" OverflowButtonVisibility="Hidden" Height="54" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BorderBrush="#FFE9F2FF" BorderThickness="1" HorizontalAlignment="Right" Width="413">
                            Button x:Name="btnInsertar" Tag="btnInsertar" Click="btnToolBar_Click">
                                Image Source="/App_LocalResources/Imagenes/HojaNueva.png" Stretch="UniformToFill" Height="41" Width="41" />
                            </Button>
                        /ToolBar>
                    /StackPanel>
Grid x:Name="pnlDetalle" Height="249" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                        Grid Height="39" Margin="38,18,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="159">
                        TextBox x:Name="txtEjecutable" Style="{StaticResource Estilo1TextBox}" HorizontalAlignment="Left" Margin="102,121,0,0" TextWrapping="Wrap" VerticalAlignment="Top" TabIndex="2" Width="301" Height="27"/>

My point is: wex:EventTrigger ElementName="btnInsertar" EventName="Click"> Catch Event Clik when button is pressed. this code:
                    wex:PropertyAction Property="Text" Value="" TargetName="txtEjecutable">
                        wex:PropertyAction.Conditions>
                            wex:InvokingConditions>
                                wex:InvokingCondition Property="kernel:App_PageKernel.EsRegistroNuevoProperty" Value="True"/>

Evaluates if kernel:App_PageKernel.EsRegistroNuevoProperty is true, then txtEjecutable is empty. But this is not working. I need help

thanks