Ejemplo n.º 1
0
        private async void Lists_Loaded(object sender, RoutedEventArgs e)
        {
            if (!isLoaded)
            {
                TabsViewerControls.Visibility = Visibility.Collapsed;

                foreach (int id in TabsAccessManager.GetTabsListID())
                {
                    var list = TabsAccessManager.GetTabsListViaID(id);
                    Lists.Items.Add(new ListItem {
                        ListID = list.ID, ListName = list.name, ListIcon = await ModulesAccessManager.GetModuleIconViaIDAsync(list.TabsListProjectTypeID, true)
                    });

                    if (AppSettings.Values.ContainsKey("Tabs_list-selected-index"))
                    {
                        if ((int)AppSettings.Values["Tabs_list-selected-index"] == id)
                        {
                            Lists.SelectedIndex = Lists.Items.Count - 1;
                        }
                    }
                }

                if (Lists.Items.Count == 0)
                {
                    await TabsWriteManager.CreateTabsListAsync("Default list");
                }
                else
                {
                    if (!AppSettings.Values.ContainsKey("Tabs_list-selected-index"))
                    {
                        Lists.SelectedIndex = 0;
                    }
                }


                isLoaded = true;
            }
        }