-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
171 lines (155 loc) · 8.91 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<Window x:Class="Mangerie.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:Mangerie"
xmlns:maze="clr-namespace:Mangerie.MazeMachine"
xmlns:main="clr-namespace:Mangerie.Kaleidoscope"
mc:Ignorable="d"
Title="MainWindow" WindowState="Maximized"
KeyDown="Window_KeyDown" KeyUp="Window_KeyUp">
<Grid Background="AliceBlue">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid x:Name="mazeContainer" Panel.ZIndex="50" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="mazeTransform" Y="-1000"></TranslateTransform>
</TransformGroup>
</Grid.RenderTransform>
<Canvas x:Name="mazeOverlay" Panel.ZIndex="-1" Background="White" Opacity="0" Grid.ColumnSpan="3"></Canvas>
<maze:MazeGame x:Name="mazeGame" Grid.Column="1"></maze:MazeGame>
</Grid>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Grid.Column="1"
Panel.ZIndex="30"
Text="© 2023 Niels Van Damme | www.planetegem.be"
Margin="0, 0, 0, 10"
FontFamily="Arial"
Opacity="0.4"
></TextBlock>
<Border Grid.Column="1" Background="LightSlateGray" BorderBrush="DarkSlateGray" BorderThickness="5, 0">
<Grid Width="700">
<Grid Panel.ZIndex="-1" Opacity="0.2">
<Grid.Background>
<ImageBrush ImageSource="/Resources/marble.jpg" Stretch="Fill" />
</Grid.Background>
</Grid>
<Canvas Width="600" Height="600" Background="DarkSlateGray" Panel.ZIndex="0">
<Canvas.Clip>
<EllipseGeometry Center="300,300" RadiusX="280" RadiusY="280" />
</Canvas.Clip>
</Canvas>
<Canvas x:Name="mainCanvas" Width="600" Height="600" Panel.ZIndex="1">
<Canvas.Clip>
<EllipseGeometry Center="300,300" RadiusX="275" RadiusY="275" />
</Canvas.Clip>
</Canvas>
</Grid>
</Border>
<StackPanel Style="{StaticResource SidePanel}">
<Border Style="{StaticResource SidePanelBorder}">
<WrapPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Style="{StaticResource SidePanelHeader}">kaleidoscope controls</TextBlock>
<Grid Margin="0, 20, 0, 0" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Style="{StaticResource SliderHeader}">
<TextBlock Text="mirror angle"></TextBlock>
</Label>
<TextBlock Text="(360°)" x:Name="mirrorAngleLbl" Style="{StaticResource SliderLabel}"></TextBlock>
<Slider Style="{StaticResource KaleidoscopeSlider}" Name="mirrorSlider" Maximum="6" TickFrequency="1" ValueChanged="mirrorSlider_ValueChanged"></Slider>
</Grid>
<Grid Margin="0, 0, 0, 0" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Style="{StaticResource SliderHeader}">
<TextBlock Text="rotation"></TextBlock>
</Label>
<TextBlock Text="(0°)" x:Name="imageAngleLbl" Style="{StaticResource SliderLabel}"></TextBlock>
<Slider Style="{StaticResource KaleidoscopeSlider}" Name="rotateSlider" Maximum="360" ValueChanged="rotateSlider_ValueChanged"></Slider>
</Grid>
<Grid Margin="0, 0, 0, 0" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Style="{StaticResource SliderHeader}">
<TextBlock Text="magnification"></TextBlock>
</Label>
<TextBlock Text="(x1)" x:Name="imageScaleLbl" Style="{StaticResource SliderLabel}"></TextBlock>
<Slider Style="{StaticResource KaleidoscopeSlider}" Name="scaleSlider" Minimum="1" Maximum="2" TickFrequency="0.1" ValueChanged="scaleSlider_ValueChanged"></Slider>
</Grid>
<Grid Margin="0, 35, 0, 15" HorizontalAlignment="Center" Width="250">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Style="{StaticResource SliderHeader}">
<TextBlock Text="image source"></TextBlock>
</Label>
<ListBox SelectedIndex="0" x:Name="imageListbox" Grid.Row="1" Grid.ColumnSpan="2" SelectionMode="Single" SelectionChanged="imageListbox_SelectionChanged">
<ListBoxItem>man.png</ListBoxItem>
<ListBoxItem>angel.png</ListBoxItem>
<ListBoxItem>golf.png</ListBoxItem>
</ListBox>
</Grid>
</WrapPanel>
</Border>
</StackPanel>
<StackPanel Style="{StaticResource SidePanel}" Grid.Column="2">
<Border Style="{StaticResource SidePanelBorder}">
<WrapPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Style="{StaticResource SidePanelHeader}">instructions</TextBlock>
<TextBlock Style="{StaticResource SidePanelText}" Margin="0, 20, 0, 0">
Welcome to Mangerie™, a quick and dirty kaleidoscope simulator
written in C# with the WPF framework.
Using the controls to the left you will be able to manipulate the image in the kaleidoscope.
</TextBlock>
<TextBlock Style="{StaticResource SidePanelText}" Margin="0, 15, 0, 0">
The images used in the Kaleidoscope are: <LineBreak />
1) Study of a Nude Man - painting attributed to Gustave Courbet
<LineBreak />
2) A Nude Male Seen from the Back in Clouds (1602) by Daniel Fröschl
<LineBreak />
3) Study of a Nude Man – painting by unknown French Painter
</TextBlock>
<TextBlock Style="{StaticResource SidePanelText}" Margin="0, 15, 0, 0">
And if you're still reading: congratulations, you can also play a <Hyperlink Click="MazeMachine_Click">bonus game</Hyperlink>!
</TextBlock>
</WrapPanel>
</Border>
</StackPanel>
</Grid>
</Window>