Skip to content

Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.

C#
2.8 KB
Raw Blame
<!--
SPDX-License-Identifier: GPL-3.0-or-later
Copyright (C) 2026 Alexander Graef <[email protected]>

This file is part of WaveDude Next, a 2D wave simulator.

Based on the work of
  Jeroen Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026
    <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>
  0x23 (Diffraction Limited), author of WaveSimulator2D
    <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>

WaveDude Next is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<https://www.gnu.org/licenses/>.
-->

<UserControl x:Class="WaveDudeNext.WPF.Views.ProjectView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:WaveDudeNext.WPF.Views"
             xmlns:controls="clr-namespace:WaveDudeNext.WPF.Controls"
             xmlns:meta="clr-namespace:WaveDudeNext.WPF.Markup"
             xmlns:model="clr-namespace:WaveDudeNext.Model;assembly=WaveDudeNext">

	<UserControl.CommandBindings>
		<CommandBinding Command="{x:Static local:ProjectView.Reseed}" Executed="OnReseed" />
	</UserControl.CommandBindings>

	<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
		<StackPanel Margin="8">
			<Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGeneral}" />
			<controls:FormPanel>
				<TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Project.Version}" />
				<TextBlock Style="{StaticResource FormValue}" Text="{Binding Version}" ToolTip="{meta:Hint model:Project.Version}" />

				<TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Project.Seed}" />
				<DockPanel>
					<Button DockPanel.Dock="Right" Margin="6,0,0,0" Content="{DynamicResource ButtonNewSeed}"
					        Command="{x:Static local:ProjectView.Reseed}" AutomationProperties.AutomationId="ProjectNewSeed" />
					<controls:NumberBox Text="{Binding Seed}" ToolTip="{meta:Hint model:Project.Seed}" />
				</DockPanel>

				<TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Project.Description}" VerticalAlignment="Top" Margin="0,4,0,0" />
				<TextBox Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" ToolTip="{meta:Hint model:Project.Description}"
				         AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60" VerticalContentAlignment="Top"
				         VerticalScrollBarVisibility="Auto" />
			</controls:FormPanel>
		</StackPanel>
	</ScrollViewer>
</UserControl>