I am trying to bind the foreground of list box item to a method My XAML is <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:Windows="clr-namespace:System.Windows;assembly=PresentationCore" Title="SelectWindow" Height="300" SizeToContent="Width"> <Window.Resources> <ObjectDataProvider x:Key="SetForeground" ObjectType="{x:Type Colors}" IsAsynchronous="True" MethodName="SetForground"> </ObjectDataProvider> <!-- <local:SetForegroundColor x:Key="SetForegroundColor"/> --> <Style TargetType="ListBoxItem"> <Setter Property="Foreground" Value="Blue"/> <Style.Triggers> <Trigger Property="IsSelected" Value="true"> <Setter Property="Foreground" Value="{Binding Source={StaticResource SetForeground}}"/> </Trigger> </Style.Triggers> </Style> </Window.Resources> And in the class I have a method named SetForeground that returns a Brush I get an exception (but it does not say what king of exception) Can you tell me what wrong Ilan Hindy e-mail : hindy.i...@gmail.com celular : +972-54-4292112 home : +972-9-9570521
_______________________________________________ Ironpython-users mailing list Ironpython-users@python.org https://mail.python.org/mailman/listinfo/ironpython-users