my code works but im getting this error can someone explain what it means. Thanks in advance
------------------------------------------------------------(Xaml)
<Window x:Class="DateBinding.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:loc="clr-namespace:DateBinding"
Title="Window1" Height="450" Width="300">
<Window.Resources>
<loc:DateConverter x:Key="dteConverter"/>
<loc:DateColorConverter x:Key="DteColConverter"/>
<BooleanToVisibilityConverter x:Key="boolVisConverter"/>
<loc:Txt2LenConverter x:Key="txt2lenConverter"/>
<loc:DayWeekToOpacityConverter x:Key="dwToOpacityConverter"/>
</Window.Resources>
<StackPanel>
<Slider Name="slDate" Maximum="20" SmallChange="1" Margin="3"/>
<TextBox Name="txtDate" VerticalAlignment="Top" FontSize="28" Margin="3" Padding="3,0,0,0" Background="{Binding Text, Converter={StaticResource DteColConverter}, ElementName=txtDate,
Mode=OneWay}">
<TextBox.Text>
<Binding ElementName="slDate" Path="Value" Mode="OneWay" Converter="{StaticResource dteConverter}"/>
</TextBox.Text>
</TextBox>
<CheckBox Name="chkPicture" Content="Check for Photo" IsChecked="True"/>
<Image Source="Penguins.jpg" Visibility="{Binding ElementName=chkPicture, Path=IsChecked, Converter={StaticResource boolVisConverter}}"
Opacity="{Binding Text, ElementName=txtDate, Converter={StaticResource dwToOpacityConverter}}"/>
<TextBox Name="txtLen" FontSize="30" Text="Initial"/>
<ProgressBar Height="10" Value="{Binding ElementName=txtLen, Path=Text, Converter={StaticResource txt2lenConverter}}"/>
</StackPanel>
</Window>
--------------------------------------------------------------(xaml)
-----------------------------------------------------------------(code behind)
namespace DateBinding
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
}
}
------------------------------------------------------------(code behind)
-----------------------------------------------------------(date converter)
namespace DateBinding
{
public class DateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime d = DateTime.Now;
d = d.AddDays((Double)value);
return d.ToShortDateString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} // end DateConverter
public class DateColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime d;
if (!DateTime.TryParse((string)value, out d))
//return new SolidColorBrush(Colors.WhiteSmoke);
//return new SolidColorBrush(Color.FromArgb(255, 255, 255, 0));
return new SolidColorBrush(Colors.Wheat);
if (d.DayOfWeek == DayOfWeek.Saturday || d.DayOfWeek == DayOfWeek.Sunday)
return new SolidColorBrush(Color.FromArgb(255, 155, 0, 55));
return new SolidColorBrush(Colors.Aquamarine);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class Txt2LenConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string str = (string)value;
return str.Length * 2;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class DayWeekToOpacityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime d;
DateTime.TryParse((string)value, out d);
return (float)d.DayOfWeek / 10;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
-------------------------------------------------------------(dateConverter)