This is how my Model looks like:
public class MyModel
{
public string Title { get; set; }
public string BriefDescription { get; set; }
public bool IsDirty { get; set; }
}
I have a property in my ViewModel
that i am biding ListBox
with
public ObservableCollection<ROCategoryModel> MyCollection { get; set; }
This all works fine but i was wondering if i can refactor this a bit.
I have 2 Listboxes that can use the same Collection but display items based on IsDirty
property.
I can create 2 Collections but i think it will be a little overkill. I could be wrong here.
Is there a way i can specify a filter condition in my ListView binding?
This is how my Listview looks like:
<ListView Name="lvwAvailableCollection" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding Path=MyCollection}" IsSynchronizedWithCurrentItem="True" AlternationCount="2" MaxHeight="300" >
<ListView.View>
<GridView>
<GridViewColumn Width="175" Header="Title" DisplayMemberBinding="{Binding Title}" />
<GridViewColumn Width="200" Header="Description" DisplayMemberBinding="{Binding BriefDescription}" />
</GridView>
</ListView.View>
</ListView>