Пример #1
0
        private void Root_Loaded(object sender, RoutedEventArgs e)
        {
            if (ListOfConfigItems.Items.Count == 0)
            {
                List <PageConfig> configuration = ConfigManager.Load();
                foreach (PageConfig config in configuration)
                {
                    PageConfigItem pci = new PageConfigItem()
                    {
                        PageConfig = config
                    };
                    ListOfConfigItems.Items.Add(pci);
                }

                CacheDirectoryInput.Caption          = "Data cache location:";
                CacheDirectoryInput.DefaultDirectory = ConfigManager.GetInstance().DefaultCacheDirectory;
                CacheDirectoryInput.CurrentDirectory = ConfigManager.GetInstance().CacheDirectory;

                TemplatesDirectoryInput.Caption          = "Page templates location:";
                TemplatesDirectoryInput.DefaultDirectory = ConfigManager.GetInstance().DefaultTemplatesDirectory;
                TemplatesDirectoryInput.CurrentDirectory = ConfigManager.GetInstance().TemplatesDirectory;

                ConfigFileInput.Caption          = "Personal info location:";
                ConfigFileInput.FileMode         = true;
                ConfigFileInput.DefaultDirectory = ConfigManager.GetInstance().DefaultConfigFile;
                ConfigFileInput.CurrentDirectory = ConfigManager.GetInstance().ConfigFile;
            }
        }
Пример #2
0
        private void AddPageButton_Click(object sender, RoutedEventArgs e)
        {
            PageConfig     pc  = new PageConfig();
            PageConfigItem pci = new PageConfigItem()
            {
                PageConfig = pc, IsExpanded = true
            };

            ListOfConfigItems.Items.Add(pci);
            pci.BringIntoView();
            pci.Focus();
        }