Example #1
0
            /**
             * Reloads a list section within the long list selector items source.
             */
            public void ReloadListSection(ListViewSection section)
            {
                if (mListSections.Count > section.ItemsSourceSectionIndex)
                {
                    ListSection<ListItem> sectionToReload = mListSections[section.ItemsSourceSectionIndex];
                    sectionToReload.Title = section.Title;
                    sectionToReload.Header = section.Header;
                    sectionToReload.HeaderColor = section.GetHeaderBackgroundColor();
                    sectionToReload.HeaderFontColor = section.GetHeaderFontColor();
                    sectionToReload.HeaderFontFamily = section.GetHeaderFontFamily();
                    sectionToReload.HeaderFontSize = section.GetHeaderFontSize();
                    sectionToReload.HeaderFontStyle = section.GetHeaderFontStyle();
                    sectionToReload.HeaderFontWeight = section.GetHeaderFontWeight();
                    sectionToReload.HeaderTextHorizontalAlignment = section.GetHeaderHorizontalAlignment();
                    sectionToReload.HeaderTextVerticalAlignment = section.GetHeaderVerticalAlignment();
                    sectionToReload.Footer = section.Footer;
                    sectionToReload.FooterColor = section.GetFooterBackgroundColor();
                    sectionToReload.FooterFontColor = section.GetFooterFontColor();
                    sectionToReload.FooterFontFamily = section.GetFooterFontFamily();
                    sectionToReload.FooterFontSize = section.GetFooterFontSize();
                    sectionToReload.FooterFontStyle = section.GetFooterFontStyle();
                    sectionToReload.FooterFontWeight = section.GetFooterFontWeight();
                    sectionToReload.FooterTextHorizontalAlignment = section.GetFooterHorizontalAlignment();
                    sectionToReload.FooterTextVerticalAlignment = section.GetFooterVerticalAlignment();
                    sectionToReload.GroupHeaderColor = section.GetGroupHeaderBackgroundColor();

                    mListSections[section.ItemsSourceSectionIndex] = sectionToReload;
                }
            }
Example #2
0
            /**
             * Creates a section model from the added widget.
             */
            private ListSection<ListItem> CreateSectionModelFromWidget(ListViewSection section)
            {
                ListSection<ListItem> currentSection = new ListSection<ListItem>();
                currentSection.Title = section.Title;
                currentSection.Header = section.Header;
                currentSection.Footer = section.Footer;
                currentSection.HeaderColor = section.GetHeaderBackgroundColor();
                currentSection.HeaderFontColor = section.GetHeaderFontColor();
                currentSection.HeaderFontFamily = section.GetHeaderFontFamily();
                currentSection.HeaderFontSize = section.GetHeaderFontSize();
                currentSection.HeaderFontStyle = section.GetHeaderFontStyle();
                currentSection.HeaderFontWeight = section.GetHeaderFontWeight();
                currentSection.HeaderTextHorizontalAlignment = section.GetHeaderHorizontalAlignment();
                currentSection.HeaderTextVerticalAlignment = section.GetHeaderVerticalAlignment();
                currentSection.Footer = section.Footer;
                currentSection.FooterColor = section.GetFooterBackgroundColor();
                currentSection.FooterFontColor = section.GetFooterFontColor();
                currentSection.FooterFontFamily = section.GetFooterFontFamily();
                currentSection.FooterFontSize = section.GetFooterFontSize();
                currentSection.FooterFontStyle = section.GetFooterFontStyle();
                currentSection.FooterFontWeight = section.GetFooterFontWeight();
                currentSection.FooterTextHorizontalAlignment = section.GetFooterHorizontalAlignment();
                currentSection.FooterTextVerticalAlignment = section.GetFooterVerticalAlignment();
                currentSection.GroupHeaderColor = section.GetGroupHeaderBackgroundColor();

                for (int i = 0; i < section.ChildrenCount; i++ )
                {
                    IWidget widget = section.GetChild(i);
                    if (widget is ListViewItem)
                    {
                        ListViewItem listItem = widget as ListViewItem;
                        ListItem newItem = new ListItem();
                        newItem.Height = listItem.Height;
                        newItem.Width = listItem.Width;
                        newItem.Title = listItem.Text;
                        newItem.Subtitle = listItem.Subtitle;
                        newItem.FontSize = listItem.GetFontSize();
                        newItem.FontColor = listItem.GetFontColor();
                        newItem.SubtitleFontColor = listItem.GetSubtitleFontColor();
                        if (mListViewStyle == ListViewStyle.NoSubtitle)
                        {
                            newItem.SubtitleVisibility = Visibility.Collapsed;
                        }
                        else
                        {
                            newItem.SubtitleVisibility = Visibility.Visible;
                        }
                        newItem.ImageSource = listItem.IconImageSource;

                        listItem.ItemsSourceItemIndex = currentSection.Count;

                        currentSection.Add(newItem);

                        mModelToItemWidgetMap.Add(newItem.UniqueID, listItem);
                    }
                }

                return currentSection;
            }
Example #3
0
            /**
             * Reloads a list section within the long list selector items source.
             */
            public void ReloadListSection(ListViewSection section)
            {
                if (mListSections.Count > section.ItemsSourceSectionIndex)
                {
                    ListSection<ListItem> sectionToReload = mListSections[section.ItemsSourceSectionIndex];
                    sectionToReload.Title = section.Title;
                    sectionToReload.Header = section.Header;
                    sectionToReload.HeaderColor = section.GetHeaderBackgroundColor();
                    sectionToReload.HeaderFontColor = section.GetHeaderFontColor();
                    sectionToReload.HeaderFontFamily = section.GetHeaderFontFamily();
                    sectionToReload.HeaderFontSize = section.GetHeaderFontSize();
                    sectionToReload.HeaderFontStyle = section.GetHeaderFontStyle();
                    sectionToReload.HeaderFontWeight = section.GetHeaderFontWeight();
                    sectionToReload.HeaderTextHorizontalAlignment = section.GetHeaderHorizontalAlignment();
                    sectionToReload.HeaderTextVerticalAlignment = section.GetHeaderVerticalAlignment();
                    sectionToReload.Footer = section.Footer;
                    sectionToReload.FooterColor = section.GetFooterBackgroundColor();
                    sectionToReload.FooterFontColor = section.GetFooterFontColor();
                    sectionToReload.FooterFontFamily = section.GetFooterFontFamily();
                    sectionToReload.FooterFontSize = section.GetFooterFontSize();
                    sectionToReload.FooterFontStyle = section.GetFooterFontStyle();
                    sectionToReload.FooterFontWeight = section.GetFooterFontWeight();
                    sectionToReload.FooterTextHorizontalAlignment = section.GetFooterHorizontalAlignment();
                    sectionToReload.FooterTextVerticalAlignment = section.GetFooterVerticalAlignment();
                    sectionToReload.GroupHeaderColor = section.GetGroupHeaderBackgroundColor();

                    mListSections[section.ItemsSourceSectionIndex] = sectionToReload;
                }
            }
Example #4
0
            /**
             * Creates a section model from the added widget.
             */
            private ListSection<ListItem> CreateSectionModelFromWidget(ListViewSection section)
            {
                ListSection<ListItem> currentSection = new ListSection<ListItem>();
                currentSection.Title = section.Title;
                currentSection.Header = section.Header;
                currentSection.Footer = section.Footer;
                currentSection.HeaderColor = section.GetHeaderBackgroundColor();
                currentSection.HeaderFontColor = section.GetHeaderFontColor();
                currentSection.HeaderFontFamily = section.GetHeaderFontFamily();
                currentSection.HeaderFontSize = section.GetHeaderFontSize();
                currentSection.HeaderFontStyle = section.GetHeaderFontStyle();
                currentSection.HeaderFontWeight = section.GetHeaderFontWeight();
                currentSection.HeaderTextHorizontalAlignment = section.GetHeaderHorizontalAlignment();
                currentSection.HeaderTextVerticalAlignment = section.GetHeaderVerticalAlignment();
                currentSection.Footer = section.Footer;
                currentSection.FooterColor = section.GetFooterBackgroundColor();
                currentSection.FooterFontColor = section.GetFooterFontColor();
                currentSection.FooterFontFamily = section.GetFooterFontFamily();
                currentSection.FooterFontSize = section.GetFooterFontSize();
                currentSection.FooterFontStyle = section.GetFooterFontStyle();
                currentSection.FooterFontWeight = section.GetFooterFontWeight();
                currentSection.FooterTextHorizontalAlignment = section.GetFooterHorizontalAlignment();
                currentSection.FooterTextVerticalAlignment = section.GetFooterVerticalAlignment();
                currentSection.GroupHeaderColor = section.GetGroupHeaderBackgroundColor();

                for (int i = 0; i < section.ChildrenCount; i++ )
                {
                    IWidget widget = section.GetChild(i);
                    if (widget is ListViewItem)
                    {
                        ListViewItem listItem = widget as ListViewItem;
                        ListItem newItem = new ListItem();
                        newItem.Height = listItem.Height;
                        newItem.Width = listItem.Width;
                        newItem.Title = listItem.Text;
                        newItem.Subtitle = listItem.Subtitle;
                        newItem.FontSize = listItem.GetFontSize();
                        newItem.FontColor = listItem.GetFontColor();
                        newItem.SubtitleFontColor = listItem.GetSubtitleFontColor();
                        if (mListViewStyle == ListViewStyle.NoSubtitle)
                        {
                            newItem.SubtitleVisibility = Visibility.Collapsed;
                        }
                        else
                        {
                            newItem.SubtitleVisibility = Visibility.Visible;
                        }
                        newItem.ImageSource = listItem.IconImageSource;

                        listItem.ItemsSourceItemIndex = currentSection.Count;

                        currentSection.Add(newItem);

                        mModelToItemWidgetMap.Add(newItem.UniqueID, listItem);
                    }
                }

                return currentSection;
            }