Пример #1
0
 /// <summary>
 /// Creates the main table layout for the main form.
 /// </summary>
 public MainSplitter(MainFormModel viewModel)
 {
     DataContext = viewModel;
     Panel1      = OpenedDatabaseTree = new OpenedDatabaseTree(viewModel);
     Panel2      = MultiTabControl = new MultiTabControl(viewModel);
     Position    = 300;
 }
        /// <summary>
        /// Creates an opened database tree item control.
        /// </summary>
        public OpenedDatabaseTreeItem(MainFormModel viewModel, OpenedDatabaseTree parentTree, DatabaseModel db)
        {
            Database           = db;
            Image              = Icon.FromResource("LiteDB.Explorer.Core.Assets.Icons.Db.ico", typeof(OpenedDatabaseTreeItem).Assembly);
            openedDatabaseTree = parentTree;
            parentViewModel    = viewModel;
            Text = Path.GetFileNameWithoutExtension(db.FilePath);

            db.Collections.CollectionChanged += onCollectionChanged;

            Children.AddRange(db.Collections.Select(collection => new CollectionTreeItem(db, collection)));
        }