|
@@ -1,6 +1,6 @@
|
|
using PDF_Master.CustomControl;
|
|
using PDF_Master.CustomControl;
|
|
using PDF_Master.Helper;
|
|
using PDF_Master.Helper;
|
|
-using PDF_Master.ViewModels;
|
|
|
|
|
|
+using PDF_Master.ViewModels;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Collections.ObjectModel;
|
|
@@ -25,7 +25,7 @@ namespace PDF_Master.Views
|
|
public string Content { get; set; }
|
|
public string Content { get; set; }
|
|
|
|
|
|
public string Uri { get; set; }
|
|
public string Uri { get; set; }
|
|
- public PromotionBanner(string ImagePath,string Content,string uri)
|
|
|
|
|
|
+ public PromotionBanner(string ImagePath, string Content, string uri)
|
|
{
|
|
{
|
|
this.ImagePath = ImagePath;
|
|
this.ImagePath = ImagePath;
|
|
this.Content = Content;
|
|
this.Content = Content;
|
|
@@ -37,17 +37,18 @@ namespace PDF_Master.Views
|
|
/// HomeContent.xaml 的交互逻辑
|
|
/// HomeContent.xaml 的交互逻辑
|
|
/// </summary>
|
|
/// </summary>
|
|
public partial class HomeContent : UserControl
|
|
public partial class HomeContent : UserControl
|
|
- {
|
|
|
|
|
|
+ {
|
|
|
|
+ private HomeContentViewModel viewModel;
|
|
|
|
|
|
- private bool IsContextMenuOpen = false;
|
|
|
|
-
|
|
|
|
|
|
+ private bool IsContextMenuOpen = false;
|
|
|
|
+
|
|
public HomeContent()
|
|
public HomeContent()
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
- BtnGuid.IsChecked = true;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ BtnGuid.IsChecked = true;
|
|
|
|
+ viewModel = this.DataContext as HomeContentViewModel;
|
|
|
|
+ }
|
|
|
|
+
|
|
private void ToggleBtnSelect_Click(object sender, RoutedEventArgs e)
|
|
private void ToggleBtnSelect_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
BtnGuid.IsChecked = false;
|
|
BtnGuid.IsChecked = false;
|
|
@@ -55,17 +56,17 @@ namespace PDF_Master.Views
|
|
BtnCloud.IsChecked = false;
|
|
BtnCloud.IsChecked = false;
|
|
|
|
|
|
var btn = sender as CustomIconToggleBtn;
|
|
var btn = sender as CustomIconToggleBtn;
|
|
- if(btn != null )
|
|
|
|
|
|
+ if (btn != null)
|
|
{
|
|
{
|
|
btn.IsChecked = true;
|
|
btn.IsChecked = true;
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private void BtnCreatPDF_Initialized(object sender, EventArgs e)
|
|
private void BtnCreatPDF_Initialized(object sender, EventArgs e)
|
|
{
|
|
{
|
|
var btn = sender as Button;
|
|
var btn = sender as Button;
|
|
- if(btn!=null)
|
|
|
|
|
|
+ if (btn != null)
|
|
{
|
|
{
|
|
btn.ContextMenu = null;
|
|
btn.ContextMenu = null;
|
|
}
|
|
}
|
|
@@ -92,7 +93,7 @@ namespace PDF_Master.Views
|
|
|
|
|
|
private void UserControl_DragEnter(object sender, DragEventArgs e)
|
|
private void UserControl_DragEnter(object sender, DragEventArgs e)
|
|
{
|
|
{
|
|
- DragDropHelper.DragEnter(this,e);
|
|
|
|
|
|
+ DragDropHelper.DragEnter(this, e);
|
|
}
|
|
}
|
|
|
|
|
|
private void UserControl_DragOver(object sender, DragEventArgs e)
|
|
private void UserControl_DragOver(object sender, DragEventArgs e)
|
|
@@ -112,9 +113,13 @@ namespace PDF_Master.Views
|
|
DragDropHelper.Drop(this, e);
|
|
DragDropHelper.Drop(this, e);
|
|
|
|
|
|
string[] file = (string[])e.Data.GetData(DataFormats.FileDrop);
|
|
string[] file = (string[])e.Data.GetData(DataFormats.FileDrop);
|
|
- if(file.Length>0)
|
|
|
|
|
|
+ if (file.Length > 0)
|
|
{
|
|
{
|
|
- (this.DataContext as HomeContentViewModel).AddFileFromDrag(file.ToList());
|
|
|
|
|
|
+ //判断是否为Home页面
|
|
|
|
+ if (viewModel.currentViewName == "Guid")
|
|
|
|
+ {
|
|
|
|
+ (this.DataContext as HomeContentViewModel).AddFileFromDrag(file.ToList());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch { }
|
|
catch { }
|