<Window x:Class="Step5.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Step5" Title="MainWindow" Height="400" Width="600"> <Window.Resources> <Style TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> </Style> </Window.Resources> <Grid Background="Honeydew"> <Grid.RowDefinitions> <RowDefinition Height="2*"/> <RowDefinition Height="2*"/> <RowDefinition/> </Grid.RowDefinitions> <Grid Grid.Row="0"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">Loan Amortization</TextBlock> <TextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Margin="5">Principle Amount</TextBlock> <TextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Margin="5">Interest Rate</TextBlock> <TextBlock Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Margin="5">Duration</TextBlock> <TextBox Grid.Column="1" Grid.Row="1" Margin="5" VerticalAlignment="Center"> <TextBox.Text> <Binding Path="Principle"> <Binding.ValidationRules> <local:MyValidation/> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> <TextBox Grid.Column="1" Grid.Row="2" Margin="5" VerticalAlignment="Center"> <TextBox.Text> <Binding Path="InterestRate"> <Binding.ValidationRules> <local:MyValidation/> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> <TextBox Grid.Column="1" Grid.Row="3" Margin="5" VerticalAlignment="Center"> <TextBox.Text> <Binding Path="Duration"> <Binding.ValidationRules> <local:MyValidation/> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> </Grid> <DataGrid Grid.Row="1" Name="lstAmortization" Margin="5"> </DataGrid> <Grid Grid.Row="2"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Button Grid.Column="0" Name="btnCalculate" Width="75" Height="45" Click="btnCalculate_Click">Calculate</Button> <Button Grid.Column="1" Name="btnExit" Width="75" Height="45" Click="btnExit_Click">Exit</Button> </Grid> </Grid> </Window>
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
Skills that self-taught computer programmers lack