添加项目文件。

This commit is contained in:
liufei
2021-04-12 13:46:05 +08:00
parent b2b912a812
commit cc399e2ef7
32 changed files with 3794 additions and 0 deletions

88
ViewModel/AppConfig.cs Normal file
View File

@@ -0,0 +1,88 @@
using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GeekDesk.Constant;
namespace GeekDesk.ViewModel
{
[Serializable]
public class AppConfig : ViewModelBase
{
private int menuSortType = (int)SortType.CUSTOM; //菜单排序类型
private int iconSortType = (int)SortType.CUSTOM; //图表排序类型
private double windowWidth = (double)DefaultConstant.WINDOW_WIDTH; //窗口宽度
private double windowHeight = (double)DefaultConstant.WINDOW_HEIGHT; //窗口高度
private double menuCardWidth = (double)DefaultConstant.MENU_CARD_WIDHT;//菜单栏宽度
#region GetSet
public int MenuSortType {
get
{
return menuSortType;
}
set
{
menuSortType = value;
RaisePropertyChanged();
}
}
public int IconSortType
{
get
{
return iconSortType;
}
set
{
iconSortType = value;
RaisePropertyChanged();
}
}
public double WindowWidth
{
get
{
return windowWidth;
}
set
{
windowWidth = value;
RaisePropertyChanged();
}
}
public double WindowHeight
{
get
{
return windowHeight;
}
set
{
windowHeight = value;
RaisePropertyChanged();
}
}
public double MenuCardWidth
{
get
{
return menuCardWidth;
}
set
{
menuCardWidth = value;
RaisePropertyChanged();
}
}
#endregion
}
}

70
ViewModel/DataInfos.cs Normal file
View File

@@ -0,0 +1,70 @@
using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
namespace GeekDesk.ViewModel
{
public class DataInfos : ViewModelBase
{
private string path; //路径
private string name; //文件名
private int count = 0; //打开次数
private BitmapImage bitmapImage; //位图
public int Count
{
get
{
return count;
}
set
{
count = value;
RaisePropertyChanged();
}
}
public string Name
{
get
{
return name;
}
set
{
name = value;
RaisePropertyChanged();
}
}
public string Path
{
get
{
return path;
}
set
{
path = value;
RaisePropertyChanged();
}
}
public BitmapImage BitmapImage
{
get
{
return bitmapImage;
}
set
{
bitmapImage = value;
RaisePropertyChanged();
}
}
}
}

12
ViewModel/MainModel.cs Normal file
View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.ViewModel
{
class MainModel
{
}
}

View File

@@ -0,0 +1,34 @@
using GalaSoft.MvvmLight;
namespace GeekDesk.ViewModel
{
/// <summary>
/// This class contains properties that the main View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary>
public class MainViewModel : ViewModelBase
{
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel()
{
////if (IsInDesignMode)
////{
//// // Code runs in Blend --> create design time data.
////}
////else
////{
//// // Code runs "for real"
////}
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.ViewModel
{
class MenuViewModel
{
public MenuViewModel()
{
}
public ObservableCollection<Menu> GetMenus()
{
ObservableCollection<Menu> menus = new ObservableCollection<Menu>();
menus.Add(new Menu() { menu = "test1" });
menus.Add(new Menu() { menu = "test2" });
menus.Add(new Menu() { menu = "test3" });
return menus;
}
}
public class Menu
{
public string menu { get; set; }
}
}