Пример #1
0
        public void SetUp()
        {
            _path = "/project/MainView.ux";
            var invalidated = new Subject <Unit>();

            _element = LiveElementFactory.CreateLiveElement("<App><StackPanel/></App>", _path, invalidated);
            UpdateElementIds();
            invalidated.Subscribe(_ => UpdateElementIds());
            _context = new Context(
                _element,
                id =>
            {
                UpdateElementIds();
                return(_element.DescendantsAndSelf().Where(x => x.SimulatorId.Value == id).FirstOr(Element.Empty));
            });
            //await _context.Select(_element);
            _highlightSelectedElement = new BehaviorSubject <bool>(true);
            _model = new TreeViewModel(
                _context,
                _highlightSelectedElement,
                _ => { throw new NotImplementedException(); });

            _lastTotalRowCount     = null;
            _lastVisibleRows       = null;
            _model.VisibleRowCount = 10;
            _model.TotalRowCount.Subscribe(v => _lastTotalRowCount = v);
            _model.VisibleRows.Subscribe(v => _lastVisibleRows     = v);
        }
Пример #2
0
 static IElement CreateTree()
 {
     return(LiveElementFactory.CreateLiveElement("<App><Panel /><Circle ux:Class=\"MyCircle\" /></App>"));
 }