public RunnableInstancesList GetAllRunnablesOrderedByStartup()
        {
            RunnableInstancesList           allrunnables     = GetAllRunnableInstances();
            List <PeriodicRunnableInstance> orderedRunnables = allrunnables.OrderBy(Obj => Obj.StartupOrder).ToList();

            allrunnables.Clear();
            allrunnables.AddRange(orderedRunnables);
            return(allrunnables);
        }
        public RunnableInstancesList GetAllRunnableInstances()
        {
            RunnableInstancesList runnables = new RunnableInstancesList();

            foreach (CompositionInstance composition in Compositions)
            {
                foreach (ComponentInstance component in composition.ComponentInstances)
                {
                    runnables.AddRange(component.RunableInstances);
                }
            }
            return(runnables);
        }
        //public void UpdateGrid(int selectedIndex = -1)
        //{
        //    RunnablesGrid.ItemsSource = null;
        //    RunnablesGrid.ItemsSource = workedRunnables;
        //    if ((selectedIndex >= 0) && (selectedIndex < RunnablesGrid.Items.Count))
        //    {
        //        RunnablesGrid.SelectedIndex = selectedIndex;
        //    }
        //}

        public void LoadData()
        {
            workedRunnables.Clear();
            workedRunnables.AddRange(AutosarApplication.GetInstance().GetAllRunnablesOrderedByStartup());
        }