Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

lvle 2 years ago
parent
commit
3e7a7e0239

+ 1 - 1
PDF Office/Helper/SecurityHelper.cs

@@ -111,7 +111,7 @@ namespace PDF_Office.Helper
             }
 
             DialogParameters value = new DialogParameters();
-            value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusPermissionsPassword);
+            value.Add(ParameterNames.PasswordKind, enumPasswordKind);
             value.Add(ParameterNames.PDFDocument, document);
             dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e => {
                 verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);

+ 0 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs

@@ -91,7 +91,6 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
         #region 委托声明
         public DelegateCommand ConfirmCommand { get; set; }
         public DelegateCommand CancelCommand { get; set; }
-
         public DelegateCommand ClearPasswordCommand { get; set; }
         #endregion
 

+ 20 - 20
PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs

@@ -126,7 +126,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             eventAggregator.GetEvent<SetCurrentCreateModEvent>().Subscribe(SetCurrentCreateMod, e => e.Unicode == Unicode);
             eventAggregator.GetEvent<SetCurrentTemplateListModEvent>().Subscribe(SetCurrentTemplateListMod, e => e.Unicode == Unicode);
             eventAggregator.GetEvent<EditBackgroundTemplateItemEvent>().Subscribe(EditBackgroundTemplateItem, e => e.Unicode == Unicode);
-            
+
         }
 
         public void CloseEditTool()
@@ -137,12 +137,12 @@ namespace PDF_Office.ViewModels.EditTools.Background
         public void ConfirmEditTool()
         {
             this.eventAggregator.GetEvent<ConfirmEditToolsBackgroundEvent>().Publish(Unicode);
-            this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish(new EnumCloseModeUnicode { Unicode=Unicode,Status= EnumCloseMode.StatusConfirm });
+            this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish(new EnumCloseModeUnicode { Unicode = Unicode, Status = EnumCloseMode.StatusConfirm });
         }
 
         public void EnterTemplateListOrCreate(EnumTemplateListOrCreateUnicode enumTemplateListOrCreateunicode)
         {
-            EnumTemplateListOrCreate enumTemplateListOrCreate= enumTemplateListOrCreateunicode.Status;
+            EnumTemplateListOrCreate enumTemplateListOrCreate = enumTemplateListOrCreateunicode.Status;
             if (enumTemplateListOrCreate == EnumTemplateListOrCreate.StatusTemplate)
             {
                 EnterSelectedContent(TemplateListBaseName);
@@ -209,27 +209,27 @@ namespace PDF_Office.ViewModels.EditTools.Background
         private void DeleteBackground()
         {
             AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.ShowDialog("确定要删除背景吗?", "", "取消", "删除");
-                if (alertsMessage.result == ContentResult.Ok)
+            alertsMessage.ShowDialog("确定要删除背景吗?", "", "取消", "删除");
+            if (alertsMessage.result == ContentResult.Ok)
+            {
+                this.eventAggregator.GetEvent<DeleteBackgroundEvent>().Publish(new EnumDeleteUnicode
                 {
-                    this.eventAggregator.GetEvent<DeleteBackgroundEvent>().Publish(new EnumDeleteUnicode
-                    {
-                        Unicode = Unicode,
-                        Status = EnumDelete.StatusDeleteAll
-                    });
-                }
-                else
+                    Unicode = Unicode,
+                    Status = EnumDelete.StatusDeleteAll
+                });
+            }
+            else
+            {
+                this.eventAggregator.GetEvent<DeleteBackgroundEvent>().Publish(new EnumDeleteUnicode
                 {
-                    this.eventAggregator.GetEvent<DeleteBackgroundEvent>().Publish(new EnumDeleteUnicode
-                    {
-                        Unicode = Unicode,
-                        Status = EnumDelete.StatusCreate
-                    });
-                }
+                    Unicode = Unicode,
+                    Status = EnumDelete.StatusCreate
+                });
+            }
         }
 
-        private void BatchBackground() {
-            
+        private void BatchBackground()
+        {
             DialogParameters backgroundpdf = new DialogParameters();
             backgroundpdf.Add(ParameterNames.BatchProcessing_Name, "4");
             HomePageBatchProcessingDialogModel.FilePaths = new List<string> { PDFViewer.Document.FilePath.ToString() };

File diff suppressed because it is too large
+ 618 - 618
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs


File diff suppressed because it is too large
+ 657 - 641
PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs


+ 13 - 2
PDF Office/ViewModels/EditTools/Background/BackgroundDocumentContentViewModel.cs

@@ -115,9 +115,17 @@ namespace PDF_Office.ViewModels.EditTools.Background
                 {
                     return;
                 }
-                if (int.Parse(args.Text) > 0 && int.Parse(args.Text) <= PDFViewer.Document.PageCount && Regex.Match(args.Text, "^\\d+$").Success)
+                try
                 {
-                    PDFViewer.GoToPage(int.Parse(args.Text)-1);
+                    if (int.Parse(args.Text) > 0 && int.Parse(args.Text) <= PDFViewer.Document.PageCount && Regex.Match(args.Text, "^\\d+$").Success)
+                    {
+                        PDFViewer.GoToPage(int.Parse(args.Text) - 1);
+                        InputIndexBoxVisible = Visibility.Collapsed;
+                    }
+                }
+                catch
+                {
+                    PDFViewer.GoToPage(1);
                     InputIndexBoxVisible = Visibility.Collapsed;
                 }
             }
@@ -153,6 +161,9 @@ namespace PDF_Office.ViewModels.EditTools.Background
         public void SetBackground(BackgroundInfoUnicode backgroundInfounicode)
         {
             EnumDelete = EnumDelete.StatusCreate;
+            PDFViewer.Document.GetBackground().Clear();
+            PDFViewer.Document.ReleasePages();
+            PDFViewer.ReloadDocument();
             BackgroundInfo backgroundInfo = backgroundInfounicode.Status;
             EditToolsHelper.GetPageRange(backgroundInfo.PageRangeIndex, PDFViewer.Document, ref backgroundInfo.PageRange, backgroundInfo.PageRange);
             this.backgroundInfo = backgroundInfo;

+ 227 - 227
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListFileContentViewModel.cs

@@ -1,175 +1,175 @@
-using PDF_Office.EventAggregators;
-using PDF_Office.Model.EditTools.Background;
-using PDF_Office.Model.EditTools.Watermark;
-using PDF_Office.Properties;
-using PDFSettings;
-using Prism.Commands;
-using Prism.Events;
-using Prism.Mvvm;
-using Prism.Regions;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace PDF_Office.ViewModels.EditTools.Background
-{
-    public class BackgroundTemplateListFileContentViewModel : BindableBase, INavigationAware
-    {
-        private readonly IEventAggregator eventAggregator;
-        public BackgroundInfo BackgroundInfo = new BackgroundInfo();
-        public BackgroundItem BackgroundItem = new BackgroundItem();
-        public int TemplateIndex = 0;
-
-        public ObservableCollection<BackgroundItem> backgroundModFileCollection = new ObservableCollection<BackgroundItem>();
-        public ObservableCollection<BackgroundItem> BackgroundModFileCollection
-        {
-            get { return backgroundModFileCollection; }
-            set
-            {
-                backgroundModFileCollection = value;
-                RaisePropertyChanged();
-            }
-        }
-
-        private Visibility _createTemplateVisible;
-        public Visibility CreateTemplateVisible
-        {
-            get { return _createTemplateVisible; }
-            set { SetProperty(ref _createTemplateVisible, value); }
-        }
-
-        public DelegateCommand AddTemplateCommand { get; set; }
-        public DelegateCommand<object> DeleteTemplateItemCommand { get; set; }
-        public DelegateCommand<object> EditTemplateItemCommand { get; set; }
-        public DelegateCommand DeleteAllTemplateItemCommand { get; set; }
-        public DelegateCommand<object> SelectTemplateItemCommand { get; set; }
-
-        public string unicode = null;
-        public string Unicode = null;
-
-        public BackgroundTemplateListFileContentViewModel(IEventAggregator eventAggregator)
-        {
-            Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
-            this.eventAggregator = eventAggregator;
-            AddTemplateCommand = new DelegateCommand(AddTemplate);
-            EditTemplateItemCommand = new DelegateCommand<object>(RequestEditTemplateItem);
-            DeleteTemplateItemCommand = new DelegateCommand<object>(DeleteTemplateItem);
-            DeleteAllTemplateItemCommand = new DelegateCommand(DeleteAllTemplateItem);
-            SelectTemplateItemCommand = new DelegateCommand<object>(SelectTemplateItem);
-
-            eventAggregator.GetEvent<SaveEditedBackgroundTemplateItemEvent>().Subscribe(SaveEditedBackgroundTemplateItem, e => e.Unicode == Unicode);
-
-        }
-
-        private void CheckTemplateListIsEmpty(List<BackgroundItem> backgroundTemplateList)
-        {
-            if (backgroundTemplateList.Count() == 0)
-            {
-                CreateTemplateVisible = Visibility.Visible;
-            }
-            else
-            {
-                CreateTemplateVisible = Visibility.Collapsed;
-            }
-        }
-
-        private void GetBackgroundSource()
-        {
-            List<BackgroundItem> backgroundModFileTemplateList = new List<BackgroundItem>();
-            for (int temp = 0; temp < Settings.Default.BackgroundTemplateList.Count; temp++)
-            {
-                if (Settings.Default.BackgroundTemplateList[temp].type == ComPDFKit.PDFDocument.C_Background_Type.BG_TYPE_IMAGE)
-                {
-                    backgroundModFileTemplateList.Add(Settings.Default.BackgroundTemplateList[temp]);
-                }
-            }
-            BackgroundModFileCollection = new ObservableCollection<BackgroundItem>(backgroundModFileTemplateList);
-            CheckTemplateListIsEmpty(backgroundModFileTemplateList);
-        }
-
-
-
-        private void InitBackgroundTemplateList()
-        {
-            if (Settings.Default.BackgroundTemplateList == null)
-            {
-                Settings.Default.BackgroundTemplateList = new BackgroundTemplateList();
-            }
-            GetBackgroundSource();
-        }
-
-        public void AddTemplate()
-        {
-            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(new EnumTemplateListOrCreateUnicode
-            {
-                Unicode = Unicode,
-                Status = EnumTemplateListOrCreate.StatusCreate
-            });
-        }
-
-        public void SaveEditedBackgroundTemplateItem(BackgroundItemUnicode backgroundItemunicode)
-        {
-            BackgroundItem backgroundItem = backgroundItemunicode.Status;
-            if (backgroundItem.type == ComPDFKit.PDFDocument.C_Background_Type.BG_TYPE_IMAGE)
-            {
-                Settings.Default.BackgroundTemplateList[TemplateIndex] = backgroundItem;
-                Settings.Default.Save();
-            }
-            GetBackgroundSource();
-
-        }
-        public void RequestEditTemplateItem(object e)
-        {
-            var control = e as Control;
-            if (control == null)
-            {
-                return;
-            }
-            var template = control.DataContext as BackgroundItem;
-            if (template == null)
-            {
-                return;
-            }
-            TemplateIndex = Settings.Default.BackgroundTemplateList.IndexOf(template);
-            template.listIndex = TemplateIndex;
-            this.eventAggregator.GetEvent<EditBackgroundTemplateItemEvent>().Publish(new BackgroundItemUnicode
-            {
-                Unicode = Unicode,
-                Status = template
-            });
-        }
-
-        public void DeleteTemplateItem(object e)
-        {
-            var control = e as Control;
-            if (control == null)
-            {
-                return;
-            }
-            var template = control.DataContext as BackgroundItem;
-            if (template == null)
-            {
-                return;
-            }
-            if (!string.IsNullOrEmpty(BackgroundItem.previewImagePath) && File.Exists(BackgroundItem.previewImagePath))
-            {
-                Settings.Default.AppProperties.NeedToDeletePath.Add(BackgroundItem.previewImagePath);
-            }
-
-            Settings.Default.BackgroundTemplateList.Remove(template);
-            Settings.Default.Save();
-
-            BackgroundModFileCollection.Remove(template);
-            GetBackgroundSource();
-
-        }
-
+using PDF_Office.EventAggregators;
+using PDF_Office.Model.EditTools.Background;
+using PDF_Office.Model.EditTools.Watermark;
+using PDF_Office.Properties;
+using PDFSettings;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundTemplateListFileContentViewModel : BindableBase, INavigationAware
+    {
+        private readonly IEventAggregator eventAggregator;
+        public BackgroundInfo BackgroundInfo = new BackgroundInfo();
+        public BackgroundItem BackgroundItem = new BackgroundItem();
+        public int TemplateIndex = 0;
+
+        public ObservableCollection<BackgroundItem> backgroundModFileCollection = new ObservableCollection<BackgroundItem>();
+        public ObservableCollection<BackgroundItem> BackgroundModFileCollection
+        {
+            get { return backgroundModFileCollection; }
+            set
+            {
+                backgroundModFileCollection = value;
+                RaisePropertyChanged();
+            }
+        }
+
+        private Visibility _createTemplateVisible;
+        public Visibility CreateTemplateVisible
+        {
+            get { return _createTemplateVisible; }
+            set { SetProperty(ref _createTemplateVisible, value); }
+        }
+
+        public DelegateCommand AddTemplateCommand { get; set; }
+        public DelegateCommand<object> DeleteTemplateItemCommand { get; set; }
+        public DelegateCommand<object> EditTemplateItemCommand { get; set; }
+        public DelegateCommand DeleteAllTemplateItemCommand { get; set; }
+        public DelegateCommand<object> SelectTemplateItemCommand { get; set; }
+
+        public string unicode = null;
+        public string Unicode = null;
+
+        public BackgroundTemplateListFileContentViewModel(IEventAggregator eventAggregator)
+        {
+            Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
+            this.eventAggregator = eventAggregator;
+            AddTemplateCommand = new DelegateCommand(AddTemplate);
+            EditTemplateItemCommand = new DelegateCommand<object>(RequestEditTemplateItem);
+            DeleteTemplateItemCommand = new DelegateCommand<object>(DeleteTemplateItem);
+            DeleteAllTemplateItemCommand = new DelegateCommand(DeleteAllTemplateItem);
+            SelectTemplateItemCommand = new DelegateCommand<object>(SelectTemplateItem);
+
+            eventAggregator.GetEvent<SaveEditedBackgroundTemplateItemEvent>().Subscribe(SaveEditedBackgroundTemplateItem, e => e.Unicode == Unicode);
+
+        }
+
+        private void CheckTemplateListIsEmpty(List<BackgroundItem> backgroundTemplateList)
+        {
+            if (backgroundTemplateList.Count() == 0)
+            {
+                CreateTemplateVisible = Visibility.Visible;
+            }
+            else
+            {
+                CreateTemplateVisible = Visibility.Collapsed;
+            }
+        }
+
+        private void GetBackgroundSource()
+        {
+            List<BackgroundItem> backgroundModFileTemplateList = new List<BackgroundItem>();
+            for (int temp = 0; temp < Settings.Default.BackgroundTemplateList.Count; temp++)
+            {
+                if (Settings.Default.BackgroundTemplateList[temp].type == ComPDFKit.PDFDocument.C_Background_Type.BG_TYPE_IMAGE)
+                {
+                    backgroundModFileTemplateList.Add(Settings.Default.BackgroundTemplateList[temp]);
+                }
+            }
+            BackgroundModFileCollection = new ObservableCollection<BackgroundItem>(backgroundModFileTemplateList);
+            CheckTemplateListIsEmpty(backgroundModFileTemplateList);
+        }
+
+
+
+        private void InitBackgroundTemplateList()
+        {
+            if (Settings.Default.BackgroundTemplateList == null)
+            {
+                Settings.Default.BackgroundTemplateList = new BackgroundTemplateList();
+            }
+            GetBackgroundSource();
+        }
+
+        public void AddTemplate()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(new EnumTemplateListOrCreateUnicode
+            {
+                Unicode = Unicode,
+                Status = EnumTemplateListOrCreate.StatusCreate
+            });
+        }
+
+        public void SaveEditedBackgroundTemplateItem(BackgroundItemUnicode backgroundItemunicode)
+        {
+            BackgroundItem backgroundItem = backgroundItemunicode.Status;
+            if (backgroundItem.type == ComPDFKit.PDFDocument.C_Background_Type.BG_TYPE_IMAGE)
+            {
+                Settings.Default.BackgroundTemplateList[TemplateIndex] = backgroundItem;
+                Settings.Default.Save();
+            }
+            GetBackgroundSource();
+
+        }
+        public void RequestEditTemplateItem(object e)
+        {
+            var control = e as Control;
+            if (control == null)
+            {
+                return;
+            }
+            var template = control.DataContext as BackgroundItem;
+            if (template == null)
+            {
+                return;
+            }
+            TemplateIndex = Settings.Default.BackgroundTemplateList.IndexOf(template);
+            template.listIndex = TemplateIndex;
+            this.eventAggregator.GetEvent<EditBackgroundTemplateItemEvent>().Publish(new BackgroundItemUnicode
+            {
+                Unicode = Unicode,
+                Status = template
+            });
+        }
+
+        public void DeleteTemplateItem(object e)
+        {
+            var control = e as Control;
+            if (control == null)
+            {
+                return;
+            }
+            var template = control.DataContext as BackgroundItem;
+            if (template == null)
+            {
+                return;
+            }
+            if (!string.IsNullOrEmpty(BackgroundItem.previewImagePath) && File.Exists(BackgroundItem.previewImagePath))
+            {
+                Settings.Default.AppProperties.NeedToDeletePath.Add(BackgroundItem.previewImagePath);
+            }
+
+            Settings.Default.BackgroundTemplateList.Remove(template);
+            Settings.Default.Save();
+
+            BackgroundModFileCollection.Remove(template);
+            GetBackgroundSource();
+
+        }
+
         public void DeleteAllTemplateItem()
         {
             List<BackgroundItem> removebackgroundItems = new List<BackgroundItem>();
@@ -196,59 +196,59 @@ namespace PDF_Office.ViewModels.EditTools.Background
                 BackgroundModFileCollection.Remove(removetemplate);
             }
             GetBackgroundSource();
-        }
-
-        public void ConvertItemToInfo(BackgroundItem backgroundItem, ref BackgroundInfo backgroundInfo)
-        {
-            if (backgroundItem != null)
-            {
-                backgroundInfo.BackgroundType = backgroundItem.type;
-                backgroundInfo.ImageArray = backgroundItem.imageArray;
-                backgroundInfo.ImageWidth = backgroundItem.imageWidth;
-                backgroundInfo.ImageHeight = backgroundItem.imageHeight;
-                backgroundInfo.Horizalign = backgroundItem.horizalign;
-                backgroundInfo.Vertalign = backgroundItem.vertalign;
-                backgroundInfo.VertOffset = backgroundItem.vertOffset;
-                backgroundInfo.Horizalign = backgroundItem.horizalign;
-                backgroundInfo.Opacity = backgroundItem.opacity;
-                backgroundInfo.Rotation = backgroundItem.rotation;
-                backgroundInfo.Scale = backgroundItem.scale;
+        }
+
+        public void ConvertItemToInfo(BackgroundItem backgroundItem, ref BackgroundInfo backgroundInfo)
+        {
+            if (backgroundItem != null)
+            {
+                backgroundInfo.BackgroundType = backgroundItem.type;
+                backgroundInfo.ImageArray = backgroundItem.imageArray;
+                backgroundInfo.ImageWidth = backgroundItem.imageWidth;
+                backgroundInfo.ImageHeight = backgroundItem.imageHeight;
+                backgroundInfo.Horizalign = backgroundItem.horizalign;
+                backgroundInfo.Vertalign = backgroundItem.vertalign;
+                backgroundInfo.VertOffset = backgroundItem.vertOffset;
+                backgroundInfo.Horizalign = backgroundItem.horizalign;
+                backgroundInfo.Opacity = backgroundItem.opacity;
+                backgroundInfo.Rotation = backgroundItem.rotation;
+                backgroundInfo.Scale = backgroundItem.scale;
                 backgroundInfo.PageRange = backgroundItem.pageRange;
-                backgroundInfo.PageRangeIndex = backgroundItem.PageRangeIndex;
-                //  backgroundItem.pagRangeMode = backgroundInfo.PageRange;
-            }
-        }
-
-        public void SendTemplateItemToDocument(BackgroundItem BackgroundItem)
-        {
-            ConvertItemToInfo(BackgroundItem, ref BackgroundInfo);
-            eventAggregator.GetEvent<SetBackgroundEvent>().Publish(new BackgroundInfoUnicode
-            {
-                Unicode = Unicode,
-                Status = BackgroundInfo
-            });
-        }
-
-        public void SelectTemplateItem(object e)
-        {
-            var listBox = e as ListBox;
-            BackgroundItem BackgroundItem = listBox.SelectedItem as BackgroundItem;
-            SendTemplateItemToDocument(BackgroundItem);
-        }
-
-
-        public bool IsNavigationTarget(NavigationContext navigationContext)
-        {
-            return true;
-        }
-
-        public void OnNavigatedFrom(NavigationContext navigationContext)
-        {
-        }
-
-        public void OnNavigatedTo(NavigationContext navigationContext)
-        {
-            InitBackgroundTemplateList();
-        }
-    }
-}
+                backgroundInfo.PageRangeIndex = backgroundItem.PageRangeIndex;
+                //  backgroundItem.pagRangeMode = backgroundInfo.PageRange;
+            }
+        }
+
+        public void SendTemplateItemToDocument(BackgroundItem BackgroundItem)
+        {
+            ConvertItemToInfo(BackgroundItem, ref BackgroundInfo);
+            eventAggregator.GetEvent<SetBackgroundEvent>().Publish(new BackgroundInfoUnicode
+            {
+                Unicode = Unicode,
+                Status = BackgroundInfo
+            });
+        }
+
+        public void SelectTemplateItem(object e)
+        {
+            var listBox = e as ListBox;
+            BackgroundItem BackgroundItem = listBox.SelectedItem as BackgroundItem;
+            SendTemplateItemToDocument(BackgroundItem);
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            InitBackgroundTemplateList();
+        }
+    }
+}

+ 3 - 2
PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.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:cus="clr-namespace:PDF_Office.CustomControl" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateFileContentViewModel}"
+             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" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance Type=background:BackgroundCreateFileContentViewModel}"
              mc:Ignorable="d"
              d:DesignHeight="632"
              d:DesignWidth="260">
@@ -27,7 +27,8 @@
         </Grid.RowDefinitions>
         <Grid Grid.Row="0" Grid.ColumnSpan="2">
             <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
-                <TextBox Height="32" Width="189" Margin="0,0,7,0" IsReadOnly="True"  Text="{Binding FileNameText}" FontSize="14" VerticalAlignment="Center"></TextBox>
+                <TextBox Height="32" Width="189" Margin="0,0,7,0" IsReadOnly="True"  Text="{Binding FileNameText}" FontSize="14" VerticalAlignment="Center">
+                </TextBox>
                 <Button Height="32" Width="32" Command="{Binding OpenFileCommand}"></Button>
             </StackPanel>
         </Grid>