Kaynağa Gözat

UI-调整多页签显示位置

ZhouJieSheng 2 yıl önce
ebeveyn
işleme
68d11f9cea

+ 1 - 1
PDF Office/App.xaml

@@ -21,7 +21,7 @@
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/WindowsStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/CustomBtnStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContainerStyles/ComboxStyle/ComboxItemStyle.xaml" />
-
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/RadioButtonStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageButtonStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathRadioButtonDictionary.xaml" />

+ 6 - 2
PDF Office/Views/MainWindow.xaml

@@ -15,9 +15,11 @@
     Height="800"
     MinWidth="540"
     MinHeight="460"
+    d:DataContext="{d:DesignInstance Type=viewmodels:MainWindowViewModel}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     Activated="Window_Activated"
     Closed="Window_Closed"
+    SizeChanged="Window_SizeChanged"
     Style="{StaticResource WindowStyle}"
     UseLayoutRounding="True"
     WindowStartupLocation="CenterScreen"
@@ -152,7 +154,8 @@
                 Grid.RowSpan="3"
                 BorderThickness="0"
                 ItemContainerStyle="{StaticResource DragablzItemStyle}"
-                SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
+                SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
+                WindowChrome.IsHitTestVisibleInChrome="True">
                 <dragablz:TabablzControl.InterTabController>
                     <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
                 </dragablz:TabablzControl.InterTabController>
@@ -161,7 +164,7 @@
                         x:Name="BtnAdd"
                         Width="20"
                         Height="20"
-                        Margin="9,13,0,7"
+                        Margin="8,13,200,7"
                         Padding="0"
                         HorizontalAlignment="Left"
                         Background="Transparent"
@@ -185,6 +188,7 @@
             </dragablz:TabablzControl>
             <!--  标题栏右侧栏,关闭按钮,会员,试用等  -->
             <StackPanel
+                Name="StkPnlRight"
                 HorizontalAlignment="Right"
                 Orientation="Horizontal"
                 WindowChrome.IsHitTestVisibleInChrome="True">

+ 14 - 2
PDF Office/Views/MainWindow.xaml.cs

@@ -66,12 +66,10 @@ namespace PDF_Office.Views
             if (this.WindowState == WindowState.Maximized)
             {
                 System.Windows.SystemCommands.RestoreWindow(this);
-                ico_max.Visibility = Visibility.Visible;
             }
             else
             {
                 System.Windows.SystemCommands.MaximizeWindow(this);
-                ico_max.Visibility = Visibility.Collapsed;
             }
         }
 
@@ -123,5 +121,19 @@ namespace PDF_Office.Views
             Settings.Default.Save();
         }
 
+        private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
+        {
+            var width = StkPnlRight.ActualWidth;
+            BtnAdd.Margin = new Thickness(8,13,width,7);
+
+            if (this.WindowState == WindowState.Maximized)
+            {
+                ico_max.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                ico_max.Visibility = Visibility.Collapsed;
+            }
+        }
     }
 }