Example #1
0
        //private:

        void loadcontrols()
        {
            if (_datasource != null)
            {
                _numberofstacks = _datasource.Sections.Count;
                for (int i = 0; i < _numberofstacks; i++)
                {
                    IStackView stack = new IStackView();
                    stack.StackNumber       = i;
                    stack.Section           = i;
                    stack.BorderSource      = _bordersource;
                    stack.ThumbHeight       = _thumbheight;
                    stack.ThumbWidth        = _thumbwidth;
                    stack.BorderHeight      = _borderheight;
                    stack.BorderWidth       = _borderwidth;
                    stack.MaxScale          = _maxscale;
                    stack.StackHeight       = _listheight;
                    stack.VerticalPosition  = _verticalposition;
                    stack.MinStackWidth     = _minstackwidth;
                    stack.SpaceBetweenItems = _spacebetweenitems;
                    stack.DeviceWidth       = _minlistwidth;
                    stack.Source            = _datasource.Sections[i];
                    //header
                    _headercontrol.Author      = _datasource.Author;
                    _headercontrol.Title       = _datasource.Title;
                    _headercontrol.Description = _datasource.Description;
                    StyleConstants styles = new StyleConstants();
                    _headercontrol.ChapterColor = styles.SecondColors[_listnumber % 4];

                    stack.StackItemFullAnimationStarted    += StackItem_FullAnimationStarted;
                    stack.StackItemFullAnimationCompleted  += StackItem_FullAnimationCompleted;
                    stack.StackItemThumbAnimationStarted   += StackItem_ThumbAnimationStarted;
                    stack.StackItemThumbAnimationCompleted += StackItem_ThumbAnimationCompleted;

                    stack.StackSizeChangeStarted      += Stack_SizeChangeStarted;
                    stack.StackSizeChangeDelta        += Stack_SizeChangeDelta;
                    stack.StackSizeChangeCompleted    += Stack_SizeChangeCompleted;
                    stack.StackSizeAnimationStarted   += Stack_SizeAnimationStarted;
                    stack.StackSizeAnimationCompleted += Stack_SizeAnimationCompleted;

                    stack.IControlsComponentSelected += IControls_ComponentSelected;

                    //_startimage.Source = new BitmapImage(new Uri("ms-appx:///roadsdata/text"+(int)(i+1)+".png"));

                    if (stack.NumberOfItems == 1)
                    {
                        stack.SetToOpen();
                    }

                    _panel.Children.Add(stack);
                    _stacksvector.Add(stack);
                }
                _panel.Children.Add(_auxgrid);
                updatewidth();
            }
        }
Example #2
0
 void IControls_ComponentSelected(object sender, SelectionType t, int index)
 {
     if (!_ismanipulating)
     {
         Canvas.SetZIndex(_stacksvector[index], 10);
         _selectiontype = t;
         _selectedstack = _stacksvector[index];
         _selectedindex = index;
         IControlsComponentSelected(this, t, _listnumber);
         Canvas.SetZIndex(this, 100);
     }
 }
Example #3
0
        public void OpenStack(int index)
        {
            if (_stacksvector.Count == 0)
            {
                return;
            }
            for (int i = 0; i < _stacksvector.Count; i++)
            {
                if (_stacksvector[i].IsOpen)
                {
                    _stacksvector[i].SetToClose();
                }
                if (_stacksvector[i].NumberOfItems == 1)
                {
                    _stacksvector[i].SetToOpen();
                }
            }

            _stacksvector[index].SetToOpen();
            updatewidth();
            _selectedstack = _stacksvector[index];
            _selectedindex = index;
        }
Example #4
0
 public void SetItemToFull(int section, int page)
 {
     _stacksvector[section].SetItemToFull(page);
     _selectedindex = section;
     _selectedstack = _stacksvector[section];
 }
Example #5
0
 void IControls_ComponentSelected(object sender, SelectionType t, int index)
 {
     if (!_ismanipulating)
     {
         Canvas.SetZIndex(_stacksvector[index], 10);
         _selectiontype = t;
         _selectedstack = _stacksvector[index];
         _selectedindex = index;
         IControlsComponentSelected(this, t, _listnumber);
         Canvas.SetZIndex(this, 100);
     }
 }
Example #6
0
        //private:

        void loadcontrols()
        {
            if (_datasource != null)
            {
                _numberofstacks = _datasource.Sections.Count;
                for (int i = 0; i < _numberofstacks; i++)
                {
                    IStackView stack = new IStackView();
                    stack.StackNumber = i;
                    stack.Section = i;
                    stack.BorderSource = _bordersource;
                    stack.ThumbHeight = _thumbheight;
                    stack.ThumbWidth = _thumbwidth;
                    stack.BorderHeight = _borderheight;
                    stack.BorderWidth = _borderwidth;
                    stack.MaxScale = _maxscale;
                    stack.StackHeight = _listheight;
                    stack.VerticalPosition = _verticalposition;
                    stack.MinStackWidth = _minstackwidth;
                    stack.SpaceBetweenItems = _spacebetweenitems;
                    stack.DeviceWidth = _minlistwidth;
                    stack.Source = _datasource.Sections[i];
                    //header
                    _headercontrol.Author = _datasource.Author;
                    _headercontrol.Title = _datasource.Title;
                    _headercontrol.Description = _datasource.Description;
                    StyleConstants styles = new StyleConstants();
                    _headercontrol.ChapterColor = styles.SecondColors[_listnumber % 4];

                    stack.StackItemFullAnimationStarted += StackItem_FullAnimationStarted;
                    stack.StackItemFullAnimationCompleted += StackItem_FullAnimationCompleted;
                    stack.StackItemThumbAnimationStarted += StackItem_ThumbAnimationStarted;
                    stack.StackItemThumbAnimationCompleted += StackItem_ThumbAnimationCompleted;

                    stack.StackSizeChangeStarted += Stack_SizeChangeStarted;
                    stack.StackSizeChangeDelta += Stack_SizeChangeDelta;
                    stack.StackSizeChangeCompleted += Stack_SizeChangeCompleted;
                    stack.StackSizeAnimationStarted += Stack_SizeAnimationStarted;
                    stack.StackSizeAnimationCompleted += Stack_SizeAnimationCompleted;

                    stack.IControlsComponentSelected += IControls_ComponentSelected;

                    //_startimage.Source = new BitmapImage(new Uri("ms-appx:///roadsdata/text"+(int)(i+1)+".png"));

                    if (stack.NumberOfItems == 1)
                        stack.SetToOpen();

                    _panel.Children.Add(stack);
                    _stacksvector.Add(stack);
                }
                _panel.Children.Add(_auxgrid);
                updatewidth();
            }
        }
Example #7
0
 public void SetItemToFull(int section, int page)
 {
     _stacksvector[section].SetItemToFull(page);
     _selectedindex = section;
     _selectedstack = _stacksvector[section];
 }
Example #8
0
        public void OpenStack(int index)
        {
            for (int i = 0; i < _stacksvector.Count; i++)
            {
                if (_stacksvector[i].IsOpen)
                    _stacksvector[i].SetToClose();
                if (_stacksvector[i].NumberOfItems == 1)
                    _stacksvector[i].SetToOpen();
            }

            _stacksvector[index].SetToOpen();
            updatewidth();
            _selectedstack = _stacksvector[index];
            _selectedindex = index;
        }