diff options
| author | Donatas Adamonis <dona0169@edu.easj.dk> | 2017-05-31 10:50:21 +0200 |
|---|---|---|
| committer | Donatas Adamonis <dona0169@edu.easj.dk> | 2017-05-31 10:50:21 +0200 |
| commit | aa4a3fc2f1146b8c2342706e46db8e5c5e358ca9 (patch) | |
| tree | 2944148e224bb6fadeaa08fe64563424dca334c8 | |
| parent | a085e2e12dacc41f3946c50d1d84de58d7ea4ad0 (diff) | |
apartment changes
20 files changed, 765 insertions, 97 deletions
diff --git a/ApartmentManager/ApartmentManager/ApartmentManager.csproj b/ApartmentManager/ApartmentManager/ApartmentManager.csproj index 426f616..d9da403 100644 --- a/ApartmentManager/ApartmentManager/ApartmentManager.csproj +++ b/ApartmentManager/ApartmentManager/ApartmentManager.csproj @@ -131,12 +131,21 @@ <Compile Include="ViewModel\BmDefectsViewModel.cs" /> <Compile Include="ViewModel\ApartmentViewModel.cs" /> <Compile Include="ViewModel\LoginViewModel.cs" /> + <Compile Include="View\ApartmentChangesPage.xaml.cs"> + <DependentUpon>ApartmentChangesPage.xaml</DependentUpon> + </Compile> + <Compile Include="View\ApartmentChangesViewPage.xaml.cs"> + <DependentUpon>ApartmentChangesViewPage.xaml</DependentUpon> + </Compile> <Compile Include="View\ApartmentDefectPage.xaml.cs"> <DependentUpon>ApartmentDefectPage.xaml</DependentUpon> </Compile> <Compile Include="View\ApartmentDefectViewPage.xaml.cs"> <DependentUpon>ApartmentDefectViewPage.xaml</DependentUpon> </Compile> + <Compile Include="View\ApartmentNewChangePage.xaml.cs"> + <DependentUpon>ApartmentNewChangePage.xaml</DependentUpon> + </Compile> <Compile Include="View\ApartmentNewDefect.xaml.cs"> <DependentUpon>ApartmentNewDefect.xaml</DependentUpon> </Compile> @@ -223,6 +232,14 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="View\ApartmentChangesPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="View\ApartmentChangesViewPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="View\ApartmentDefectPage.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -231,6 +248,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="View\ApartmentNewChangePage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="View\ApartmentNewDefect.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index c5fcfe5..6da842b 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -102,7 +102,7 @@ namespace ApartmentManager new NavMenuItem() { Symbol = Symbol.Bookmarks, - Label = "Changes", + Label = "ApartmentChanges", DestPage = typeof(BmChangesPage), IsSelected = false } diff --git a/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs b/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs index 41b9cda..b5ea6d2 100644 --- a/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs @@ -79,7 +79,7 @@ namespace ApartmentManager.Handler } if (!string.IsNullOrEmpty(resident.FirstName) && !string.IsNullOrEmpty(resident.LastName)) { - var response = ApiClient.PostData("api/residents/", resident); + var response = ApiClient.PostData("api/residents/", resident); } GetApartmentResidents(); } @@ -194,9 +194,9 @@ namespace ApartmentManager.Handler { try { - if (ApartmentViewModel.NewDefect.Pictures == null) ApartmentViewModel.NewDefect.Pictures = new ObservableCollection<DefectPicture>(); + if (ApartmentViewModel.NewDefect.Pictures == null) ApartmentViewModel.NewDefect.Pictures = new ObservableCollection<DefectPicture>(); var picture = new DefectPicture() { Picture = await ImgurPhotoUploader.UploadPhotoAsync() }; - ApartmentViewModel.NewDefect.Pictures.Add(picture); + ApartmentViewModel.NewDefect.Pictures.Add(picture); } catch (Exception e) { @@ -226,7 +226,7 @@ namespace ApartmentManager.Handler { new MessageDialog(e.Message).ShowAsync(); } - + } /////////////////////////////////////////////////////////////////////////////////////////////////// public bool CreateDefect_CanExecute() @@ -235,7 +235,7 @@ namespace ApartmentManager.Handler return false; else return true; - } + } /////////////////////////////////////////////////////////////////////////////////////////////////// public void CreateDefectComment() { @@ -262,8 +262,109 @@ namespace ApartmentManager.Handler catch (Exception e) { new MessageDialog(e.Message).ShowAsync(); - } + } } - /////////////////////////////////////////////////////////////////////////////////////////////////// + /// <summary> + /// Defect HANDLERS + /// </summary> + public void GetApartmentChanges() + { + ApartmentChange change = new ApartmentChange(); + change.ApartmentId = ApartmentViewModel.UserSingleton.CurrentUser.ApartmentId; + var changesFromDatabase = ApiClient.GetData("api/ApartmentChangesByid/" + change.ApartmentId); + var changeslist = JsonConvert.DeserializeObject<ObservableCollection<ApartmentChange>>(changesFromDatabase); + CatalogSingleton.Instance.ApartmentChanges.Clear(); + foreach (var apartmentChange in changeslist) + { + apartmentChange.Documents = JsonConvert.DeserializeObject<ObservableCollection<ChangeDocument>>(ApiClient.GetData("api/ChangeDocumentsById/" + apartmentChange.ChangeId)); + apartmentChange.Comments = JsonConvert.DeserializeObject<ObservableCollection<ChangeComment>>(ApiClient.GetData("api/ChangeCommentsById/" + apartmentChange.ChangeId)); + CatalogSingleton.Instance.ApartmentChanges.Add(apartmentChange); + } + } + public void CreateChangeComment() + { + try + { + ChangeComment Comment = new ChangeComment(); + Comment.Comment = ApartmentViewModel.NewChangeComment.Comment; + Comment.ChangeId = CatalogSingleton.Instance.SelectedChange.ChangeId; + Comment.Name = UserSingleton.Instance.CurrentUser.FirstName + " " + UserSingleton.Instance.CurrentUser.LastName; + Comment.Date = DateTimeOffset.Now; + if (!string.IsNullOrEmpty(Comment.Comment)) + { + var asd =ApiClient.PostData("api/ChangeComments/", Comment); + } + var response = ApiClient.GetData("api/ChangeCommentsById/" + CatalogSingleton.Instance.SelectedChange.ChangeId); + var commentlist = JsonConvert.DeserializeObject<ObservableCollection<ChangeComment>>(response); + + CatalogSingleton.Instance.SelectedChange.Comments.Clear(); + foreach (var comment in commentlist) + { + CatalogSingleton.Instance.SelectedChange.Comments.Add(comment); + } + } + catch (Exception e) + { + new MessageDialog(e.Message).ShowAsync(); + } + } + public void DeleteChangePicture() + { + try + { + ApartmentViewModel.NewChange.Documents.Remove(ApartmentViewModel.SelectedChangeDocument); + } + catch (Exception e) + { + new MessageDialog(e.Message).ShowAsync(); + } + } + public async void UploadChangePicture() + { + try + { + if (ApartmentViewModel.NewChange.Documents == null) ApartmentViewModel.NewChange.Documents = new ObservableCollection<ChangeDocument>(); + var picture = new ChangeDocument() { Document = await ImgurPhotoUploader.UploadPhotoAsync() }; + ApartmentViewModel.NewChange.Documents.Add(picture); + } + catch (Exception e) + { + new MessageDialog(e.Message).ShowAsync(); + } + } + public void CreateChange() + { + try + { + ApartmentChange change = ApartmentViewModel.NewChange; + change.ApartmentId = ApartmentViewModel.UserSingleton.CurrentUser.ApartmentId; + change.Status = "New"; + change.UploadDate = DateTime.Now; + var response = ApiClient.PostData("api/ApartmentChanges/", change); + var changeResponse = JsonConvert.DeserializeObject<ApartmentChange>(response); + change.ChangeId = changeResponse.ChangeId; + if (change.Documents !=null) + { + foreach (var document in change.Documents) + { + document.ChangeId = change.ChangeId; + ApiClient.PostData("api/ChangeDocuments/", document); + } + } + GetApartmentChanges(); + } + catch (Exception e) + { + new MessageDialog(e.Message).ShowAsync(); + } + } + public bool CreateChange_CanExecute() + { + if (string.IsNullOrEmpty(ApartmentViewModel.NewChange.Description) || string.IsNullOrEmpty(ApartmentViewModel.NewChange.Name)) + return false; + else + return true; + } + } } diff --git a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs index 9f52a40..9360f97 100644 --- a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs @@ -93,6 +93,7 @@ namespace ApartmentManager.Handler avm.ApartmentHandler.GetApartmentResidents(); avm.ApartmentHandler.GetApartment(); avm.ApartmentHandler.GetApartmentDefects(); + avm.ApartmentHandler.GetApartmentChanges(); appShell.AppFrame.Navigate(typeof(ApartmentPage)); } } diff --git a/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs index a05c01a..ee101c6 100644 --- a/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs @@ -18,13 +18,18 @@ namespace ApartmentManager.Singletons public ObservableCollection<Resident> Residents { get; set; } ////////// For Defects ////////// public ObservableCollection<Defect> Defects { get; set; } + public ApartmentChange SelectedChange { get; set; } + ////////// For Defects ////////// + public ObservableCollection<ApartmentChange> ApartmentChanges { get; set; } public Defect SelectedDefect { get; set; } ////////// Constructor ////////// private CatalogSingleton() - { + { + ApartmentChanges = new ObservableCollection<ApartmentChange>(); Residents = new ObservableCollection<Resident>(); Defects = new ObservableCollection<Defect>(); - SelectedDefect = new Defect(); + SelectedDefect = new Defect(); + SelectedChange = new ApartmentChange(); } } } diff --git a/ApartmentManager/ApartmentManager/View/ApartmentChangesPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentChangesPage.xaml new file mode 100644 index 0000000..9a7ddb1 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/ApartmentChangesPage.xaml @@ -0,0 +1,124 @@ +<Page + x:Class="ApartmentManager.View.ApartmentChangesPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:ApartmentManager.View" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:viewModel="using:ApartmentManager.ViewModel" + mc:Ignorable="d"> + + <Page.DataContext> + <viewModel:ApartmentViewModel/> + </Page.DataContext> + + <Page.BottomAppBar> + <CommandBar> + <CommandBar.Content> + <Grid /> + </CommandBar.Content> + <AppBarButton + Icon="Add" + Label="Create Defect" Click="GotoNewChangePage"> + </AppBarButton> + </CommandBar> + </Page.BottomAppBar> + + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <Grid.RowDefinitions> + <RowDefinition Height="45"/> + <RowDefinition/> + </Grid.RowDefinitions> + + <TextBlock Grid.Row="0" + HorizontalAlignment="Center" + FontSize="30" + FontWeight="Bold" + Text="Apartment Defects"> + </TextBlock> + + <ListView ItemsSource="{Binding CatalogSingleton.ApartmentChanges}" SelectedItem="{Binding CatalogSingleton.SelectedChange, Mode=TwoWay}" Grid.Row="1" Background="LightGray" SelectionChanged="GotoApartmentChangeViewPage"> + <ListView.ItemContainerStyle> + <Style TargetType="ListViewItem"> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + </Style> + </ListView.ItemContainerStyle> + + + <ListView.ItemTemplate> + <DataTemplate> + <Grid Height="200" BorderThickness ="1" Margin="12,12,12,0" BorderBrush="#DFE0E4" Background="White" > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="300" /> + <ColumnDefinition/> + </Grid.ColumnDefinitions> + + <Image + Margin="5" + Source="{Binding Documents[0].Document}" + > + </Image> + + <StackPanel Grid.Column="1" Margin="10"> + + <StackPanel Orientation="Horizontal"> + <TextBlock + Margin="0,0,10,0" + FontSize="30" + FontWeight="Bold" + Text="Name :"> + </TextBlock> + <TextBlock + Margin="0,0,10,0" + FontSize="30" + Text="{Binding Name}"> + </TextBlock> + + </StackPanel> + + <StackPanel Orientation="Horizontal"> + <TextBlock + Width="800" + Height="108" + Margin="0,0,10,0" + FontSize="20" + Text="{Binding Description}" + TextWrapping="Wrap"> + </TextBlock> + </StackPanel> + + <StackPanel Orientation="Horizontal"> + <TextBlock + Margin="0,0,10,0" + FontSize="25" + FontWeight="Bold" + Text="Status :"> + </TextBlock> + <TextBlock + Margin="0,0,10,0" + FontSize="25" + Text="{Binding Status}"> + </TextBlock> + + <TextBlock + Margin="700,0,10,0" + HorizontalAlignment="Left" + FontSize="25" + FontWeight="Bold" + Text="Date Submitted :"> + </TextBlock> + + <TextBlock FontSize="25" Text="{Binding UploadDate.Year}" /> + <TextBlock FontSize="25" Text="-" /> + <TextBlock FontSize="25" Text="{Binding UploadDate.Month}" /> + <TextBlock FontSize="25" Text="-" /> + <TextBlock FontSize="25" Text="{Binding UploadDate.Day}" /> + </StackPanel> + </StackPanel> + </Grid> + </DataTemplate> + </ListView.ItemTemplate> + + </ListView> + </Grid> +</Page> diff --git a/ApartmentManager/ApartmentManager/View/ApartmentChangesPage.xaml.cs b/ApartmentManager/ApartmentManager/View/ApartmentChangesPage.xaml.cs new file mode 100644 index 0000000..c498d1d --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/ApartmentChangesPage.xaml.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ApartmentManager.View +{ + /// <summary> + /// An empty page that can be used on its own or navigated to within a Frame. + /// </summary> + public sealed partial class ApartmentChangesPage : Page + { + public ApartmentChangesPage() + { + this.InitializeComponent(); + } + + private void GotoApartmentChangeViewPage(object sender, SelectionChangedEventArgs e) + { + Frame.Navigate(typeof(ApartmentChangesViewPage)); + } + + private void GotoNewChangePage(object sender, RoutedEventArgs e) + { + Frame.Navigate(typeof(ApartmentNewChangePage)); + } + } +} diff --git a/ApartmentManager/ApartmentManager/View/ApartmentChangesViewPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentChangesViewPage.xaml new file mode 100644 index 0000000..5ec7b99 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/ApartmentChangesViewPage.xaml @@ -0,0 +1,147 @@ +<Page + x:Class="ApartmentManager.View.ApartmentChangesViewPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:viewModel="using:ApartmentManager.ViewModel" + mc:Ignorable="d"> + + <Page.DataContext> + <viewModel:ApartmentViewModel /> + </Page.DataContext> + + <Page.BottomAppBar> + <CommandBar> + <CommandBar.Content> + <Grid /> + </CommandBar.Content> + <AppBarButton + Icon="back" + Label="Create Defect" Click="GotoApartmentChangesPage" > + </AppBarButton> + </CommandBar> + </Page.BottomAppBar> + + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <ScrollViewer> + <StackPanel> + <StackPanel Margin="10,10,10,0" Orientation="Horizontal"> + <TextBlock + Margin="100,0,0,0" + FontSize="30" + FontWeight="Bold" + Text="Name :" /> + <TextBlock + Margin="10,0,0,0" + FontSize="30" + Text="{Binding CatalogSingleton.SelectedChange.Name}" /> + <TextBlock + Margin="700,0,0,0" + FontSize="30" + FontWeight="Bold" + Text="Status :" /> + <TextBlock + Margin="10,0,0,0" + FontSize="30" + Text="{Binding CatalogSingleton.SelectedChange.Status}" /> + </StackPanel> + <StackPanel Margin="20,0,20,20" Orientation="Horizontal"> + <StackPanel Width="620" Margin="0,50,0,0"> + <GridView + Width="500" + Height="420" + ItemsSource="{Binding CatalogSingleton.SelectedChange.Documents, Mode=TwoWay}"> + <GridView.ItemTemplate> + <DataTemplate> + <Image + Width="220" + Margin="10,0,10,10" + Source="{Binding Document}" /> + </DataTemplate> + </GridView.ItemTemplate> + + </GridView> + </StackPanel> + <StackPanel Width="620"> + <TextBlock + Margin="10,0,0,10" + FontSize="30" + FontWeight="Bold" + Text="Description" /> + <Grid BorderBrush="Black" BorderThickness="1"> + <TextBlock + Height="400" + Margin="10" + Text="{Binding CatalogSingleton.SelectedChange.Description, Mode=TwoWay}" + TextWrapping="WrapWholeWords" /> + </Grid> + + + </StackPanel> + + + </StackPanel> + <StackPanel Width="600" Margin="0,20,0,0"> + <TextBlock + Margin="10,0,0,10" + FontSize="30" + FontWeight="Bold" + Text="Comments" /> + <StackPanel Orientation="Horizontal"> + + <TextBox + Width="500" + Height="80" + Text="{Binding NewChangeComment.Comment, Mode=TwoWay}" + TextWrapping="Wrap" /> + <Button + Margin="10,0,0,0" + Command="{Binding CreateChangeComment}" + Content="Comment" /> + </StackPanel> + + + <ListView ItemsSource="{Binding CatalogSingleton.SelectedChange.Comments}"> + <ListView.ItemContainerStyle> + <Style TargetType="ListViewItem"> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + </Style> + </ListView.ItemContainerStyle> + + <ListView.ItemTemplate> + <DataTemplate> + <Grid Margin="10"> + <StackPanel> + <TextBlock + Margin="5,0,0,0" + FontWeight="Bold" + Text="{Binding Name}" /> + <TextBlock + Margin="5" + Text="{Binding Comment}" + TextWrapping="WrapWholeWords" /> + <StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> + <TextBlock Margin="0,0,0,5"> + <Run FontWeight="Bold" Text="{Binding Date.Year}" /> + <Run FontWeight="Bold" Text="-" /> + <Run FontWeight="Bold" Text="{Binding Date.Month}" /> + <Run FontWeight="Bold" Text="-" /> + <Run FontWeight="Bold" Text="{Binding Date.Day}" /> + <Run FontWeight="Bold" Text=" " /> + <Run FontWeight="Bold" Text="{Binding Date.Hour}" /> + <Run FontWeight="Bold" Text=":" /> + <Run FontWeight="Bold" Text="{Binding Date.Minute}" /> + </TextBlock> + </StackPanel> + </StackPanel> + </Grid> + </DataTemplate> + </ListView.ItemTemplate> + </ListView> + + </StackPanel> + </StackPanel> + </ScrollViewer> + </Grid> +</Page> diff --git a/ApartmentManager/ApartmentManager/View/ApartmentChangesViewPage.xaml.cs b/ApartmentManager/ApartmentManager/View/ApartmentChangesViewPage.xaml.cs new file mode 100644 index 0000000..d3030ff --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/ApartmentChangesViewPage.xaml.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ApartmentManager.View +{ + /// <summary> + /// An empty page that can be used on its own or navigated to within a Frame. + /// </summary> + public sealed partial class ApartmentChangesViewPage : Page + { + public ApartmentChangesViewPage() + { + this.InitializeComponent(); + } + + private void GotoApartmentChangesPage(object sender, RoutedEventArgs e) + { + Frame.Navigate(typeof(ApartmentChangesPage)); + } + } +} diff --git a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml index f2f0755..a102840 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml @@ -20,13 +20,9 @@ <Grid /> </CommandBar.Content> <AppBarButton - Click="NavigateNewDefect" - Command="{Binding ClearDefectTemplateCommand}" + Click="NavigateNewDefect" Icon="Add" Label="Create Defect"> - <AppBarButton.DataContext> - <ViewModel:BmDefectsViewModel /> - </AppBarButton.DataContext> </AppBarButton> </CommandBar> </Page.BottomAppBar> @@ -41,96 +37,91 @@ HorizontalAlignment="Center" FontSize="30" FontWeight="Bold" - Text="Apartment Defects"> + Text="Apartment Changes"> </TextBlock> - - <ListView ItemsSource="{Binding CatalogSingleton.Defects}" SelectedItem="{Binding CatalogSingleton.SelectedDefect, Mode=TwoWay}" SelectionChanged="NavigateDefectViewPage" Grid.Row="1" Background="LightGray"> - <ListView.ItemContainerStyle> - <Style TargetType="ListViewItem"> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - </Style> - </ListView.ItemContainerStyle> + <ListView ItemsSource="{Binding CatalogSingleton.Defects}" SelectedItem="{Binding CatalogSingleton.SelectedDefect, Mode=TwoWay}" SelectionChanged="NavigateDefectViewPage" Grid.Row="1" Background="LightGray"> + <ListView.ItemContainerStyle> + <Style TargetType="ListViewItem"> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + </Style> + </ListView.ItemContainerStyle> - <ListView.ItemTemplate> - <DataTemplate> - <Grid Height="200" BorderThickness ="1" Margin="12,12,12,0" BorderBrush="#DFE0E4" Background="White" > - <Grid.ColumnDefinitions> - <ColumnDefinition Width="200" /> - <ColumnDefinition/> - </Grid.ColumnDefinitions> - <Image + <ListView.ItemTemplate> + <DataTemplate> |