-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
145 lines (143 loc) · 5.45 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<Window x:Class="Calculator.MainWindow"
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:local="clr-namespace:Calculator"
mc:Ignorable="d"
Title="Calculatorinator" Height="600" Width="450">
<Window.Resources>
</Window.Resources>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label x:Name="labelResult"
Content="0"
Grid.Column="0"
Grid.ColumnSpan="4"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<Button x:Name="buttonAC"
Style="{StaticResource AdditionalButtons}"
Content="AC"
Grid.Row="1"
Click="ButtonAC_Click"/>
<Button x:Name="button7"
Style="{StaticResource numberButtonsStyle}"
Content="7"
Grid.Row="2"
Click="ButtonNumber_Click"/>
<Button x:Name="button4"
Style="{StaticResource numberButtonsStyle}"
Content="4"
Grid.Row="3"
Click="ButtonNumber_Click"/>
<Button x:Name="button1"
Style="{StaticResource numberButtonsStyle}"
Content="1"
Grid.Row="4"
Click="ButtonNumber_Click"/>
<Button x:Name="buttonNegative"
Style="{StaticResource AdditionalButtons}"
Content="+/-"
Grid.Row="1"
Grid.Column="1"
Click="ButtonNegative_Click"/>
<Button x:Name="button8"
Style="{StaticResource numberButtonsStyle}"
Content="8"
Grid.Column="1"
Grid.Row="2"
Click="ButtonNumber_Click"/>
<Button x:Name="button5"
Style="{StaticResource numberButtonsStyle}"
Content="5"
Grid.Column="1"
Grid.Row="3"
Click="ButtonNumber_Click"/>
<Button x:Name="button2"
Style="{StaticResource numberButtonsStyle}"
Content="2"
Grid.Column="1"
Grid.Row="4"
Click="ButtonNumber_Click"/>
<Button x:Name="buttonMod"
Style="{StaticResource AdditionalButtons}"
Content="%"
Grid.Column="2"
Grid.Row="1"
Click="OperationButton_Click"/>
<Button x:Name="button9"
Style="{StaticResource numberButtonsStyle}"
Content="9"
Grid.Column="2"
Grid.Row="2"
Click="ButtonNumber_Click"/>
<Button x:Name="button6"
Style="{StaticResource numberButtonsStyle}"
Content="6"
Grid.Column="2"
Grid.Row="3"
Click="ButtonNumber_Click"/>
<Button x:Name="button3"
Style="{StaticResource numberButtonsStyle}"
Content="3"
Grid.Column="2"
Grid.Row="4"
Click="ButtonNumber_Click"/>
<Button x:Name="buttonDivision"
Style="{StaticResource operatorsButtonsStyle}"
Content="/"
Grid.Column="3"
Grid.Row="1"
Click="OperationButton_Click"/>
<Button x:Name="buttonMultiplication"
Style="{StaticResource operatorsButtonsStyle}"
Content="*"
Grid.Column="3"
Grid.Row="2"
Click="OperationButton_Click"/>
<Button x:Name="buttonSubtraction"
Style="{StaticResource operatorsButtonsStyle}"
Content="-"
Grid.Column="3"
Grid.Row="3"
Click="OperationButton_Click"/>
<Button x:Name="buttonAddition"
Style="{StaticResource operatorsButtonsStyle}"
Content="+"
Grid.Column="3"
Grid.Row="4"
Click="OperationButton_Click"/>
<Button x:Name="buttonEquals"
Style="{StaticResource operatorsButtonsStyle}"
Content="="
Grid.Column="3"
Grid.Row="5"
Click="ButtonEquals_Click"/>
<Button x:Name="buttonDecimal"
Style="{StaticResource numberButtonsStyle}"
Content="."
Grid.Column="2"
Grid.Row="5"
Click="ButtonDecimal_Click"/>
<Button x:Name="button0"
Style="{StaticResource numberButtonsStyle}"
Content="0"
Grid.ColumnSpan="2"
Grid.Row="5"
Click="ButtonNumber_Click"/>
</Grid>
</Window>