You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
using System.Windows.Input; |
|
using SparkClient.Model.Helper; |
|
|
|
namespace SparkClient.ViewModel.BaseWindow; |
|
|
|
public class MainViewModel : BaseViewModel |
|
{ |
|
private object _content; |
|
|
|
public object Content { get { return _content; } set { _content = value; OnPropertyChanged("Content"); } } |
|
|
|
public ICommand SetZhcnLanguage { get; } |
|
public ICommand SetEnLanguage { get; } |
|
|
|
/// <summary> |
|
/// 构造 |
|
/// </summary> |
|
public MainViewModel() |
|
{ |
|
Content = new HomeWindowVM(); |
|
WindowManager.openContent.Add(Content); |
|
|
|
SetZhcnLanguage = new RelayCommand(setZhLanguage); |
|
SetEnLanguage = new RelayCommand(setEnLanguage); |
|
} |
|
|
|
/// <summary> |
|
/// 设置语言为ZH-CN |
|
/// </summary> |
|
/// <param name="parameter"></param> |
|
public void setZhLanguage(object parameter) |
|
{ |
|
MultilingualHelper.setLanguage("zh-cn"); |
|
} |
|
|
|
/// <summary> |
|
/// 设置语言为EN |
|
/// </summary> |
|
/// <param name="parameter"></param> |
|
public void setEnLanguage(object parameter) |
|
{ |
|
MultilingualHelper.setLanguage("en"); |
|
} |
|
} |