Example #1
0
 public Control()
 {
     _parentScope = _currentCreationScope;
     _elementTab  = new ElementTab(_parentScope.Engine.CreateScope(), _parentScope.Directory, null, _parentScope.ElementTabSet, false);
     _parentScope.ElementTabSet.AddTab(_elementTab);
     _parentScope.Add(this);
 }
        void UpdateXaml(string path)
        {
            var scope = Control.CreateScope(_watcher.Path, _engine);

            scope.OpenScope(new NullElementTabSet());
            var xaml = XamlReader.Parse(File.ReadAllText(path));

            scope.CloseScope();
            if (xaml is ResourceDictionary)
            {
                Application.Current.Resources = (ResourceDictionary)xaml;
                return;
            }
            else if (!(xaml is Window))
            {
                _errors.Text = "Changes detected in " + path + ", but there seems to be nowhere to put the changes";
                return;
            }

            var source = path.Substring(_watcher.Path.Length, path.Length - _watcher.Path.Length - 5);
            var tab    = new ElementTab(_engine.CreateScope(), _watcher.Path, source, this, true);

            _appTabs.Add(tab);
            tab.Refresh(source + ".xaml");
            _tabs.Items.Add(tab);
            if (File.Exists(_watcher.Path + source + ".rb"))
            {
                tab.Refresh(source + ".rb");
            }
        }
 public void AddTab(ElementTab tab)
 {
     _appTabs.Add(tab);
     _tabs.Items.Add(tab);
 }
 public void AddTab(ElementTab tab)
 {
 }