Filled landlord page.

This commit is contained in:
Tobias Erbshäußer
2020-06-10 14:05:19 +02:00
parent 9313ecb775
commit ce9dd644fc
7 changed files with 261 additions and 10 deletions
+6 -1
View File
@@ -6,9 +6,14 @@
xmlns:local="clr-namespace:UCalc.Controls"
mc:Ignorable="d">
<UserControl.Resources>
<local:ErrorCountToVisibilityConverter x:Key="ErrorCountToVisibilityConverter" />
</UserControl.Resources>
<Border CornerRadius="3"
BorderBrush="Red"
Background="Red">
Background="Red"
Visibility="{Binding Path=Model.ErrorCount, RelativeSource={RelativeSource AncestorType=local:ErrorCounter}, Converter={StaticResource ErrorCountToVisibilityConverter}}">
<Label
Content="{Binding Path=Model.ErrorCount, RelativeSource={RelativeSource AncestorType=local:ErrorCounter}}"
+17 -1
View File
@@ -1,8 +1,24 @@
using System.Windows;
using System;
using System.Windows;
using System.Windows.Data;
using UCalc.Models;
namespace UCalc.Controls
{
public class ErrorCountToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return ((int) value) != 0 ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
throw new InvalidOperationException();
}
}
public partial class ErrorCounter
{
public Model Model { get; set; }
+33
View File
@@ -0,0 +1,33 @@
<UserControl x:Class="UCalc.Controls.SectionHeader"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:UCalc"
xmlns:controls="clr-namespace:UCalc.Controls"
mc:Ignorable="d">
<Grid Margin="10, 0, 5, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Separator Grid.Column="0"
BorderBrush="{x:Static local:Constants.SubMainColor}"
VerticalAlignment="Center"
Background="{x:Static local:Constants.SubMainColor}" />
<Label Grid.Column="1"
Content="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=controls:SectionHeader}}"
VerticalAlignment="Center"
Foreground="{x:Static local:Constants.SubMainColor}" />
<Separator Grid.Column="2"
BorderBrush="{x:Static local:Constants.SubMainColor}"
VerticalAlignment="Center"
Background="{x:Static local:Constants.SubMainColor}" />
</Grid>
</UserControl>
+12
View File
@@ -0,0 +1,12 @@
namespace UCalc.Controls
{
public partial class SectionHeader
{
public string Header { get; set; }
public SectionHeader()
{
InitializeComponent();
}
}
}
+186 -7
View File
@@ -3,21 +3,200 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:UCalc.Pages"
xmlns:local="clr-namespace:UCalc"
xmlns:pages="clr-namespace:UCalc.Pages"
xmlns:controls="clr-namespace:UCalc.Controls"
xmlns:data="clr-namespace:UCalc.Data"
mc:Ignorable="d">
<ScrollViewer>
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<StackPanel>
<controls:SectionHeader Header="Allgemeine Informationen" />
<DockPanel>
<Label DockPanel.Dock="Left" Content="Name:" />
<DockPanel Margin="12, 12, 12, 0">
<Label DockPanel.Dock="Left"
Content="Anrede:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<ComboBox Margin="0, 0, 28, 0" /> <!-- TODO -->
</DockPanel>
<controls:ErrorIcon DockPanel.Dock="Right"
Error="{Binding Path=Model.Name.Error, RelativeSource={RelativeSource AncestorType=local:LandlordPage}}" />
<DockPanel Margin="12, 12, 12, 0">
<Label DockPanel.Dock="Left"
Content="Name:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.Name.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
Text="{Binding Path=Model.Name.Value, RelativeSource={RelativeSource AncestorType=local:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.Name.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Telefonnummer:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.Phone.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.Phone.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Email Adresse:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.MailAddress.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.MailAddress.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<controls:SectionHeader Header="Adresse des Eigentümers"
Margin="0, 12, 0, 0"/>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Straße:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.Street.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.Street.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Hausnummer:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.HouseNumber.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.HouseNumber.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Stadt:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.City.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.City.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="PLZ:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.Postcode.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.Postcode.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<controls:SectionHeader Header="Bankdaten des Eigentümers"
Margin="0, 12, 0, 0"/>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="IBAN:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.Iban.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.Iban.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="BIC:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.Bic.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.Bic.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 12">
<Label DockPanel.Dock="Left"
Content="Name der Bank:"
Width="200"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Error="{Binding Path=Model.BankName.Error, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Model.BankName.Value, RelativeSource={RelativeSource AncestorType=pages:LandlordPage}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
</StackPanel>
+1 -1
View File
@@ -122,7 +122,7 @@
VerticalAlignment="Center"
Model="{Binding Path=Model.LandlordModel, RelativeSource={RelativeSource AncestorType=pages:SideBar}}"/>
<Label Content="Vermieter"
<Label Content="Eigentümer"
Margin="0, 12, 12, 12"
VerticalAlignment="Center"
FontSize="14" />
+6
View File
@@ -34,6 +34,9 @@
<Page Update="Controls\ErrorIcon.xaml">
<Generator></Generator>
</Page>
<Page Update="Controls\SectionHeader.xaml">
<Generator></Generator>
</Page>
</ItemGroup>
<ItemGroup>
@@ -64,6 +67,9 @@
<Compile Update="Controls\ErrorIcon.xaml.cs">
<DependentUpon>ErrorIcon.xaml</DependentUpon>
</Compile>
<Compile Update="Controls\SectionHeader.xaml.cs">
<DependentUpon>SectionHeader.xaml</DependentUpon>
</Compile>
</ItemGroup>
</Project>