Browse Source

注释 - 右键菜单command传参,属性面板空状态

chenrongqian@kdanmobile.com 2 years ago
parent
commit
b886a4726f

+ 25 - 3
PDF Office/Helper/PopControlHelper.cs

@@ -310,6 +310,14 @@ namespace PDF_Office.Helper
                 menuItem.Header = header;
             }
         }
+
+        //设置UI内容
+        public void SetMenuUI(int index, UIElement controls)
+        {
+            PopMenu.Items.Insert(index, controls);
+            GetMenuItems();
+        }
+
         //按索引号设置菜单
         public void SetMenuBinding(int index, ICommand command,object comTarget = null)
         {
@@ -318,10 +326,24 @@ namespace PDF_Office.Helper
             if (menuItem != null)
             {
                 if (comTarget == null)
-                    menuItem.CommandTarget = (UIElement)CommandTarget;
-                else
-                    menuItem.CommandTarget = (UIElement)comTarget;
+                {
+                    if (CommandTarget is UIElement)
+                    {
+                        menuItem.CommandTarget = (UIElement)CommandTarget;
+                    }
 
+                    menuItem.CommandParameter = CommandTarget;
+                }
+                   
+                else
+                {
+                    if(comTarget is UIElement)
+                    {
+                        menuItem.CommandTarget = (UIElement)comTarget;
+                    }
+                    menuItem.CommandParameter = comTarget;
+                }
+                    
                 menuItem.Command = command;
             }
 

+ 8 - 2
PDF Office/Views/PropertyPanel/PropertyPanelContent.xaml

@@ -16,9 +16,15 @@
         <Convert:PropertyPanelVisible x:Key="PropertyPanelVisible"/>
     </UserControl.Resources>
     <Grid  VerticalAlignment="Stretch">
- 
+
         <Grid>
-            <TextBlock Text="空" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            <StackPanel VerticalAlignment="Center" x:Name="NoStampStackPanel">
+                <Image Width="128" Height="128" Source="pack://application:,,,/PDF Office;component/Resources/PropertyPanel/EmptyAnnot.png" />
+                <TextBlock  Width="128" FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C"
+                            Text="Show/Hide Annotation Properties Panel" TextAlignment="Center"
+                            HorizontalAlignment="Center"/>
+              
+            </StackPanel>
         </Grid>
      
     </Grid>