Compare commits

..

No commits in common. "620efc20b3f73ba1af16ff75ad70bd11f17c53e7" and "c6de7d19a132d262292256dfa503049cc930e102" have entirely different histories.

2 changed files with 5 additions and 49 deletions

View File

@ -1,12 +1,4 @@
using HeBianGu.Base.WpfBase;
using HeBianGu.Control.Explorer;
using HeBianGu.Service.Mvc;
using HeBianGu.Window.Link;
using Hopetry.Provider.Behaviors;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using System.Windows.Controls;
namespace HeBianGu.App.Disk.Send
{
@ -18,42 +10,6 @@ namespace HeBianGu.App.Disk.Send
public SendControl()
{
InitializeComponent();
this.Loaded += OnLoaded;
}
private async void OnLoaded(object sender, RoutedEventArgs e)
{
// 查找h:Explorer控件
var box = FindVisualChild<ListBox>(this);
var fream= FindVisualChild<LinkActionFrame>(this);
if (box != null &&fream!=null && this.DataContext is SendViewModel viewModel)
{
IActionResult result = await viewModel.SelectLink.GetActionResult();
var uielement = result.View as UIElement;
fream.Content = uielement;
}
}
// 辅助方法:在可视化树中查找指定类型的子元素
private static T FindVisualChild<T>(DependencyObject parent) where T : DependencyObject
{
if (parent == null) return null;
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = VisualTreeHelper.GetChild(parent, i);
if (child is T result)
{
return result;
}
var childResult = FindVisualChild<T>(child);
if (childResult != null)
{
return childResult;
}
}
return null;
}
}
}

View File

@ -135,9 +135,9 @@ namespace HeBianGu.App.Disk
public ICommand DeleteFolderCommand { get; }
//public ICommand SelectItemsCommand { get; }
public LoyoutViewModel(SendViewModel sendViewModel)
public LoyoutViewModel()
{
_sendViewModel = sendViewModel;
//_sendViewModel = sendViewModel;
_uploadService = new FileUploadService();
UploadCommand = new AsyncRelayCommand(async () => await UploadFile());
UploadCommand1 = new AsyncRelayCommand(async () => await UploadFile1());
@ -149,9 +149,9 @@ namespace HeBianGu.App.Disk
// 初始化Timer
_progressTimer = new Timer(1000);
_progressTimer.Elapsed += UpdateProgress;
_sendViewModel.UpLoadItems.CollectionChanged += (s, e) => { _sendViewModel.UpdateUploadingItems(); };
//_sendViewModel.UpLoadItems.CollectionChanged += (s, e) => { _sendViewModel.UpdateUploadingItems(); };
//加载上传完成列表
GetCompletedFiles();
//GetCompletedFiles();
}
private async Task DoSelectDirCommand()