]> O.S.I.I.S - jp/crowedit.git/commitdiff
context menu default template override
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 8 Jul 2025 06:32:47 +0000 (08:32 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 8 Jul 2025 06:32:47 +0000 (08:32 +0200)
CrowEditBase/CrowEditBase.csproj
CrowEditBase/ui/ContextMenu.template [deleted file]

index f2eadaddc07c04d9da39396297b8d8b520aeffa0..962c66c4fd08fd286d09dab404aae952e7110b39 100644 (file)
@@ -7,9 +7,12 @@
 
        <ItemGroup>
                <Compile Include="src\**\*.cs" />
-               <EmbeddedResource Include="ui\**\*.*">
+               <EmbeddedResource Include="ui\**\*.*" Exclude="ui\DefaultTemplateOverrides\*.*">
                        <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
                </EmbeddedResource>
+               <EmbeddedResource Include="ui\DefaultTemplateOverrides\*.template">
+                       <LogicalName>Crow.%(Filename).template</LogicalName>
+               </EmbeddedResource>
                <EmbeddedResource Include="icons\**\*.*">
                        <LogicalName>icons.%(Filename)%(Extension)</LogicalName>
                </EmbeddedResource>
diff --git a/CrowEditBase/ui/ContextMenu.template b/CrowEditBase/ui/ContextMenu.template
deleted file mode 100644 (file)
index 38e6b7b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<MenuItem MinimumSize="20,20" Height="Fit" Width="160" Caption="Context Menu" Data="{ContextCommands}" Orientation="Vertical"
-       IsOpened ="true" Visible="{/IsOpened}" SelectionBackground="Transparent">
-       <Template>              
-               <Border Background="DimGrey" Foreground="Black" CornerRadius="2">
-                       <GenericStack Orientation="{./Orientation}" Name="ItemsContainer" Margin="2"/>
-               </Border>               
-       </Template>
-       <ItemTemplate>
-               <MenuItem Command="{}" Width="150" PopWidth="120" SelectionBackground="Transparent" IsEnabled="{CanExecute}">
-                       <Template>
-                               <Popper Font="{./Font}" Caption="{./Caption}"  Background="{./Background}" PopDirection="{./PopDirection}"
-                                       Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseDown="./onMI_Click"
-                                       IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
-                                       <Template>
-                                               <Border Name="border1"
-                                                               CornerRadius="0"
-                                                               MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
-                                                               MouseLeave="{Foreground=Transparent}"
-                                                               MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
-                                                               MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
-                                                               MinimumSize = "60,0"
-                                                               Foreground="Transparent"
-                                                               Background="{./Background}">
-                                                               <HorizontalStack Spacing="5">
-                                                                       <Image Height="14" Width="14" Picture="{Icon}" />
-                                                                       <Label Text="{./Caption}"
-                                                                               Foreground="{./Foreground}"
-                                                                               Margin="1" HorizontalAlignment="Left"
-                                                                               Font="{./Font}" />
-                                                               </HorizontalStack>
-                                               </Border>
-                                       </Template>
-                                       <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="DimGrey">
-                                               <VerticalStack Name="ItemsContainer"/>
-                                       </Border>
-                               </Popper>
-                       </Template>
-               </MenuItem>
-       </ItemTemplate>
-</MenuItem>
-