Skip to content

Commit 40bf315

Browse files
committed
Add project files.
1 parent 3dfbd7b commit 40bf315

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4441
-0
lines changed

App.xaml

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<Application x:Class="ST10092081POEBudgetApp.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:ST10092081POEBudgetApp"
5+
xmlns:viewModel="clr-namespace:ST10092081POEBudgetApp.MVM.ViewModel"
6+
xmlns:view="clr-namespace:ST10092081POEBudgetApp.MVM.View"
7+
StartupUri="SignInPage.xaml">
8+
9+
<Application.Resources>
10+
<ResourceDictionary>
11+
12+
<ResourceDictionary.MergedDictionaries>
13+
<ResourceDictionary Source="Theme/MenuButtonTheme.xaml"/>
14+
</ResourceDictionary.MergedDictionaries>
15+
16+
17+
<DataTemplate DataType="{x:Type viewModel:MenuViewModel}">
18+
<view:MenuView/>
19+
</DataTemplate>
20+
21+
<DataTemplate DataType="{x:Type viewModel:RentPropertyViewModel}">
22+
<view:RentPropertyView/>
23+
</DataTemplate>
24+
25+
<DataTemplate DataType="{x:Type viewModel:HomeLoanViewModel}">
26+
<view:HomeLoanView/>
27+
</DataTemplate>
28+
29+
<DataTemplate DataType="{x:Type viewModel:VehiclePurchaseViewModel}">
30+
<view:VehiclePurchaseView/>
31+
</DataTemplate>
32+
33+
<DataTemplate DataType="{x:Type viewModel:SavingsViewModel}">
34+
<view:SavingsView/>
35+
</DataTemplate>
36+
37+
<Style x:Key="titleText" TargetType="TextBlock">
38+
<Setter Property="FontSize" Value="36"/>
39+
<Setter Property="FontWeight" Value="Bold"/>
40+
<Setter Property="TextAlignment" Value="Center"/>
41+
<Setter Property="Foreground" Value="#FFB2D9FF"/>
42+
</Style>
43+
44+
<Style x:Key="normalText" TargetType="TextBlock">
45+
<Setter Property="FontSize" Value="16"/>
46+
<Setter Property="FontWeight" Value="Bold"/>
47+
<Setter Property="LineHeight" Value="28"/>
48+
<Setter Property="TextWrapping" Value="Wrap"/>
49+
<Setter Property="TextAlignment" Value="Center"/>
50+
<Setter Property="Foreground" Value="#ffffff"/>
51+
</Style>
52+
53+
<Style x:Key="textHint" TargetType="TextBlock">
54+
<Setter Property="FontSize" Value="14"/>
55+
<Setter Property="Grid.Column" Value="1"/>
56+
<Setter Property="Panel.ZIndex" Value="1"/>
57+
<Setter Property="Margin" Value="10 0 0 0"/>
58+
<Setter Property="Foreground" Value="Black"/>
59+
</Style>
60+
61+
<Style x:Key="textBox" TargetType="TextBox">
62+
<Setter Property="FontSize" Value="14"/>
63+
<Setter Property="Grid.Column" Value="1"/>
64+
<Setter Property="Margin" Value="10 0 0 0"/>
65+
<Setter Property="Foreground" Value="#878787"/>
66+
<Setter Property="BorderBrush" Value="Transparent"/>
67+
<Setter Property="BorderThickness" Value="0"/>
68+
</Style>
69+
70+
<Style x:Key="mainButton" TargetType="Button">
71+
<Setter Property="FontSize" Value="16"/>
72+
<Setter Property="FontWeight" Value="DemiBold"/>
73+
<Setter Property="Width" Value="170"/>
74+
<Setter Property="Margin" Value="0 20 0 0"/>
75+
<Setter Property="Background" Value="#FF255685"/>
76+
<Setter Property="Foreground" Value="#FFB2D9FF"/>
77+
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
78+
<Setter Property="Template">
79+
<Setter.Value>
80+
<ControlTemplate TargetType="Button">
81+
<Border Background="{TemplateBinding Background}" CornerRadius="25" BorderThickness="1" BorderBrush="#FF012344" Padding="15">
82+
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
83+
</Border>
84+
</ControlTemplate>
85+
</Setter.Value>
86+
</Setter>
87+
88+
<Style.Triggers>
89+
<Trigger Property="IsMouseOver" Value="True">
90+
<Setter Property="Background" Value="#FF4B9DED"/>
91+
<Setter Property="Foreground" Value="#FF255685"/>
92+
</Trigger>
93+
<Trigger Property="IsMouseCaptured" Value="True">
94+
<Setter Property="Background" Value="#FF0E243A"/>
95+
<Setter Property="Foreground" Value="#FFB2D9FF"/>
96+
</Trigger>
97+
</Style.Triggers>
98+
</Style>
99+
100+
<Style x:Key="DisplayComboBox" TargetType="ComboBox">
101+
<Setter Property="Text" Value="Display Options"/>
102+
<Setter Property="Width" Value="210"/>
103+
<Setter Property="Height" Value="26"/>
104+
<Setter Property="FontSize" Value="13"/>
105+
<Setter Property="Background" Value="#FF2D61D0"/>
106+
<Setter Property="BorderThickness" Value="1"/>
107+
<Setter Property="BorderBrush" Value="#FF070242"/>
108+
<Setter Property="FontWeight" Value="DemiBold"/>
109+
<Setter Property="Foreground" Value="#FF010D29"/>
110+
<Style.Triggers>
111+
<Trigger Property="IsMouseOver" Value="True">
112+
<Setter Property="Background" Value="#FF070242"/>
113+
<Setter Property="Foreground" Value="#FF2D61D0"/>
114+
</Trigger>
115+
<Trigger Property="IsMouseCaptured" Value="True">
116+
<Setter Property="Background" Value="#FF010D29"/>
117+
<Setter Property="Foreground" Value="#FF2D61D0"/>
118+
</Trigger>
119+
</Style.Triggers>
120+
</Style>
121+
122+
<Style x:Key="imgClose" TargetType="Image">
123+
<Setter Property="Width" Value="30"/>
124+
<Setter Property="Height" Value="30"/>
125+
<Setter Property="VerticalAlignment" Value="Top"/>
126+
<Setter Property="HorizontalAlignment" Value="Right"/>
127+
<Setter Property="Margin" Value="0 13 13 0"/>
128+
<Style.Triggers>
129+
<Trigger Property="IsMouseOver" Value="True">
130+
<Setter Property="RenderTransform">
131+
<Setter.Value>
132+
<ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
133+
</Setter.Value>
134+
</Setter>
135+
</Trigger>
136+
137+
</Style.Triggers>
138+
</Style>
139+
140+
<Style x:Key="ExitBottunStyle" TargetType="{x:Type Button}">
141+
<Setter Property="Background" Value="DimGray"/>
142+
<Setter Property="BorderBrush" Value="DimGray"/>
143+
<Setter Property="Foreground" Value="Black"/>
144+
<Setter Property="BorderThickness" Value="0"/>
145+
<Setter Property="HorizontalContentAlignment" Value="Center"/>
146+
<Setter Property="VerticalContentAlignment" Value="Center"/>
147+
<Setter Property="Padding" Value="1"/>
148+
<Setter Property="Template">
149+
<Setter.Value>
150+
<ControlTemplate TargetType="{x:Type Button}">
151+
<Border x:Name="border" CornerRadius="25" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
152+
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
153+
</Border>
154+
<ControlTemplate.Triggers>
155+
<Trigger Property="IsDefaulted" Value="true">
156+
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
157+
</Trigger>
158+
<Trigger Property="IsMouseOver" Value="true">
159+
<Setter Property="Background" TargetName="border" Value="Red"/>
160+
<Setter Property="BorderBrush" TargetName="border" Value="Red"/>
161+
</Trigger>
162+
<Trigger Property="IsPressed" Value="true">
163+
<Setter Property="Background" TargetName="border" Value="Red"/>
164+
<Setter Property="BorderBrush" TargetName="border" Value="Red"/>
165+
</Trigger>
166+
<Trigger Property="IsEnabled" Value="false">
167+
<Setter Property="Background" TargetName="border" Value="Transparent"/>
168+
<Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
169+
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="Black"/>
170+
</Trigger>
171+
</ControlTemplate.Triggers>
172+
</ControlTemplate>
173+
</Setter.Value>
174+
</Setter>
175+
</Style>
176+
177+
</ResourceDictionary>
178+
</Application.Resources>
179+
</Application>

App.xaml.cs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Windows;
2+
3+
namespace ST10092081POEBudgetApp
4+
{
5+
public partial class App : Application
6+
{
7+
8+
private void Appication_Startup(object sender, StartupEventArgs e)
9+
{
10+
11+
SignInPage signIn = new SignInPage();
12+
signIn.Show();
13+
}
14+
}
15+
}

AssemblyInfo.cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]

Core/ObservableObject.cs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.ComponentModel;
2+
using System.Runtime.CompilerServices;
3+
4+
namespace ST10092081POEBudgetApp.Core
5+
{
6+
class ObservableObject : INotifyPropertyChanged
7+
{
8+
public event PropertyChangedEventHandler? PropertyChanged;
9+
10+
protected void OnPropertyChanged([CallerMemberName] string? name = null)
11+
{
12+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
13+
}
14+
}
15+
}

Core/RelayCommand.cs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Windows.Input;
3+
4+
namespace ST10092081POEBudgetApp.Core
5+
{
6+
class RelayCommand : ICommand
7+
{
8+
private Action<object> _execute;
9+
private Func<object, bool> _canExecute;
10+
11+
public event EventHandler? CanExecuteChanged
12+
{
13+
add { CommandManager.RequerySuggested += value; }
14+
remove { CommandManager.RequerySuggested -= value; }
15+
}
16+
17+
public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
18+
{
19+
_execute = execute;
20+
_canExecute = canExecute;
21+
}
22+
23+
public bool CanExecute(object parameter)
24+
{
25+
return _canExecute == null || _canExecute(parameter);
26+
}
27+
28+
public void Execute(object? parameter)
29+
{
30+
_execute(parameter);
31+
}
32+
}
33+
}

Fonts/28 Days Later.ttf

278 KB
Binary file not shown.

Fonts/AbrilFatface-Regular.ttf

57.1 KB
Binary file not shown.

Fonts/Fascinate-Regular.ttf

48.4 KB
Binary file not shown.

Fonts/Huston.otf

59.9 KB
Binary file not shown.

Fonts/RAMEN ICHIKARU.otf

116 KB
Binary file not shown.

Images/Man.png

2.52 KB
Loading

Images/icons8-accounting-96.png

2.82 KB
Loading
Loading

Images/icons8-car-96 (1).png

3.28 KB
Loading

Images/icons8-close-96.png

604 Bytes
Loading

Images/icons8-income-96.png

2.13 KB
Loading

Images/icons8-menu-96.png

518 Bytes
Loading

Images/icons8-name-96.png

3.93 KB
Loading

Images/icons8-person-at-home-96.png

3.76 KB
Loading

Images/icons8-rent-96.png

3.6 KB
Loading

Images/icons8-tax-96.png

4.95 KB
Loading

Images/milky_way.png

4.91 KB
Loading

MVM/Model/BuyProperty.cs

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System;
2+
using System.Windows;
3+
4+
namespace ST10092081POEBudgetApp.MVM.Model
5+
{
6+
//this class is for the home loan option, it is derived from the Expense class
7+
class BuyProperty : Expense
8+
{
9+
private static int numMonthsToRepay;
10+
private static decimal monthlyLoanRepaymentAmount;
11+
12+
//get and set methods to access variables outside the buy Property class
13+
public static void setNumMonthsToRepay(int MonthsToRepay)
14+
{
15+
numMonthsToRepay = MonthsToRepay;
16+
}
17+
18+
public static int getnumMonthsToRepay()
19+
{
20+
return numMonthsToRepay;
21+
}
22+
23+
public static void setMonthlyLoanRepaymentAmount(decimal MonthlyLoanRepaymentAmount)
24+
{
25+
monthlyLoanRepaymentAmount = MonthlyLoanRepaymentAmount;
26+
}
27+
28+
public static decimal getMonthlyLoanRepaymentAmount()
29+
{
30+
return monthlyLoanRepaymentAmount;
31+
}
32+
33+
//method to calculate the monthly loan repayment amount
34+
public static decimal calculateMonthlyLoanRepayment(decimal purchPrice, decimal Deposit, decimal intRate, int numMonthsToRepay)
35+
{//declaring variables to use in the calculations
36+
decimal purchPriceMinusDeposit;
37+
decimal intRatePercentage;
38+
decimal monthlyLoanRepaymentAmount;
39+
try//try calculating the monthly loan repayment
40+
{
41+
//Initializing variable to store the number of years
42+
int numberOfYears = numMonthsToRepay / 12;
43+
//Initializing variable to store the purchase price minus the deposit
44+
purchPriceMinusDeposit = purchPrice - Deposit;
45+
//Initializing variable to store the interest rate in decimal form
46+
intRatePercentage = intRate / 100;
47+
48+
monthlyLoanRepaymentAmount = purchPriceMinusDeposit * (1 + intRatePercentage) / numMonthsToRepay;
49+
}
50+
catch (Exception e)
51+
{//throw a format exception in a message box
52+
MessageBox.Show(e.Message, "Format Exception", MessageBoxButton.OK, MessageBoxImage.Error);
53+
return 0.0M;
54+
}
55+
return monthlyLoanRepaymentAmount;
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)