using MainShell.Common; using MainShell.Models; using Stylet; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; namespace MainShell.ToolBox.ViewModel { public class ToolBoxWindowViewModel : Screen { public ObservableCollection Tools { get; } private ToolNavItem _selectedTool; public ToolNavItem SelectedTool { get { return _selectedTool; } set { SetAndNotify(ref _selectedTool, value); } } public ToolBoxWindowViewModel() { Tools = new ObservableCollection(); // 添加工具 Tools.Add(new ToolNavItem() { Subtitle = "光源设置", Title = "定位相机", Icon = "\ue610", Foreground=CommonUti.BrushFromString("#EEFA0A"), ContentViewModel = IoC.Get() }); Tools.Add(new ToolNavItem() { Subtitle = "光源设置", Title = "下相机", Icon = "\ue610", Foreground = CommonUti.BrushFromString("#EEFA0A"), ContentViewModel = IoC.Get() }); Tools.Add(new ToolNavItem() { Subtitle = "光源设置", Title = "Map相机", Icon = "\ue610", Foreground = CommonUti.BrushFromString("#EEFA0A"), ContentViewModel = IoC.Get() }); Tools.Add(new ToolNavItem() { Subtitle = "事件模拟", Title = "显示测试", Icon = "\ue6d7", Foreground = CommonUti.BrushFromString("#4F9DFF"), ContentViewModel = IoC.Get() }); if (Tools.Count > 0) { SelectedTool = Tools[0]; } } protected override void OnViewLoaded() { base.OnViewLoaded(); } } }