liuaoran 2 роки тому
батько
коміт
be51a1eea5

+ 5 - 0
PDF Office/CustomControl/CommonWritableComboBox.xaml

@@ -27,10 +27,15 @@
                 Text="1"
                 TextAlignment="Left"
                 KeyDown="CurrentPage_KeyDown"
+<<<<<<< Updated upstream
                 TextChanged="TextBox_Num_TextChanged"
                  Panel.ZIndex="1"/>
         <ComboBox Name="ComboBox_Type" MinHeight="28" MinWidth="64" HorizontalAlignment="Right" BorderThickness="00" Background="#F3F3F3" Grid.Column="0" Grid.ColumnSpan="2" SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=TypeSouce}" Panel.ZIndex="0">
         </ComboBox>
+=======
+                TextChanged="TextBox_Num_TextChanged" />
+        <ComboBox Name="ComboBox_Type" MinHeight="32" Width="16" HorizontalAlignment="Right" BorderBrush="Transparent" BorderThickness="00" Grid.Column="1" SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=TypeSouce}"></ComboBox>
+>>>>>>> Stashed changes
     </Grid>
     </Border>
 </UserControl>

+ 33 - 0
PDF Office/CustomControl/PageControl.xaml

@@ -0,0 +1,33 @@
+<UserControl x:Class="PDF_Office.CustomControl.PageControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.CustomControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <Border  Height="64" Width="293" HorizontalAlignment="Center"  VerticalAlignment="Bottom"  Panel.ZIndex="1" Margin="9" Background="#323232" CornerRadius="4">
+
+            <Grid>
+                <StackPanel Orientation="Horizontal"  VerticalAlignment="Center">
+                    <StackPanel Orientation="Horizontal">
+
+                        <TextBlock Text="-" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
+                        <TextBlock Text="+" FontSize="20" Foreground="White" Margin="0,0,39,0"></TextBlock>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="1" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                        <TextBlock Text="/" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                        <TextBlock Text="20" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="↑" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
+                        <TextBlock Text="↓" FontSize="20" Foreground="White"></TextBlock>
+
+                    </StackPanel>
+                </StackPanel>
+            </Grid>
+        </Border>
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/CustomControl/PageControl.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// PageControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class PageControl : UserControl
+    {
+        public PageControl()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 7 - 0
PDF Office/PDF Office.csproj

@@ -200,6 +200,9 @@
     <Compile Include="CustomControl\NumericUpDown.xaml.cs">
       <DependentUpon>NumericUpDown.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\PageControl.xaml.cs">
+      <DependentUpon>PageControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\PageTurningPreview.xaml.cs">
       <DependentUpon>PageTurningPreview.xaml</DependentUpon>
     </Compile>
@@ -576,6 +579,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="CustomControl\PageControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\PageTurningPreview.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 29 - 2
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs

@@ -1,14 +1,39 @@
-using Prism.Regions;
+using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 
 namespace PDF_Office.ViewModels.EditTools.Background
 {
-    internal class BackgroundCreateColorContentViewModel : INavigationAware
+    public class BackgroundCreateColorContentViewModel : BindableBase, INavigationAware
     {
+        private List<string> _opacityList=  new List<string>();
+        public List<string> OpacityList
+        {
+            get { return _opacityList; }
+            set
+            {
+                SetProperty(ref _opacityList, value);
+            }
+        }
+
+        public BackgroundCreateColorContentViewModel()
+        {
+        }
+
+        private void InitOpacityList()
+        {
+            OpacityList.Clear();
+            for (int temp = 0; temp < 100; temp += 10)
+            {
+                OpacityList.Add(temp.ToString() + " %");
+            }
+        }
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -20,6 +45,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            InitOpacityList();
+
         }
     }
 }

+ 3 - 3
PDF Office/Views/EditTools/Background/BackgroundContent.xaml

@@ -22,7 +22,7 @@
             <RowDefinition Height="40"></RowDefinition>
             <RowDefinition></RowDefinition>
         </Grid.RowDefinitions>
-        <Grid Grid.Row="0" Background="AntiqueWhite">
+        <Grid Grid.Row="0" Background="#FFFFFF">
             <Border x:Name="ToolsBorder" BorderBrush="#1A000000" BorderThickness="0,1,0,1" Height="40">
                 <WrapPanel HorizontalAlignment="Center" Height="40">
                     <Button Style="{StaticResource InsideBarBtnStyle }">
@@ -66,7 +66,7 @@
                 <ColumnDefinition></ColumnDefinition>
                 <ColumnDefinition Width="260"></ColumnDefinition>
             </Grid.ColumnDefinitions>
-            <Grid Grid.Column="0" Background="BurlyWood" >
+            <Grid Grid.Column="0" Background="#E7E9EC" >
                 <Border  Height="64" Width="293" HorizontalAlignment="Center"  VerticalAlignment="Bottom"  Panel.ZIndex="1" Margin="9" Background="#323232" CornerRadius="4">
 
                     <Grid>
@@ -91,7 +91,7 @@
                 </Border>
             </Grid>
 
-            <Grid Grid.Column="1" Background="Wheat">
+            <Grid Grid.Column="1" Background="#F3F3F3">
                 <ContentControl prism:RegionManager.RegionName="{Binding BackgroundSettingsRegionName}" Visibility="{Binding BackgroundSettingsVisible}"></ContentControl>
             </Grid>
         </Grid>

+ 7 - 4
PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml

@@ -4,7 +4,7 @@
              xmlns:prism="http://prismlibrary.com/"             
              prism:ViewModelLocator.AutoWireViewModel="True"
                xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateColorContentViewModel}"
              mc:Ignorable="d"
              d:DesignHeight="632"
              d:DesignWidth="260">
@@ -40,9 +40,10 @@
                 <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
                 <StackPanel Orientation="Horizontal">
                     <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
-                    <ComboBox Height="32" Width=" 66" Margin="0,0,28,0"></ComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0"></cus:CommonWritableComboBox>
+                    
                     <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                    <ComboBox Height="32" Width=" 66"></ComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList, Mode=TwoWay}"></cus:CommonWritableComboBox>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal"></StackPanel>
                 <Grid Margin="0,19,0,0">
@@ -54,7 +55,9 @@
                     <CheckBox Grid.Column="0" Style="{StaticResource CheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"></CheckBox>
                     <TextBlock Grid.Column="1" Text="相对目标页面的比例" Height="22" ></TextBlock>
                 </Grid>
-                <ComboBox Height="32" Width="66" HorizontalAlignment="Left" Margin="0,11,0,0"></ComboBox>
+                <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,0,0"></cus:CommonWritableComboBox>
+
+
             </StackPanel>
             
         </Grid>