This question is locked. New answers and comments are not allowed.
I'm not sure if this is a telerik issue or just me being new and dumb to WP7....
problem: I need to display a list of validation error objects inside a rad window when a user doesn't fill in a form properly. The radwindow appears blank.
here is the xaml
and the method from the cs page....
problem: I need to display a list of validation error objects inside a rad window when a user doesn't fill in a form properly. The radwindow appears blank.
here is the xaml
<telerikPrimitives:RadWindow x:Name="window" WindowSizeMode="FitToPlacementTarget" > <Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="{StaticResource PhoneBorderThickness}"> <Grid Background="{StaticResource PhoneBackgroundBrush}"> <TextBlock Style="{StaticResource PhoneTextSmallStyle}" HorizontalAlignment="Left" Margin="27,128,0,0" Text="" Name="tbError" VerticalAlignment="Top" Foreground="#FF035D82" TextAlignment="Center" TextWrapping="Wrap"/> <ListBox x:Name="lbErrors" Margin="0,0,-12,0" ItemsSource="{Binding valErrors}" > <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,17" Width="432" Orientation="Vertical"> <TextBlock x:Name="tbErrorMessage" Text="{Binding ErrorMessage}" Margin="12,-6,12,0" TextAlignment="Left" Style="{StaticResource PhoneTextSubtleStyle}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <Button Content="ok" Click="CloseWindowClick" HorizontalAlignment="Center" VerticalAlignment="Bottom"/> </Grid> </Border> </telerikPrimitives:RadWindow>and the method from the cs page....
public Registration(){ InitializeComponent(); DataContext = App.vmvalError;}}private bool FormIsValid() { bool isValid = true; List<valError> strErrors = new List<valError>(); if (!(txtFirstName.Text.Length > 1) || !(txtLastName.Text.Length > 1)) { strErrors.Add(new valError("You must enter a first and last name.")); isValid = false; } if (!txtEmail.Text.Contains("@") || !txtEmail.Text.Contains(".") || !(txtEmail.Text.Length < 5)) { strErrors.Add(new valError("You must enter a valid email address.")); isValid = false; } if (!(txtUsername.Text.Length > 7) || !(pbPassword.Password.Length > 7) || !ContainsNumberAndLetter(txtUsername.Text) || !ContainsNumberAndLetter(pbPassword.Password)) { strErrors.Add(new valError("Your username and password most both contain at least 8 characters.")); isValid = false; } tbError.Text = ""; if (isValid == false) { this.window.IsOpen = true; lbErrors.DataContext = strErrors; } else { this.window.IsOpen = false; } return isValid; }