aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <marcin@zelent.net>2017-05-22 13:01:11 +0200
committermarcinzelent <marcin@zelent.net>2017-05-22 13:01:11 +0200
commit39fe1dc499fa653c37f31b59a237afd806f8996c (patch)
treef473d9bc4c2e4ff67e769133cd0f4bee401371bc
parentb9aa21de49f96aa2e951aeec702dc3d16368351b (diff)
parent60385d4477827ed0c75ff2f3800a5c0a7b60ec4d (diff)
Merge branch 'master' of https://github.com/marcinzelent/ApartmentAdmin
-rw-r--r--ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml6
-rw-r--r--ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs15
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();
+ }
}
}