Not working

Oct 25, 2011 at 4:44 PM

I can not get this validation to work. Here the xaml and code behind. I appreacate any help.

<controls:ChildWindow x:Class="AUBPO.Innovation.Views.EditInnocationChildWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
          xmlns:slv="clr-namespace:Silverlight.Validators;assembly=Silverlight.Validators"
           xmlns:slvf="clr-namespace:Silverlight.Validators.Filters;assembly=Silverlight.Validators"
           Width="800" Height="500" 
           Title="Edit Innovation">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <slv:ValidatorManager x:Name="Group1"></slv:ValidatorManager>
        <Image Source="../Assets/Images/vine cut out low res.jpg" Margin="0,-37,0,0" Height="350.924438476562" VerticalAlignment="Top" />
        <StackPanel x:Name="editStackPanel" Margin="0,20,0,0" Orientation="Vertical" Visibility="Visible" Background="Transparent">
            <StackPanel.Projection>
                <PlaneProjection/>
            </StackPanel.Projection>
            
            
            <ScrollViewer VerticalScrollBarVisibility="Auto" Height="370" Margin="25" Background="#D8FFFFFF">
                <Grid>
                    <Grid.RowDefinitions>
-- Removed to make shorter
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                    </Grid.ColumnDefinitions>
                    
                    <TextBlock  Text="ID:" Style="{StaticResource StandardText}"/>
                    <TextBlock Text="{Binding ID}" Grid.Row="0" Grid.Column="1" Style="{StaticResource StandardText}" />

                    <TextBlock Text="Project Name:" Grid.Row="1" Grid.Column="0" Style="{StaticResource StandardText}" />
                        


                    <TextBox x:Name="txtProjectName" Text="{Binding ProjectName, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Style="{StaticResource StandardTextBox}" Margin="2">
                        <slv:ValidatorService.Validator>
                            <slv:RequiredValidator x:Name="txtProjectName_Validator" IsRequired="True" ManagerName="Group1" ErrorMessage="This field is required"/>
                        </slv:ValidatorService.Validator>
                    </TextBox>
I have only included the xaml file partially, In the code behinde I have the code to Group1.ValidateAll then check the count if > 0
When there is no text in ProjectName field, the validation does not indicate it is a required field.
I suspect that its because the Manager is not in the Layout root, is this the case? I did try moving this field and the manager to the layout root but the result was the same.