Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerable<LibraryViewModel> Libraries {
- get {
- if (!string.IsNullOrEmpty(this.LibrarySearchString))
- return _libraries.Where(lib => IsLibraryMatch(lib, this.LibrarySearchString));
- else
- return _libraries.OrderBy(lib => !lib.IsFavourite);
- }
- }
- <con:FilterListBox Grid.Row="1"
- ItemsSource="{Binding Libraries}"
- SelectedItem="{Binding SelectedLibrary}"
- ItemTemplate="{StaticResource
- LibraryItemTemplate}"
- SearchString="{Binding LibrarySearchString, Mode=TwoWay}"
- IsSearching="False"
- Margin="4"/>
- <Style x:Key="{x:Type con:FilterListBox}" TargetType="{x:Type con:FilterListBox}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type con:FilterListBox}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0">
- <TextBlock Text="Search"
- VerticalAlignment="Center"/>
- <TextBox Text="{Binding RelativeSource={RelativeSource TemplatedParent},
- Path=SearchString,
- UpdateSourceTrigger=PropertyChanged}"
- Margin="4,0,0,0"/>
- </DockPanel>
- <ScrollViewer Grid.Row="1" CanContentScroll="True">
- <StackPanel IsItemsHost="True"
- HorizontalAlignment="Stretch"/>
- </ScrollViewer>
- <TextBlock Grid.Row="1"
- Text="Searching..."
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Visibility="{Binding RelativeSource={RelativeSource TemplatedParent},
- Path=IsSearching,
- Converter={StaticResource CollapsedIfFalseConverter}}"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
Add Comment
Please, Sign In to add comment