84 lines
2.6 KiB
C#
84 lines
2.6 KiB
C#
using HeBianGu.Service.Mvc;
|
|
using Hopetry.ViewModel.Send;
|
|
using System;
|
|
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Windows;
|
|
using System.Windows.Threading;
|
|
|
|
namespace HeBianGu.App.Disk
|
|
{
|
|
[ViewModel("Send")]
|
|
internal class SendViewModel : MvcViewModelBase
|
|
{
|
|
protected override void Init()
|
|
{
|
|
LinkActions.Add(new LinkAction() { Action = "Down", Controller = "Send", DisplayName = "正在下载", Logo = "\xe6f3" });
|
|
LinkActions.Add(new LinkAction() { Action = "UpLoad", Controller = "Send", DisplayName = "正在上传", Logo = "\xe6fe" });
|
|
//LinkActions.Add(new LinkAction() { Action = "Down", Controller = "Send", DisplayName = "传输完成", Logo = "\xe613" });
|
|
//LinkActions.Add(new LinkAction() { Action = "Down", Controller = "Send", DisplayName = "文件快传", Logo = "\xe764" });
|
|
|
|
|
|
Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() =>
|
|
{
|
|
SelectLink = LinkActions[0];
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
protected override void Loaded(string args)
|
|
{
|
|
}
|
|
|
|
#region 文件上传
|
|
|
|
private ObservableCollection<UpLoadItems> _upLoadItems = new ObservableCollection<UpLoadItems>();
|
|
/// <summary> 说明 </summary>
|
|
public ObservableCollection<UpLoadItems> UpLoadItems
|
|
{
|
|
get { return _upLoadItems; }
|
|
set
|
|
{
|
|
_upLoadItems = value;
|
|
RaisePropertyChanged("UpLoadItems");
|
|
}
|
|
}
|
|
|
|
private ObservableCollection<UpLoadItems> _completeItems = new ObservableCollection<UpLoadItems>();
|
|
/// <summary> 说明 </summary>
|
|
public ObservableCollection<UpLoadItems> CompleteItems
|
|
{
|
|
get { return _completeItems; }
|
|
set
|
|
{
|
|
_completeItems = value;
|
|
RaisePropertyChanged("CompleteItems");
|
|
}
|
|
}
|
|
|
|
private double _progress;
|
|
|
|
public double Progress
|
|
{
|
|
get { return _progress; }
|
|
set
|
|
{
|
|
if (_progress != value)
|
|
{
|
|
_progress = value;
|
|
RaisePropertyChanged("Progress");
|
|
}
|
|
}
|
|
}
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
protected void OnPropertyChanged(string propertyName)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
#endregion
|
|
}
|
|
}
|