Inheritance: Caliburn.Micro.PropertyChangedBase
Beispiel #1
0
        public async Task AddToolboxItem(DashboardItem item) // REVIEW TODO fix: async Task added
        {
            if (AppState.Dashboards.ActiveDashboard != null)
            {
                var di = new DashboardItem()
                {
                    Title = "Test 2x1",
                    GridX = 17,
                    GridY = 17,
                    GridHeight = 8,
                    GridWidth = 8,
                    Dashboard = AppState.Dashboards.ActiveDashboard,
                    Config = item.Config,                    
                };
                
                var t = Type.GetType(item.Type);
                if (t != null)
                {
                    di.ViewModel = (IDashboardItemViewModel)Activator.CreateInstance(t);
                    di.ViewModel.Item = di;

                }
                
                AppState.Dashboards.ActiveDashboard.DashboardItems.Add(di);
            }
            await AppState.Dashboards.Save("dashboards.config");
        }
Beispiel #2
0
 public async Task PinDataSet(DataSet sc) // REVIEW TODO fix: async added
 {
     if (AppState.Dashboards.ActiveDashboard != null)
     {
         var di = new DashboardItem()
         {
             Title = "Test 2x1",
             GridX = 17,
             GridY = 17,
             GridHeight = 8,
             GridWidth = 8,
             Data = sc,                    
             Dashboard = AppState.Dashboards.ActiveDashboard,
             Config = "Focus Value",
             DataSetId = sc.DataSetId
         };
         di.ViewModel = new DashboardItemViewModel {Data = sc, Item = di};
         AppState.Dashboards.ActiveDashboard.DashboardItems.Add(di);
     }
     await AppState.Dashboards.Save("dashboards.config");
 }