Exemplo n.º 1
0
        void tempControl_DeleteTemplate(object sender, TemplateEventArgs e)
        {
            var       p  = _panels.Peek() as StackPanel;
            PanelInfo pi = p.Tag as PanelInfo;

            _tempMgr.Delete(e.Name, pi.DataType);
        }
Exemplo n.º 2
0
        void tempControl_CreateTemplate(object sender, TemplateEventArgs e)
        {
            var       p  = _panels.Peek() as StackPanel;
            PanelInfo pi = p.Tag as PanelInfo;

            object instance = CreateTypeInstance(p);

            _tempMgr.Store(e.Name, pi.DataType, instance, e.IsDefault);

            e.Value = instance;
        }
Exemplo n.º 3
0
        private void OnDeleteTemplate(string name)
        {
            var args = new TemplateEventArgs(name, _type);

            if (DeleteTemplate != null)
            {
                DeleteTemplate(this, args);
            }

            var index = cbTemps.SelectedIndex;

            cbTemps.SelectedIndex = 0;

            _items.RemoveAt(index);
        }
Exemplo n.º 4
0
        private void OnCreateTemplate(string name, bool @default)
        {
            var args = new TemplateEventArgs(name, _type, @default);

            if (CreateTemplate != null)
            {
                CreateTemplate(this, args);
            }

            var newItem = new DataTemplateManager.DataTemplate()
            {
                Name = name, TypeName = _type.FullName, Object = args.Value
            };

            _items.Add(new DataTemplateItem(newItem, @default));

            cbTemps.SelectedValue = newItem.Object;
        }
        void tempControl_DeleteTemplate(object sender, TemplateEventArgs e)
        {
            var p = _panels.Peek() as StackPanel;
              PanelInfo pi = p.Tag as PanelInfo;

              object instance = CreateTypeInstance(p);
              _tempMgr.Delete(e.Name, pi.DataType);
        }
        void tempControl_CreateTemplate(object sender, TemplateEventArgs e)
        {
            var p = _panels.Peek() as StackPanel;
              PanelInfo pi = p.Tag as PanelInfo;

              object instance = CreateTypeInstance(p);
              _tempMgr.Store(e.Name, pi.DataType, instance, e.IsDefault);

              e.Value = instance;
        }
    private void OnDeleteTemplate(string name) {

      var args = new TemplateEventArgs(name, _type);

      if( DeleteTemplate != null )
        DeleteTemplate(this, args);

      var index = cbTemps.SelectedIndex;
      cbTemps.SelectedIndex = 0;

      _items.RemoveAt(index);
    }
    private void OnCreateTemplate(string name, bool @default) {

      var args = new TemplateEventArgs(name, _type, @default);

      if( CreateTemplate != null )
        CreateTemplate(this, args);

      var newItem = new DataTemplateManager.DataTemplate() { Name = name, TypeName = _type.FullName, Object = args.Value };
      _items.Add( new DataTemplateItem(newItem, @default) );

      cbTemps.SelectedValue = newItem.Object;
    }