示例#1
0
        public ListView(IUIStyle style) : base(style)
        {
            selectionChangedSupport = new EventSupport <ListSelectionEventArgs>();
            listViewStyle           = StyleSystem.StylesFor <ListViewStyleDefinition>();

            selectedIndex = -1;

            InternalContent = new ScrollPanel <BoxGroup>(UIStyle)
            {
                Content = new BoxGroup(UIStyle)
                {
                    Orientation = Orientation.Vertical
                }
            };

            DataItems = new ObservableCollection <T>();
            DataItems.CollectionChanged += (s, e) =>
            {
                RebuildDataRenderers();
                InvalidateLayout();
            };

            CreateRenderer = ListView.DefaultCreateRenderer;

            MinHeight = 0;
            MaxHeight = int.MaxValue;
        }
示例#2
0
        public Notebook(IUIStyle style) : base(style)
        {
            notebookStyle = StyleSystem.StylesFor <NotebookStyleDefinition>();

            Tabs = new NotebookTabList(UIStyle);
            Tabs.ActiveTabChanged += (s, e) => { panel.Content = Tabs.ActiveTab?.Content; };
            Tabs.AddNotify(this);
            RaiseChildAdded(0, Tabs);

            panel = new ScrollPanel(UIStyle);
            panel.AddNotify(this);
            RaiseChildAdded(1, panel);

            KeyPressed += OnKeyPressed;
        }