I posted a question yesterday but I think I failed to explain it correctly.
Let me try again.
So this is my goal:
that would be my dirty working example
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var l = new List();
for(int i=0;i<5;i++)
{
l.Add(new lItem(true,"aaa"+i));
l.Add(new lItem(false,"bbb"+i));
}
sads.ItemsSource = l;
}
}
public class lItem
{
public string Text { get; set; }
public Brush Color { get; set; }
public HorizontalAlignment alig { get; set; }
public lItem(bool ss, string str)
{
Text = str;
Color = Brushes.Blue;
alig = HorizontalAlignment.Right;
if (ss)
{
Color = Brushes.Red;
alig = HorizontalAlignment.Left;
}
}
}
i would recommend to use trigger instead of define visual parts in your ViewModel