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#
Drawn menu icons for the entries the icon font has no glyph for
Alexander Graef0350726e9add
diff --git a/WaveDudeNext.WPF/Controls/MenuIcon.cs b/WaveDudeNext.WPF/Controls/MenuIcon.csindex c0eb28b..34af32d 100644--- a/WaveDudeNext.WPF/Controls/MenuIcon.cs+++ b/WaveDudeNext.WPF/Controls/MenuIcon.cs@@ -17,11 +17,15 @@using System.Windows;using System.Windows.Controls;+using System.Windows.Data;+using System.Windows.Documents;+using System.Windows.Shapes;namespace WaveDudeNext.WPF.Controls;/// <summary>-/// A menu entry's icon from Windows' icon font (2026-10-22, the user's request for the standard icons): attached as+/// A menu entry's icon: a glyph of Windows' icon font (2026-10-22, the user's request for the standard icons), or one of+/// the app's own drawings (<see cref="DrawingProperty"/>). The glyph is attached as/// <c>controls:MenuIcon.Glyph="&#xE74E;"</c>, it gives the <see cref="MenuItem"/> a <see cref="TextBlock"/> of that/// character in the theme's <c>MenuIconText</c> style (Segoe Fluent Icons on Windows 11, Segoe MDL2 Assets on Windows 10,/// in the entry's text colour). UI thread.@@ -38,6 +42,43 @@ public static class MenuIcon/// <summary>Sets the glyph of <paramref name="item"/>, which becomes its icon.</summary>public static void SetGlyph(MenuItem item, string? glyph) => item.SetValue(GlyphProperty, glyph);+ /// <summary>+ /// Identifies the attached Drawing property: the name of one of the app's own 16 px icon drawings (2026-10-23), for+ /// entries the icon font has no glyph for. The theme holds it as a stroked geometry <c>Icon{name}</c> and, where part of+ /// it is solid, a filled one <c>Icon{name}Fill</c>; both are drawn in the entry's text colour, as vectors.+ /// </summary>+ public static readonly DependencyProperty DrawingProperty = DependencyProperty.RegisterAttached(+ "Drawing", typeof(string), typeof(MenuIcon), new PropertyMetadata(null, OnDrawingChanged));++ /// <summary>Gets the drawing of <paramref name="item"/>.</summary>+ public static string? GetDrawing(MenuItem item) => (string?)item.GetValue(DrawingProperty);++ /// <summary>Sets the drawing of <paramref name="item"/>, which becomes its icon.</summary>+ public static void SetDrawing(MenuItem item, string? name) => item.SetValue(DrawingProperty, name);++ private static void OnDrawingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)+ {+ if (d is not MenuItem item)+ {+ return;+ }+ if (e.NewValue is not string { Length: > 0 } name)+ {+ item.Icon = null;+ return;+ }+ // the entry's text colour, which greys out when it is disabled, like a font glyph's: the inherited text foreground+ // each path holds itself (an ancestor lookup ran before the icon was in its menu and never found one)+ var colour = new Binding { Path = new PropertyPath(TextElement.ForegroundProperty), RelativeSource = RelativeSource.Self };+ var stroke = new Path { StrokeThickness = 1.0 };+ stroke.SetResourceReference(Path.DataProperty, "Icon" + name);+ stroke.SetBinding(Shape.StrokeProperty, colour);+ var fill = new Path();+ fill.SetResourceReference(Path.DataProperty, "Icon" + name + "Fill");+ fill.SetBinding(Shape.FillProperty, colour);+ item.Icon = new Grid { Width = 16, Height = 16, Children = { stroke, fill } };+ }+private static void OnGlyphChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){if (d is not MenuItem item)diff --git a/WaveDudeNext.WPF/MainWindow.xaml b/WaveDudeNext.WPF/MainWindow.xamlindex 5e2f6d9..1cf6449 100644--- a/WaveDudeNext.WPF/MainWindow.xaml+++ b/WaveDudeNext.WPF/MainWindow.xaml@@ -243,10 +243,10 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<MenuItem Header="{DynamicResource MenuEditDelete}" Command="{x:Static commands:EditCommands.Delete}" InputGestureText="Del" AutomationProperties.AutomationId="MenuDelete" controls:MenuIcon.Glyph="" /></MenuItem><MenuItem Header="{DynamicResource MenuView}">- <MenuItem Header="{DynamicResource MenuViewPanes}"+ <MenuItem Header="{DynamicResource MenuViewPanes}" controls:MenuIcon.Glyph=""ItemsSource="{Binding Items, ElementName=dockHost}"ItemContainerStyle="{StaticResource PaneMenuItemStyle}" />- <MenuItem x:Name="themeMenu" Header="{DynamicResource MenuViewTheme}"+ <MenuItem x:Name="themeMenu" Header="{DynamicResource MenuViewTheme}" controls:MenuIcon.Glyph=""ItemsSource="{Binding Options, Source={x:Static theming:ThemeController.Instance}}"ItemContainerStyle="{StaticResource ThemeMenuItemStyle}" /><MenuItem Header="{DynamicResource MenuViewLanguage}"@@ -255,7 +255,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<Separator /><!-- the reduced preview (2026-10-15): how much of a run is captured and kept, for weaker machines; usersettings, never the project's, and an export always uses a full run -->- <MenuItem Header="{DynamicResource MenuViewResolution}" AutomationProperties.AutomationId="MenuPreviewResolution">+ <MenuItem Header="{DynamicResource MenuViewResolution}" controls:MenuIcon.Drawing="PreviewResolution" AutomationProperties.AutomationId="MenuPreviewResolution"><MenuItem Header="{DynamicResource MenuViewResolutionFull}" Command="{x:Static commands:ViewCommands.SetPreviewResolution}" CommandParameter="1"IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=PreviewResolution, Converter={StaticResource IntEquals}, ConverterParameter=1, Mode=OneWay}"AutomationProperties.AutomationId="MenuPreviewResolution1" />@@ -266,7 +266,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file orIsChecked="{Binding Source={x:Static p:Settings.Default}, Path=PreviewResolution, Converter={StaticResource IntEquals}, ConverterParameter=4, Mode=OneWay}"AutomationProperties.AutomationId="MenuPreviewResolution4" /></MenuItem>- <MenuItem Header="{DynamicResource MenuViewFrames}" AutomationProperties.AutomationId="MenuPreviewFrames">+ <MenuItem Header="{DynamicResource MenuViewFrames}" controls:MenuIcon.Drawing="PreviewFrames" AutomationProperties.AutomationId="MenuPreviewFrames"><MenuItem Header="{DynamicResource MenuViewFramesFull}" Command="{x:Static commands:ViewCommands.SetPreviewFrames}" CommandParameter="1"IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=PreviewFrames, Converter={StaticResource IntEquals}, ConverterParameter=1, Mode=OneWay}"AutomationProperties.AutomationId="MenuPreviewFrames1" />@@ -277,7 +277,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file orIsChecked="{Binding Source={x:Static p:Settings.Default}, Path=PreviewFrames, Converter={StaticResource IntEquals}, ConverterParameter=4, Mode=OneWay}"AutomationProperties.AutomationId="MenuPreviewFrames4" /></MenuItem>- <MenuItem Header="{DynamicResource MenuViewSamples}" AutomationProperties.AutomationId="MenuPreviewSamples">+ <MenuItem Header="{DynamicResource MenuViewSamples}" controls:MenuIcon.Drawing="PreviewSamples" AutomationProperties.AutomationId="MenuPreviewSamples"><MenuItem Header="{DynamicResource MenuViewSamples16}" Command="{x:Static commands:ViewCommands.SetPreviewSamples}" CommandParameter="2"IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=PreviewSampleBytes, Converter={StaticResource IntEquals}, ConverterParameter=2, Mode=OneWay}"AutomationProperties.AutomationId="MenuPreviewSamples2" />@@ -312,7 +312,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file orAutomationProperties.AutomationId="MenuAutoRerun" /><!-- the memory a run's frames may take before the rest goes to disk: the application decides from what is free("Auto", 2026-10-15), a percentage of the RAM is only an upper bound on that -->- <MenuItem Header="{DynamicResource MenuSimulationFrameMemory}" AutomationProperties.AutomationId="MenuFrameMemory"+ <MenuItem Header="{DynamicResource MenuSimulationFrameMemory}" controls:MenuIcon.Drawing="FrameMemory" AutomationProperties.AutomationId="MenuFrameMemory"ItemsSource="{x:Static local:MainWindow.FrameMemoryOptions}"ItemContainerStyle="{StaticResource FrameMemoryMenuItemStyle}" /></MenuItem>diff --git a/WaveDudeNext.WPF/Panes/PreviewPane.xaml b/WaveDudeNext.WPF/Panes/PreviewPane.xamlindex 4e17281..389bd88 100644--- a/WaveDudeNext.WPF/Panes/PreviewPane.xaml+++ b/WaveDudeNext.WPF/Panes/PreviewPane.xaml@@ -674,7 +674,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or</Style></ContextMenu.Resources><MenuItem Header="{DynamicResource MenuBrightness}" Command="{x:Static commands:DisplayCommands.EditBrightness}" CommandParameter="{x:Static model:ProbeLayer.Field}" AutomationProperties.AutomationId="ContextBrightness" controls:MenuIcon.Glyph="" />- <MenuItem Header="{DynamicResource MenuAutoBrightness}" Command="{x:Static commands:DisplayCommands.AutoBrightness}" CommandParameter="{x:Static model:ProbeLayer.Field}" AutomationProperties.AutomationId="ContextAutoBrightness" />+ <MenuItem Header="{DynamicResource MenuAutoBrightness}" controls:MenuIcon.Drawing="AutoBrightness" Command="{x:Static commands:DisplayCommands.AutoBrightness}" CommandParameter="{x:Static model:ProbeLayer.Field}" AutomationProperties.AutomationId="ContextAutoBrightness" /><Separator /><MenuItem Header="{DynamicResource MenuExportThisFrame}" Command="{x:Static commands:ExportCommands.FieldFrame}" AutomationProperties.AutomationId="ContextExportFrame" controls:MenuIcon.Glyph="" /><Separator />@@ -700,7 +700,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or</Style></ContextMenu.Resources><MenuItem Header="{DynamicResource MenuBrightness}" Command="{x:Static commands:DisplayCommands.EditBrightness}" CommandParameter="{x:Static model:ProbeLayer.Intensity}" AutomationProperties.AutomationId="ContextBrightness" controls:MenuIcon.Glyph="" />- <MenuItem Header="{DynamicResource MenuAutoBrightness}" Command="{x:Static commands:DisplayCommands.AutoBrightness}" CommandParameter="{x:Static model:ProbeLayer.Intensity}" AutomationProperties.AutomationId="ContextAutoBrightness" />+ <MenuItem Header="{DynamicResource MenuAutoBrightness}" controls:MenuIcon.Drawing="AutoBrightness" Command="{x:Static commands:DisplayCommands.AutoBrightness}" CommandParameter="{x:Static model:ProbeLayer.Intensity}" AutomationProperties.AutomationId="ContextAutoBrightness" /><Separator /><MenuItem Header="{DynamicResource MenuExportThisFrame}" Command="{x:Static commands:ExportCommands.IntensityFrame}" AutomationProperties.AutomationId="ContextExportFrame" controls:MenuIcon.Glyph="" /><Separator />diff --git a/WaveDudeNext.WPF/Panes/ProjectTree.xaml b/WaveDudeNext.WPF/Panes/ProjectTree.xamlindex 58858f1..bf74c0d 100644--- a/WaveDudeNext.WPF/Panes/ProjectTree.xaml+++ b/WaveDudeNext.WPF/Panes/ProjectTree.xaml@@ -86,23 +86,23 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file orthem (the menu of kinds and the tree rows' Add part): each entry adds its kind, the class as the parameter. Notshared, so every menu that lists them gets its own entries (added to its items by ProjectTree.MenuEntries) --><x:Array x:Key="PartMenuEntries" x:Shared="False" Type="{x:Type FrameworkElement}">- <MenuItem Header="{DynamicResource MenuAddLens}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:LensPart}" AutomationProperties.AutomationId="AddPart:Lens" />- <MenuItem Header="{DynamicResource MenuAddFiber}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:FiberPart}" AutomationProperties.AutomationId="AddPart:Fiber" />- <MenuItem Header="{DynamicResource MenuAddBraggReflector}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:BraggReflectorPart}" AutomationProperties.AutomationId="AddPart:BraggReflector" />- <MenuItem Header="{DynamicResource MenuAddGrinLens}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:GrinLensPart}" AutomationProperties.AutomationId="AddPart:GrinLens" />- <MenuItem Header="{DynamicResource MenuAddZonePlate}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:ZonePlatePart}" AutomationProperties.AutomationId="AddPart:ZonePlate" />+ <MenuItem Header="{DynamicResource MenuAddLens}" controls:MenuIcon.Drawing="Lens" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:LensPart}" AutomationProperties.AutomationId="AddPart:Lens" />+ <MenuItem Header="{DynamicResource MenuAddFiber}" controls:MenuIcon.Drawing="Fiber" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:FiberPart}" AutomationProperties.AutomationId="AddPart:Fiber" />+ <MenuItem Header="{DynamicResource MenuAddBraggReflector}" controls:MenuIcon.Drawing="BraggReflector" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:BraggReflectorPart}" AutomationProperties.AutomationId="AddPart:BraggReflector" />+ <MenuItem Header="{DynamicResource MenuAddGrinLens}" controls:MenuIcon.Drawing="GrinLens" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:GrinLensPart}" AutomationProperties.AutomationId="AddPart:GrinLens" />+ <MenuItem Header="{DynamicResource MenuAddZonePlate}" controls:MenuIcon.Drawing="ZonePlate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:ZonePlatePart}" AutomationProperties.AutomationId="AddPart:ZonePlate" /><Separator />- <MenuItem Header="{DynamicResource MenuAddPolygon}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:PolygonPart}" AutomationProperties.AutomationId="AddPart:Polygon" />- <MenuItem Header="{DynamicResource MenuAddRectangle}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:RectanglePart}" AutomationProperties.AutomationId="AddPart:Rectangle" />- <MenuItem Header="{DynamicResource MenuAddEllipse}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:EllipsePart}" AutomationProperties.AutomationId="AddPart:Ellipse" />- <MenuItem Header="{DynamicResource MenuAddTriangle}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:TrianglePart}" AutomationProperties.AutomationId="AddPart:Triangle" />- <MenuItem Header="{DynamicResource MenuAddOutline}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OutlinePart}" AutomationProperties.AutomationId="AddPart:Outline" />+ <MenuItem Header="{DynamicResource MenuAddPolygon}" controls:MenuIcon.Drawing="Polygon" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:PolygonPart}" AutomationProperties.AutomationId="AddPart:Polygon" />+ <MenuItem Header="{DynamicResource MenuAddRectangle}" controls:MenuIcon.Drawing="Rectangle" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:RectanglePart}" AutomationProperties.AutomationId="AddPart:Rectangle" />+ <MenuItem Header="{DynamicResource MenuAddEllipse}" controls:MenuIcon.Drawing="Ellipse" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:EllipsePart}" AutomationProperties.AutomationId="AddPart:Ellipse" />+ <MenuItem Header="{DynamicResource MenuAddTriangle}" controls:MenuIcon.Drawing="Triangle" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:TrianglePart}" AutomationProperties.AutomationId="AddPart:Triangle" />+ <MenuItem Header="{DynamicResource MenuAddOutline}" controls:MenuIcon.Drawing="Outline" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OutlinePart}" AutomationProperties.AutomationId="AddPart:Outline" /><Separator /><!-- optical logic: one entry per gate (2026-10-21 and 22, the user's requests: XOR, then AND and OR) -->- <MenuItem Header="{DynamicResource MenuAddOpticalLogic}" AutomationProperties.AutomationId="AddPart:OpticalLogic">- <MenuItem Header="{DynamicResource MenuAddXorGate}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:XorGatePart}" AutomationProperties.AutomationId="AddPart:XorGate" />- <MenuItem Header="{DynamicResource MenuAddAndGate}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:AndGatePart}" AutomationProperties.AutomationId="AddPart:AndGate" />- <MenuItem Header="{DynamicResource MenuAddOrGate}" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OrGatePart}" AutomationProperties.AutomationId="AddPart:OrGate" />+ <MenuItem Header="{DynamicResource MenuAddOpticalLogic}" controls:MenuIcon.Drawing="OpticalLogic" AutomationProperties.AutomationId="AddPart:OpticalLogic">+ <MenuItem Header="{DynamicResource MenuAddXorGate}" controls:MenuIcon.Drawing="XorGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:XorGatePart}" AutomationProperties.AutomationId="AddPart:XorGate" />+ <MenuItem Header="{DynamicResource MenuAddAndGate}" controls:MenuIcon.Drawing="AndGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:AndGatePart}" AutomationProperties.AutomationId="AddPart:AndGate" />+ <MenuItem Header="{DynamicResource MenuAddOrGate}" controls:MenuIcon.Drawing="OrGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OrGatePart}" AutomationProperties.AutomationId="AddPart:OrGate" /></MenuItem></x:Array><!-- the menu of part kinds: the "+ Part" button and the Parts folder's plus open it (AddPart without a parameter opens@@ -178,7 +178,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<MenuItem Header="{DynamicResource MenuProjectAddPart}" local:ProjectTree.MenuEntries="{StaticResource PartMenuEntries}" controls:MenuIcon.Glyph="" /><MenuItem Header="{DynamicResource MenuProjectAddProbe}" Command="{x:Static commands:ProjectCommands.AddProbe}" controls:MenuIcon.Glyph="" /><Separator />- <MenuItem Header="{DynamicResource MenuProjectToggleSelected}" Command="{x:Static commands:ProjectCommands.ToggleSelected}" InputGestureText="Ins" AutomationProperties.AutomationId="ContextToggleSelected" />+ <MenuItem Header="{DynamicResource MenuProjectToggleSelected}" controls:MenuIcon.Glyph="" Command="{x:Static commands:ProjectCommands.ToggleSelected}" InputGestureText="Ins" AutomationProperties.AutomationId="ContextToggleSelected" /><MenuItem Header="{DynamicResource MenuProjectSelectAll}" Command="{x:Static commands:ProjectCommands.SelectAll}" InputGestureText="Ctrl+A" AutomationProperties.AutomationId="ContextSelectAll" controls:MenuIcon.Glyph="" /><Separator /><MenuItem Header="{DynamicResource MenuProjectToggleEnabled}" Command="{x:Static commands:ProjectCommands.ToggleEnabled}" InputGestureText="Space" controls:MenuIcon.Glyph="" />diff --git a/WaveDudeNext.WPF/Themes/Controls.xaml b/WaveDudeNext.WPF/Themes/Controls.xamlindex 1919ee2..c90e757 100644--- a/WaveDudeNext.WPF/Themes/Controls.xaml+++ b/WaveDudeNext.WPF/Themes/Controls.xaml@@ -222,6 +222,48 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<Setter Property="VerticalAlignment" Value="Center" /></Style>+ <!-- the app's own menu icons (controls:MenuIcon.Drawing, 2026-10-23) for entries the icon font has no glyph for: 16 px+ line drawings, stroked at 1 px on half pixels so the lines are crisp at 100 %, a Fill geometry for the solid parts -->+ <!-- a biconvex lens -->+ <StreamGeometry x:Key="IconLens">M8,1.5 C11.5,4.5 11.5,11.5 8,14.5 C4.5,11.5 4.5,4.5 8,1.5 Z</StreamGeometry>+ <!-- an S-bent fibre -->+ <StreamGeometry x:Key="IconFiber">M1,13.5 C7,13.5 9,5.5 15,5.5 M1,10.5 C7,10.5 9,2.5 15,2.5</StreamGeometry>+ <!-- alternating layers -->+ <StreamGeometry x:Key="IconBraggReflectorFill">M2,2 H4 V14 H2 Z M6,2 H8 V14 H6 Z M10,2 H12 V14 H10 Z</StreamGeometry>+ <!-- a block whose lines thicken toward the axis -->+ <StreamGeometry x:Key="IconGrinLens">M2.5,2.5 H13.5 V13.5 H2.5 Z M2.5,8 H13.5 M4,6 H12 M4,10 H12 M6,4.5 H10 M6,11.5 H10</StreamGeometry>+ <!-- a plate, open in the middle, its blocks narrowing outwards -->+ <StreamGeometry x:Key="IconZonePlateFill">M6,3 H10 V6 H6 Z M6,10 H10 V13 H6 Z M6,0.5 H10 V1.75 H6 Z M6,14.25 H10 V15.5 H6 Z</StreamGeometry>+ <!-- a hexagon -->+ <StreamGeometry x:Key="IconPolygon">M5,2.5 L11,2.5 L14,8 L11,13.5 L5,13.5 L2,8 Z</StreamGeometry>+ <!-- a rectangle -->+ <StreamGeometry x:Key="IconRectangle">M2.5,4.5 H13.5 V11.5 H2.5 Z</StreamGeometry>+ <!-- an ellipse -->+ <StreamGeometry x:Key="IconEllipse">M2,8 A6,4.5 0 1 1 14,8 A6,4.5 0 1 1 2,8 Z</StreamGeometry>+ <!-- a triangle -->+ <StreamGeometry x:Key="IconTriangle">M8,2.5 L14,13.5 L2,13.5 Z</StreamGeometry>+ <!-- a free outline -->+ <StreamGeometry x:Key="IconOutline">M2.5,12.5 L5,3.5 L9.5,6.5 L13.5,2.5 L12.5,13.5 Z</StreamGeometry>+ <!-- a gate with its inputs and output -->+ <StreamGeometry x:Key="IconOpticalLogic">M2.5,3.5 H8 A4.5,4.5 0 0 1 8,12.5 H2.5 Z M0,6 H2.5 M0,10 H2.5 M12.5,8 H16</StreamGeometry>+ <!-- the ANSI XOR symbol -->+ <StreamGeometry x:Key="IconXorGate">M4,3.5 Q7,8 4,12.5 Q11,12.5 13.5,8 Q11,3.5 4,3.5 Z M2,3.5 Q5,8 2,12.5 M13.5,8 H16</StreamGeometry>+ <!-- the ANSI AND symbol -->+ <StreamGeometry x:Key="IconAndGate">M2.5,3.5 H8 A4.5,4.5 0 0 1 8,12.5 H2.5 Z M12.5,8 H16</StreamGeometry>+ <!-- the ANSI OR symbol -->+ <StreamGeometry x:Key="IconOrGate">M2.5,3.5 Q5.5,8 2.5,12.5 Q10,12.5 13.5,8 Q10,3.5 2.5,3.5 Z M13.5,8 H16</StreamGeometry>+ <!-- a half-filled circle, the usual automatic contrast -->+ <StreamGeometry x:Key="IconAutoBrightness">M8,2.5 A5.5,5.5 0 1 1 8,13.5 A5.5,5.5 0 1 1 8,2.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconAutoBrightnessFill">M8,2.5 A5.5,5.5 0 0 1 8,13.5 Z</StreamGeometry>+ <!-- a pixel grid -->+ <StreamGeometry x:Key="IconPreviewResolution">M2.5,2.5 H13.5 V13.5 H2.5 Z M6.5,2.5 V13.5 M10.5,2.5 V13.5 M2.5,6.5 H13.5 M2.5,10.5 H13.5</StreamGeometry>+ <!-- a strip of frames -->+ <StreamGeometry x:Key="IconPreviewFrames">M1.5,3.5 H14.5 V12.5 H1.5 Z M5.5,3.5 V12.5 M10.5,3.5 V12.5</StreamGeometry>+ <!-- a quantisation staircase, the bit depth -->+ <StreamGeometry x:Key="IconPreviewSamples">M1.5,14.5 V11.5 H4.5 V8.5 H7.5 V5.5 H10.5 V2.5 H14.5</StreamGeometry>+ <!-- a memory module -->+ <StreamGeometry x:Key="IconFrameMemory">M2.5,4.5 H13.5 V11.5 H2.5 Z M4.5,11.5 V14 M7,11.5 V14 M9,11.5 V14 M11.5,11.5 V14 M5,7 H11 V9 H5 Z</StreamGeometry>+<Style TargetType="{x:Type MenuItem}"><Setter Property="Background" Value="Transparent" /><Setter Property="Foreground" Value="{DynamicResource MenuForeground}" />