-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
141 lines (141 loc) · 5.62 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
<Window x:Class="Calculator_.NET_Core.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_.NET_Core"
mc:Ignorable="d"
Title="Calculator" Height="550" Width="350">
<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="resultLabel"
Content="0"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
FontSize="60"
Grid.ColumnSpan="4"/>
<Label x:Name="operatorLabel"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
FontSize="40"/>
<Button x:Name="acButton"
Content="AC"
Grid.Row="1"
Style="{StaticResource additionalButtonAttribute}"/>
<Button x:Name="sevenButton"
Click="NumberButton_Click"
Content="7"
Grid.Row="2"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="fourButton"
Click="NumberButton_Click"
Content="4"
Grid.Row="3"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="oneButton"
Click="NumberButton_Click"
Content="1"
Grid.Row="4"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="zeroButton"
Click="NumberButton_Click"
Content="0"
Grid.ColumnSpan="2"
Grid.Row="6"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="comaButton"
Click="ComaButton_Click"
Content="."
Grid.Row="6"
Grid.Column="2"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="resultButton"
Content="="
Grid.Column="3"
Grid.Row="6"
Style="{StaticResource operatorButtonAttribute}"/>
<Button x:Name="plusButton"
Click="OperationButton_Click"
Content="+"
Grid.Column="3"
Grid.Row="4"
Style="{StaticResource operatorButtonAttribute}"/>
<Button x:Name="minusButton"
Click="OperationButton_Click"
Content="-"
Grid.Column="3"
Grid.Row="3"
Style="{StaticResource operatorButtonAttribute}"/>
<Button x:Name="multiplyButton"
Click="OperationButton_Click"
Content="*"
Grid.Column="3"
Grid.Row="2"
Style="{StaticResource operatorButtonAttribute}"/>
<Button x:Name="divideButton"
Click="OperationButton_Click"
Content="/"
Grid.Column="3"
Grid.Row="1"
Style="{StaticResource operatorButtonAttribute}"/>
<Button x:Name="threeButton"
Click="NumberButton_Click"
Content="3"
Grid.Column="2"
Grid.Row="4"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="sixButton"
Click="NumberButton_Click"
Content="6"
Grid.Column="2"
Grid.Row="3"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="fiveButton"
Click="NumberButton_Click"
Content="5"
Grid.Column="1"
Grid.Row="3"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="twoButton"
Click="NumberButton_Click"
Content="2"
Grid.Column="1"
Grid.Row="4"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="eightButton"
Click="NumberButton_Click"
Content="8"
Grid.Column="1"
Grid.Row="2"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="nineButton"
Click="NumberButton_Click"
Content="9"
Grid.Column="2"
Grid.Row="2"
Style="{StaticResource numberButtonAttribute}"/>
<Button x:Name="minPlusButton"
Content="+/-"
Grid.Column="1"
Grid.Row="1"
Style="{StaticResource additionalButtonAttribute}"/>
<Button x:Name="percentButton"
Content="%"
Grid.Column="2"
Grid.Row="1"
Style="{StaticResource additionalButtonAttribute}"/>
</Grid>
</Window>