diff options
author | Paulius Klezys <paul4618@edu.easj.dk> | 2017-05-22 11:20:29 +0200 |
---|---|---|
committer | Paulius Klezys <paul4618@edu.easj.dk> | 2017-05-22 11:20:29 +0200 |
commit | 27515d443a8eab66f4195490a989f0be6561ff45 (patch) | |
tree | 2373f5d30a898ad016772c99fbe9bcb5a3003a61 | |
parent | cec5a430e936133bc44fa7c571ccf8077a0babd4 (diff) |
Cykavej 78
-rw-r--r-- | ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml | 6 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml index 49923cf..a6aec28 100644 --- a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml +++ b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml @@ -14,17 +14,21 @@ </Page.DataContext> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <StackPanel Margin="0 0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="top" Width="1100" > <StackPanel Orientation="Vertical"> <!--<Image Source="ms-appx:///Assets/plan.jpg" HorizontalAlignment="Left" Margin="0 0" Width="600"></Image>--> <Frame Background="Bisque"> - <ListView HorizontalAlignment="Left" VerticalAlignment="Top" Width="1100" ItemsSource="{Binding BoardMemberCatalogSingleton.Apartment}" SelectedItem="{Binding NewApartment, Mode=TwoWay}" Height="567"/> + <ListView FontSize="20" FontWeight="Bold" FontFamily="Georgia" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1100" ItemsSource="{Binding BoardMemberCatalogSingleton.Apartment}" SelectedItem="{Binding NewApartment, Mode=TwoWay}" Height="567"/> + </Frame> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0"> <Button Width="150" Margin="50 0" Content="View residents" Click="ButtonBase_OnClick"></Button> <Button Width="150" Content="Add apartment" Click="CreateApartment" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> <Button Width="150" Margin="50 0" Content="Delete apartment" Command="{Binding DeleteApartmentCommand}" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> <Button Width="150" Content="Update apartment" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> + <TextBox Width="150" Text="Filter apartments" Margin="50 0" Name="TextFilter"> </TextBox> + </StackPanel> </StackPanel> diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs index e275537..81fa3a8 100644 --- a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; @@ -12,6 +13,7 @@ using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; +using ApartmentManager.Model; // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 @@ -36,5 +38,18 @@ namespace ApartmentManager.View { this.Frame.Navigate(typeof(BoardMemberCreateApartmentPage)); } + + private bool ApartmentFilter(object item) + { + if (String.IsNullOrEmpty(TextFilter.Text)) + return true; + else + return ((item as Apartment).BoardMemberCatalogSingleton.IndexOf(TextFilter.Text, StringComparison.OrdinalIgnoreCase) >= 0); + } + + private void txtFilter_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) + { + CollectionViewSource.GetDefaultView(lvUsers.ItemsSource).Refresh(); + } } } |