This is bit different requirement.
Need to set the background color of grid with alternate colors. These colors are need to be set in Resource dictionary. and then used in .vb code. How to do this.
This is how I approched.
In resource disctionary
<SolidColorBrush x:Key="oddrow" Color="Yellow"/>
<SolidColorBrush x:Key="Evenrow" Color="blue"/>
Dim OddRowColor As New SolidColorBrush
Dim EvenRowColor As New SolidColorBrush
OddRowColor.Color = App.Current.Resources("oddrow")
EvenRow.Color = App.Current.Resources("Evenrow")
(This doesnot work , it throws error)
These colors will be used in below condition
Grid.Background = IIf(some conditions, E