Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            LoadAllNeccessaryThings();

            con.Register<BoBox.Utils.IConsole>((cc) => model.Console);

            con.Register<EdgeControl>((cc) => new EdgeControl() { Console = cc.Resolve<BoBox.Utils.IConsole>() });
            con.Register<Editor.BoBographTab, string>((cc, fileName) => new Editor.BoBographTab(fileName) { Console = cc.Resolve<BoBox.Utils.IConsole>() });
            //var e = con.Resolve<EdgeControl>();
            var l = new ModelLoader();
            var m = l.LoadFromFile("Data/q7.sparql.json");
            new Editor.BoBographTab("Data/q3c.sparql.json").AtacheToPane(MainDocumentsPane);

            //var c = new ModelToControl();
            //var p = c.Transfrom(m);

            //GraphCanvas.GraphLayers = p;
            //BoBox.Editor.TabsManager man = new BoBox.Editor.TabsManager() { Console = model.Console };
            //Man.Add(new AvalonDock.Layout.LayoutAnchorable() { Title = "AAAA" });
            //Man.Add(new AvalonDock.Layout.LayoutDocument() { Title = "aaa" });
            //Man.Add(new AvalonDock.Layout.LayoutDocument() { Title = "bbb" });
            //Man.Add(new AvalonDock.Layout.LayoutDocument() { Title = "ccc" });
            DataContext = model;
        }
Ejemplo n.º 2
0
        public BoBographTab(string sourceFile)
        {
            var s = System.Diagnostics.Stopwatch.StartNew();
            var l = new ModelLoader();
            var m = l.LoadFromFile(sourceFile);
            var c = new ModelToLayeredControl();
            var p = c.Transfrom(m);
            s.Stop();
            var e = s.ElapsedTicks;
            var ms = s.ElapsedMilliseconds;
            System.Diagnostics.Debug.WriteLine("{0} {1}", e, ms);

            var model = new BoBox.Controls.GraphCanvasControl();
            model.GraphLayers = p;

            var scroll = new ScrollViewer() { HorizontalScrollBarVisibility = ScrollBarVisibility.Visible };
            scroll.Content = model;
            Content = scroll;

            Title = GetDocumentTitle(sourceFile);
            ToolTip = GetDocumentTooltip(sourceFile);

            IsSelected = true;
        }