Наследование: ListViewBase, IListView
Пример #1
0
        public MainPage()
        {
            this.InitializeComponent();

            Condominio c1 = new Condominio("COND 1");
            Condominio c2 = new Condominio("COND 2");
            Condominio c3 = new Condominio("COND 3");
            Condominio c4 = new Condominio("COND 4");
            gerente.addCondominio(c1);
            gerente.addCondominio(c2);
            gerente.addCondominio(c3);
            gerente.addCondominio(c4);
            Bloco b1 = new Bloco(1);
            Bloco b2 = new Bloco(2);
            Bloco b3 = new Bloco(3);
            c1.addBloco(b1);
            c1.addBloco(b2);
            c2.addBloco(b3);

            //CONDOMINIOS
            listaCondominios = flipCond;
            listaCondominios.ItemsSource = gerente;

            //BLOCOS
            listaBlocos = listBlocos;
            listaBlocos.ItemsSource = listaCondominios.SelectedItem;
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            FullGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("FullGrid");
            SnapGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("SnapGrid");
            PortaitGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("PortaitGrid");
            textBlock = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("textBlock");
            ContentView2 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView2");
            ItemListView1 = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView1");
            ContentView1 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView1");
            TitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TitleText");
            grid = (Windows.UI.Xaml.Controls.Grid)this.FindName("grid");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            PostTitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PostTitleText");
            ContentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView");
        }
Пример #3
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            pageRoot = (_8Tracks.Common.LayoutAwarePage) this.FindName("pageRoot");
            groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("groupedItemsViewSource");
            passwordPrompt         = (Windows.UI.Xaml.Controls.Grid) this.FindName("passwordPrompt");
            itemGridView           = (Windows.UI.Xaml.Controls.GridView) this.FindName("itemGridView");
            itemListView           = (Windows.UI.Xaml.Controls.ListView) this.FindName("itemListView");
            backButton             = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton");
            pageTitle             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle");
            loginText             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("loginText");
            loginBox              = (Windows.UI.Xaml.Controls.TextBox) this.FindName("loginBox");
            passwordText          = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("passwordText");
            passwordBox           = (Windows.UI.Xaml.Controls.PasswordBox) this.FindName("passwordBox");
            doneButton            = (Windows.UI.Xaml.Controls.Button) this.FindName("doneButton");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates");
            FullScreenLandscape   = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape");
            Filled             = (Windows.UI.Xaml.VisualState) this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait");
            Snapped            = (Windows.UI.Xaml.VisualState) this.FindName("Snapped");
        }
Пример #4
0
        private void ListBoxCompressionHandling(ListView targetlistbox)
        {
            VisualStateGroup vgroup = new VisualStateGroup();
            var border=VisualTreeHelper.GetChild(targetlistbox,0);
            var scrollViewer=VisualTreeHelper.GetChild(border,0);
            // ListBox の初めに定義されている ScrollViewerを取り出す 
            ScrollViewer ListViewScrollViewer = (ScrollViewer)scrollViewer;

            // Visual State はコントロールテンプレートの常に最上位に定義されている 
            FrameworkElement element = (FrameworkElement)VisualTreeHelper.GetChild(ListViewScrollViewer, 0);
            // Visual State を取り出しその中から 縦横Compression のVisualStateを取り出す 
            foreach (VisualStateGroup group in VisualStateManager.GetVisualStateGroups(element))
                if (group.Name == "VerticalCompression") vgroup = group;

            //縦横Compressionの状態が変わった時のイベントハンドラ 
            vgroup.CurrentStateChanging += (s,e) =>
            {
                switch (e.NewState.Name) 
                { 
                    case "CompressionTop":
                        break; 
                    case "CompressionBottom":
                        break; 
                    case "NoVerticalCompression": 
                        break; 
                    default: 
                        break; 
                } 


            };
        } 
Пример #5
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _listView = (ListView)GetTemplateChild("ListView");
            _listView.ContainerContentChanging += ListViewOnContainerContentChanging;
        }
        public void Attach(DependencyObject associatedObject)
        {
            listView = associatedObject as ListView;
            if (listView == null) return;

            listView.Loaded += ListViewOnLoaded;
        }
Пример #7
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///Tweet.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot");
            primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn");
            titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel");
            itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
            itemListScrollViewer2 = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer2");
            PeerTweets = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PeerTweets");
            itemListView2 = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView2");
            TweetBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("TweetBox");
            TweetIt = (Windows.UI.Xaml.Controls.Button)this.FindName("TweetIt");
            PinPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("PinPanel");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            PinTb = (Windows.UI.Xaml.Controls.TextBox)this.FindName("PinTb");
            VerifyPinButton = (Windows.UI.Xaml.Controls.Button)this.FindName("VerifyPinButton");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            pageSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageSubtitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail");
            TwitterConnectBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("TwitterConnectBtn");
            RefreshButton = (Windows.UI.Xaml.Controls.Button)this.FindName("RefreshButton");
        }
Пример #8
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (_8Tracks.Common.LayoutAwarePage)this.FindName("pageRoot");
            groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("groupedItemsViewSource");
            passwordPrompt = (Windows.UI.Xaml.Controls.Grid)this.FindName("passwordPrompt");
            itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            loginText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("loginText");
            loginBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("loginBox");
            passwordText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("passwordText");
            passwordBox = (Windows.UI.Xaml.Controls.PasswordBox)this.FindName("passwordBox");
            doneButton = (Windows.UI.Xaml.Controls.Button)this.FindName("doneButton");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
Пример #9
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///ArtistDetails.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot");
            primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn");
            titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel");
            itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
            itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail");
            itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid");
            itemDetailTitlePanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("itemDetailTitlePanel");
            ArtistContentTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("ArtistContentTb");
            itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle");
            itemSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemSubtitle");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail");
        }
 public UserSelect()
 {
     this.InitializeComponent();
     accountListView = listView_UserTileList;
     accountListView.SelectionChanged += Button_SelectUser_Click;
     this.Loaded += OnLoadedActions;
 }
Пример #11
0
 public static void deleteItem(ref ListView display0)
 {
     if(display0.SelectedIndex > -1)
     {
         display0.Items.RemoveAt(display0.SelectedIndex);
     }
 }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/CollectionSummaryPage.xaml"));

            CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("CollectionViewSource");
            LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot");
            OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates");
            Full = (Windows.UI.Xaml.VisualState)this.FindName("Full");
            Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill");
            Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            ScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("ScrollViewer");
            CategoryPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("CategoryPanel");
            HeaderTitlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("HeaderTitlePanel");
            ItemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("ItemGridView");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            Title = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("Title");
            Image = (Windows.UI.Xaml.Controls.Image)this.FindName("Image");
            DescriptionText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("DescriptionText");
            BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton");
            PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle");
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/CollectionSummaryPage.xaml"));

            CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("CollectionViewSource");
            LayoutRoot           = (Windows.UI.Xaml.Controls.Grid) this.FindName("LayoutRoot");
            OrientationStates    = (Windows.UI.Xaml.VisualStateGroup) this.FindName("OrientationStates");
            Full             = (Windows.UI.Xaml.VisualState) this.FindName("Full");
            Fill             = (Windows.UI.Xaml.VisualState) this.FindName("Fill");
            Portrait         = (Windows.UI.Xaml.VisualState) this.FindName("Portrait");
            Snapped          = (Windows.UI.Xaml.VisualState) this.FindName("Snapped");
            ScrollViewer     = (Windows.UI.Xaml.Controls.ScrollViewer) this.FindName("ScrollViewer");
            CategoryPanel    = (Windows.UI.Xaml.Controls.StackPanel) this.FindName("CategoryPanel");
            HeaderTitlePanel = (Windows.UI.Xaml.Controls.Grid) this.FindName("HeaderTitlePanel");
            ItemGridView     = (Windows.UI.Xaml.Controls.GridView) this.FindName("ItemGridView");
            ItemListView     = (Windows.UI.Xaml.Controls.ListView) this.FindName("ItemListView");
            Title            = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("Title");
            Image            = (Windows.UI.Xaml.Controls.Image) this.FindName("Image");
            DescriptionText  = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("DescriptionText");
            BackButton       = (Windows.UI.Xaml.Controls.Button) this.FindName("BackButton");
            PageTitle        = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PageTitle");
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///CommentPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (TheBellyofAuthority.Common.LayoutAwarePage)this.FindName("pageRoot");
            commentBar = (Windows.UI.Xaml.Controls.AppBar)this.FindName("commentBar");
            DeleteButton = (Windows.UI.Xaml.Controls.Button)this.FindName("DeleteButton");
            EditButton = (Windows.UI.Xaml.Controls.Button)this.FindName("EditButton");
            commentThread = (Windows.UI.Xaml.Controls.ListView)this.FindName("commentThread");
            commentLabel = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("commentLabel");
            commentBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("commentBox");
            postButton = (Windows.UI.Xaml.Controls.Button)this.FindName("postButton");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            UserPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("UserPanel");
            progBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progBar");
            LabelBox = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("LabelBox");
            UserBox = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("UserBox");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
Пример #15
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///SearchResultsPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            pageRoot              = (SimpleSearchProvider.Common.LayoutAwarePage) this.FindName("pageRoot");
            resultsViewSource     = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("resultsViewSource");
            filtersViewSource     = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("filtersViewSource");
            resultsPanel          = (Windows.UI.Xaml.Controls.Grid) this.FindName("resultsPanel");
            noResultsTextBlock    = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("noResultsTextBlock");
            typicalPanel          = (Windows.UI.Xaml.Controls.Grid) this.FindName("typicalPanel");
            snappedPanel          = (Windows.UI.Xaml.Controls.Grid) this.FindName("snappedPanel");
            resultsListView       = (Windows.UI.Xaml.Controls.ListView) this.FindName("resultsListView");
            filtersItemsControl   = (Windows.UI.Xaml.Controls.ItemsControl) this.FindName("filtersItemsControl");
            resultsGridView       = (Windows.UI.Xaml.Controls.GridView) this.FindName("resultsGridView");
            backButton            = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton");
            pageTitle             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle");
            resultText            = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("resultText");
            queryText             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("queryText");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates");
            ResultStates          = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ResultStates");
            ResultsFound          = (Windows.UI.Xaml.VisualState) this.FindName("ResultsFound");
            NoResultsFound        = (Windows.UI.Xaml.VisualState) this.FindName("NoResultsFound");
            FullScreenLandscape   = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape");
            Filled             = (Windows.UI.Xaml.VisualState) this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait");
            Snapped            = (Windows.UI.Xaml.VisualState) this.FindName("Snapped");
        }
Пример #16
0
        protected override void Dispose(bool disposing)
        {
            if (List != null)
            {
                if (_subscribedToTapped)
                {
                    _subscribedToTapped = false;
                    List.Tapped        -= ListOnTapped;
                }
                if (_subscribedToItemClick)
                {
                    _subscribedToItemClick = false;
                    List.ItemClick        -= OnListItemClicked;
                }
                List.SelectionChanged -= OnControlSelectionChanged;

                List.DataContext = null;
                List             = null;
            }

            if (_zoom != null)
            {
                _zoom.ViewChangeCompleted -= OnViewChangeCompleted;
                _zoom = null;
            }

            base.Dispose(disposing);
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://wikipediaquerytoolxaml/Files/SplitPage.xaml"));

            CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("CollectionViewSource");
            LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot");
            OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates");
            Full = (Windows.UI.Xaml.VisualState)this.FindName("Full");
            Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill");
            Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait");
            PortraitDetail = (Windows.UI.Xaml.VisualState)this.FindName("PortraitDetail");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            SnappedDetail = (Windows.UI.Xaml.VisualState)this.FindName("SnappedDetail");
            PrimaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("PrimaryColumn");
            TitlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("TitlePanel");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            ItemDetail = (Windows.UI.Xaml.Controls.ContentControl)this.FindName("ItemDetail");
            ItemStackPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("ItemStackPanel");
            BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton");
            PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle");
        }
Пример #18
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///SplitPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (NoelBlogReader.Common.LayoutAwarePage)this.FindName("pageRoot");
            itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource");
            primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn");
            titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel");
            itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
            itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail");
            itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid");
            itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle");
            contentViewBorder = (Windows.UI.Xaml.Controls.Border)this.FindName("contentViewBorder");
            contentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("contentView");
            contentViewRect = (Windows.UI.Xaml.Shapes.Rectangle)this.FindName("contentViewRect");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail");
        }
Пример #19
0
        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                e.OldElement.ItemSelected      -= OnElementItemSelected;
                e.OldElement.ScrollToRequested -= OnElementScrollToRequested;
            }

            if (e.NewElement != null)
            {
                e.NewElement.ItemSelected      += OnElementItemSelected;
                e.NewElement.ScrollToRequested += OnElementScrollToRequested;

                if (List == null)
                {
                    List = new WListView
                    {
                        IsSynchronizedWithCurrentItem = false,
                        ItemTemplate       = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["CellTemplate"],
                        HeaderTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        FooterTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        ItemContainerStyle = (Windows.UI.Xaml.Style)WApp.Current.Resources["FormsListViewItem"],
                        GroupStyleSelector = (GroupStyleSelector)WApp.Current.Resources["ListViewGroupSelector"]
                    };

                    // In order to support tapping on elements within a list item, we handle
                    // ListView.Tapped (which can be handled by child elements in the list items
                    // and prevented from bubbling up) rather than ListView.ItemClick
                    List.Tapped += ListOnTapped;

                    if (ShouldCustomHighlight)
                    {
                        List.SelectionChanged += OnControlSelectionChanged;
                    }

                    List.SetBinding(ItemsControl.ItemsSourceProperty, "");
                }

                // WinRT throws an exception if you set ItemsSource directly to a CVS, so bind it.
                List.DataContext = new CollectionViewSource {
                    Source = Element.ItemsSource, IsSourceGrouped = Element.IsGroupingEnabled
                };

#if !WINDOWS_UWP
                var selected = Element.SelectedItem;
                if (selected != null)
                {
                    OnElementItemSelected(null, new SelectedItemChangedEventArgs(selected));
                }
#endif

                UpdateGrouping();
                UpdateHeader();
                UpdateFooter();
                ClearSizeEstimate();
            }
        }
Пример #20
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _headerBackground = this.GetTemplateChild(HeaderBackgroundName) as Windows.UI.Xaml.Controls.ScrollViewer;
            _mainListview     = this.GetTemplateChild(ScrollViewerName) as Windows.UI.Xaml.Controls.ListView;
            _commandBar       = this.GetTemplateChild(CommandBarName) as Windows.UI.Xaml.Controls.CommandBar;
        }
Пример #21
0
 public static void ListViewScrollToTop(ListView lv)
 {
     if (lv.Items.Count > 0)
     {
         var item0 = lv.Items[0];
         lv.ScrollIntoView(item0, ScrollIntoViewAlignment.Leading);
     }
 }
Пример #22
0
 public void LoadData(ListView listView)
 {
     var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "expenses.sqlite");
     using (var db = new SQLite.SQLiteConnection(dbPath))
     {
         var res = db.Table<Data>().ToList();
         listView.ItemsSource = res;
     }
 }
Пример #23
0
 public MessageListItem(Message message, int messageId, bool sent, ListView parent)
 {
     if (message.IsFile) this.contents = message.FileName;
     else this.contents = message.Contents;
     this.sent = sent;
     this.parent = parent;
     this.message = message;
     this.messageId = messageId;
 }
Пример #24
0
		/// <summary>
		///     Adds tasks to a class listview
		/// </summary>
		/// <param name="c">Class to add tasks to</param>
		/// <param name="clv">Listview to add tasks to</param>
		/// <returns></returns>
		public static async System.Threading.Tasks.Task AddTasks(Class c, ListView clv)
		{
			string taskSortMode = DataHandler.GetTaskSortMode();
			foreach (Task t in (List<Task>) SortingLogic.Invoke<Task>(taskSortMode, new object[] { c.Id }))
			{
				AddTask(c, clv, t);
				await System.Threading.Tasks.Task.Delay(1);
			}
		}
Пример #25
0
 private void OnEdgeTapped(ListView sender, ListViewEdgeTappedEventArgs e)
 {
     // When user releases the pointer after pessing on the left edge of the item,
     // the ListView will switch to Multiple Selection 
     ShoppingListView.SelectionMode = ListViewSelectionMode.Multiple;
     // Also, we want the Left Edge Tap funcionality will be no longer enable. 
     ShoppingListView.IsItemLeftEdgeTapEnabled = false;
     // It's desirable that the Appbar shows the actions available for multiselect
     SetCommandsVisibility(ShoppingListView);
 }
Пример #26
0
 public static void addNewItem(ref ListView display0, string str)
 {
     TextBlock textBlock = new TextBlock();
     if (!String.IsNullOrEmpty(str))
     {
         textBlock.Text = str;
         textBlock.Tapped += TextBlock_Tapped1;
         display0.Items.Add(textBlock);
     }
        // File.AppendAllText("EmojiTable.txt", textBlock.Text + Environment.NewLine);
 }
Пример #27
0
        public void writeToList(ListView listView, ListViewItem itm)
        {
            foreach (var line in File.ReadLines(fileName))
            {

                itm = new ListViewItem();
                itm.FontFamily = font;
                itm.Content = line;
                listView.Items.Add(itm);
            }
        }
Пример #28
0
        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                e.OldElement.ItemSelected      -= OnElementItemSelected;
                e.OldElement.ScrollToRequested -= OnElementScrollToRequested;
            }

            if (e.NewElement != null)
            {
                e.NewElement.ItemSelected      += OnElementItemSelected;
                e.NewElement.ScrollToRequested += OnElementScrollToRequested;

                if (List == null)
                {
                    List = new WListView
                    {
                        IsSynchronizedWithCurrentItem = false,
                        ItemTemplate       = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["CellTemplate"],
                        HeaderTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        FooterTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        ItemContainerStyle = (Windows.UI.Xaml.Style)WApp.Current.Resources["FormsListViewItem"],
                        GroupStyleSelector = (GroupStyleSelector)WApp.Current.Resources["ListViewGroupSelector"]
                    };

                    List.IsItemClickEnabled = true;
                    List.ItemClick         += OnListItemClicked;

                    List.SelectionChanged += OnControlSelectionChanged;

                    List.SetBinding(ItemsControl.ItemsSourceProperty, "");
                }

                // WinRT throws an exception if you set ItemsSource directly to a CVS, so bind it.
                List.DataContext = new CollectionViewSource {
                    Source = Element.ItemsSource, IsSourceGrouped = Element.IsGroupingEnabled
                };

#if !WINDOWS_UWP
                var selected = Element.SelectedItem;
                if (selected != null)
                {
                    OnElementItemSelected(null, new SelectedItemChangedEventArgs(selected));
                }
#endif

                UpdateGrouping();
                UpdateHeader();
                UpdateFooter();
                ClearSizeEstimate();
            }
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            map = (Bing.Maps.Map)this.FindName("map");
            progressBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progressBar");
            listViewVenues = (Windows.UI.Xaml.Controls.ListView)this.FindName("listViewVenues");
        }
Пример #30
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            CapturedPhoto = (Windows.UI.Xaml.Controls.Image)this.FindName("CapturedPhoto");
            Gallery = (Windows.UI.Xaml.Controls.ListView)this.FindName("Gallery");
            MessageBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("MessageBox");
        }
Пример #31
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            FeedList = (Windows.UI.Xaml.Controls.ListView) this.FindName("FeedList");
        }
Пример #32
0
        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                e.OldElement.ItemSelected      -= OnElementItemSelected;
                e.OldElement.ScrollToRequested -= OnElementScrollToRequested;
                ((ITemplatedItemsView <Cell>)e.OldElement).TemplatedItems.CollectionChanged -= OnCollectionChanged;
                if (Control != null)
                {
                    Control.Loaded -= ControlOnLoaded;
                }
            }

            if (e.NewElement != null)
            {
                e.NewElement.ItemSelected      += OnElementItemSelected;
                e.NewElement.ScrollToRequested += OnElementScrollToRequested;
                ((ITemplatedItemsView <Cell>)e.NewElement).TemplatedItems.CollectionChanged += OnCollectionChanged;

                if (List == null)
                {
                    List = new ListViewTransparent
                    {
                        IsSynchronizedWithCurrentItem = false,
                        ItemTemplate       = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["CellTemplate"],
                        HeaderTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        FooterTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        ItemContainerStyle = (Windows.UI.Xaml.Style)WApp.Current.Resources["FormsListViewItem"],
                        GroupStyleSelector = (GroupStyleSelector)WApp.Current.Resources["ListViewGroupSelector"]
                    };

                    List.SelectionChanged += OnControlSelectionChanged;
                }

                ReloadData();

                UpdateGrouping();
                UpdateHeader();
                UpdateFooter();
                UpdateSelectionMode();
                UpdateWindowsSpecificSelectionMode();
                ClearSizeEstimate();
                UpdateVerticalScrollBarVisibility();
                UpdateHorizontalScrollBarVisibility();

                if (Control != null)
                {
                    Control.Loaded += ControlOnLoaded;
                }
            }
        }
Пример #33
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                if (List != null)
                {
                    foreach (ViewToRendererConverter.WrapperControl wrapperControl in FindDescendants <ViewToRendererConverter.WrapperControl>(List))
                    {
                        wrapperControl.CleanUp();
                    }

                    if (_subscribedToTapped)
                    {
                        _subscribedToTapped = false;
                        List.Tapped        -= ListOnTapped;
                    }
                    if (_subscribedToItemClick)
                    {
                        _subscribedToItemClick = false;
                        List.ItemClick        -= OnListItemClicked;
                    }

                    List.SelectionChanged -= OnControlSelectionChanged;
                    if (_collectionViewSource != null)
                    {
                        _collectionViewSource.Source = null;
                    }

                    List.DataContext = null;

                    // Leaving this here as a warning because setting this to null causes
                    // an AccessViolationException if you run Issue1975
                    // List.ItemsSource = null;

                    List = null;
                }

                if (_zoom != null)
                {
                    _zoom.ViewChangeCompleted -= OnViewChangeCompleted;
                    _zoom = null;
                }
            }

            base.Dispose(disposing);
        }
Пример #34
0
        async void OnPageActionSheet(Page sender, ActionSheetArguments options)
        {
            List <string> buttons = options.Buttons.ToList();

            var list = new Windows.UI.Xaml.Controls.ListView
            {
                Style              = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
                ItemsSource        = buttons,
                IsItemClickEnabled = true
            };

            var dialog = new ContentDialog
            {
                Template = (Windows.UI.Xaml.Controls.ControlTemplate)Windows.UI.Xaml.Application.Current.Resources["MyContentDialogControlTemplate"],
                Content  = list,
                Style    = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetStyle"]
            };

            if (options.Title != null)
            {
                dialog.Title = options.Title;
            }

            list.ItemClick += (s, e) =>
            {
                dialog.Hide();
                options.SetResult((string)e.ClickedItem);
            };

            _actionSheetOptions = options;

            if (options.Cancel != null)
            {
                dialog.SecondaryButtonText = options.Cancel;
            }

            if (options.Destruction != null)
            {
                dialog.PrimaryButtonText = options.Destruction;
            }

            ContentDialogResult result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Secondary)
            {
                options.SetResult(options.Cancel);
            }
            else if (result == ContentDialogResult.Primary)
            {
                options.SetResult(options.Destruction);
            }
        }
Пример #35
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // TODO: Prepare page for display here.
            if (!visited)
            {
                visited = true;
                allDiningHallMenus.GetMenus(); //await?
            }

            ListView mainHallList = new ListView();
            mainHallList.IsItemClickEnabled = true;
            mainHallList.ItemClick += mainHallList_ItemClick;
        }
Пример #36
0
        private void SuggestionsList_SelectionChanged(object sender, Windows.UI.Xaml.Controls.SelectionChangedEventArgs e)
        {
            Windows.UI.Xaml.Controls.ListView listview = (Windows.UI.Xaml.Controls.ListView)sender;
            _viewModel.Results.SelectedItem = (ResultViewModel)listview.SelectedItem;
            if (e.AddedItems.Count > 0 && e.AddedItems[0] != null)
            {
                listview.ScrollIntoView(e.AddedItems[0]);
            }

            // To populate the AutoCompleteTextBox as soon as the selection is changed or set.
            // Setting it here instead of when the text is changed as there is a delay in executing the query and populating the result
            _launcher.AutoCompleteTextBlock.Text = ListView_FirstItem(_viewModel.QueryText);
        }
Пример #37
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            TitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TitleText");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            PostTitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PostTitleText");
            ContentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView");
        }
Пример #38
0
        public GameLobby()
        {
            InitializeComponent();

            // Initialize the lists of selected ongoing games/received invitations.
            selectedInvitation = null;
            invitations = new Dictionary<string, PeerInformation>();

            // Connect the listviews
            receivedInvitations = ReceivedInvitations;
            receivedInvitations.HorizontalAlignment = HorizontalAlignment.Center;

            PeerFinder.ConnectionRequested += ConnectionRequested;
        }
Пример #39
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            CapturedPhoto = (Windows.UI.Xaml.Controls.Image) this.FindName("CapturedPhoto");
            Gallery       = (Windows.UI.Xaml.Controls.ListView) this.FindName("Gallery");
            MessageBox    = (Windows.UI.Xaml.Controls.TextBox) this.FindName("MessageBox");
        }
Пример #40
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            criteriaTextBox = (Windows.UI.Xaml.Controls.TextBox) this.FindName("criteriaTextBox");
            searchButton    = (Windows.UI.Xaml.Controls.Button) this.FindName("searchButton");
            resultList      = (Windows.UI.Xaml.Controls.ListView) this.FindName("resultList");
        }
Пример #41
0
        public SettingsPage()
        {
            this.InitializeComponent();


            /*Color bgColor = InTheHand.ApplicationModel.Package.Current.BackgroundColor;
            if (bgColor != Colors.Transparent)
            {
                Color modColor = Color.FromArgb((byte)0xff, (byte)(bgColor.R / 3), (byte)(bgColor.G / 3), (byte)(bgColor.B / 3));
                this.Background = new SolidColorBrush(modColor);
            }*/

#if WINDOWS_UWP

            this.Transitions.Add(new NavigationThemeTransition() { DefaultNavigationTransitionInfo = new CommonNavigationTransitionInfo() { IsStaggeringEnabled = true } });

            Grid LayoutRoot = new Grid();
            LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = new Windows.UI.Xaml.GridLength(48) });
            LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = new Windows.UI.Xaml.GridLength(1, GridUnitType.Star) });
            Rectangle r = new Rectangle() { Stroke = new SolidColorBrush(Color.FromArgb(0xff, 0x80, 0x80, 0x80)), StrokeThickness = 0.5, Margin = new Windows.UI.Xaml.Thickness(-4, 0, -4, 0), Fill= new SolidColorBrush(Color.FromArgb(0xff,0xf1,0xf1,0xf1)), HorizontalAlignment = HorizontalAlignment.Stretch };
            Grid.SetRow(r, 0);
            LayoutRoot.Children.Add(r);

            SettingsList = new ListView();
            Grid.SetRow(SettingsList, 1);
            LayoutRoot.Children.Add(SettingsList);
            this.Content = LayoutRoot;

            SystemNavigationManager.GetForCurrentView().BackRequested += SettingsPage_BackRequested;
            /*Windows.UI.ViewManagement.StatusBar sb = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
            if(sb != null)
            {
                previousBackground = sb.BackgroundColor;
                previousForeground = sb.ForegroundColor;
                previousBackgroundOpacity = sb.BackgroundOpacity;
                sb.BackgroundColor = Windows.ApplicationModel.Package.Current.BackgroundColor;
                sb.BackgroundOpacity = 1.0;
                sb.ForegroundColor = Colors.White;
            }*/

#elif WINDOWS_PHONE_APP

            AppNameText.Text = InTheHand.ApplicationModel.Package.Current.DisplayName;
            PublisherText.Text = InTheHand.ApplicationModel.Package.Current.PublisherDisplayName;
            VersionText.Text = "Version " + InTheHand.ApplicationModel.Package.Current.Id.Version.ToString(4);

            Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
#endif
            this.Unloaded += SettingsPage_Unloaded;
        }
        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                e.OldElement.ItemSelected      -= OnElementItemSelected;
                e.OldElement.ScrollToRequested -= OnElementScrollToRequested;
                ((ITemplatedItemsView <Cell>)e.OldElement).TemplatedItems.CollectionChanged -= OnCollectionChanged;
            }

            if (e.NewElement != null)
            {
                e.NewElement.ItemSelected      += OnElementItemSelected;
                e.NewElement.ScrollToRequested += OnElementScrollToRequested;
                ((ITemplatedItemsView <Cell>)e.NewElement).TemplatedItems.CollectionChanged += OnCollectionChanged;

                if (List == null)
                {
                    List = new WListView
                    {
                        IsSynchronizedWithCurrentItem = false,
                        ItemTemplate       = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["CellTemplate"],
                        HeaderTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        FooterTemplate     = (Windows.UI.Xaml.DataTemplate)WApp.Current.Resources["View"],
                        ItemContainerStyle = (Windows.UI.Xaml.Style)WApp.Current.Resources["FormsListViewItem"],
                        GroupStyleSelector = (GroupStyleSelector)WApp.Current.Resources["ListViewGroupSelector"]
                    };

                    List.SelectionChanged += OnControlSelectionChanged;

                    List.SetBinding(ItemsControl.ItemsSourceProperty, "");
                }

                ReloadData();

                if (Element.SelectedItem != null)
                {
                    OnElementItemSelected(null, new SelectedItemChangedEventArgs(Element.SelectedItem));
                }

                UpdateGrouping();
                UpdateHeader();
                UpdateFooter();
                UpdateSelectionMode();
                UpdateWindowsSpecificSelectionMode();
                ClearSizeEstimate();
            }
        }
Пример #43
0
 private void SetCommandsVisibility(ListView listView)
 {
     if (listView.SelectionMode == ListViewSelectionMode.Multiple || listView.SelectedItems.Count > 1)
     {
         SelectAppBarBtn.Visibility = Visibility.Collapsed;
         CancelSelectionAppBarBtn.Visibility = Visibility.Visible;
         RemoveItemAppBarBtn.Visibility = Visibility.Visible;
     }
     else
     {
         SelectAppBarBtn.Visibility = Visibility.Visible;
         CancelSelectionAppBarBtn.Visibility = Visibility.Collapsed;
         RemoveItemAppBarBtn.Visibility = Visibility.Collapsed;
     }
 }
Пример #44
0
        static ListViewBase CreateHorizontalListView()
        {
            // TODO hartez 2018/06/05 16:18:57 Is there any performance benefit to caching the ItemsPanelTemplate lookup?
            // TODO hartez 2018/05/29 15:38:04 Make sure the ItemsViewStyles.xaml xbf gets into the nuspec
            var horizontalListView = new Windows.UI.Xaml.Controls.ListView()
            {
                ItemsPanel =
                    (ItemsPanelTemplate)Windows.UI.Xaml.Application.Current.Resources["HorizontalListItemsPanel"]
            };

            ScrollViewer.SetHorizontalScrollMode(horizontalListView, ScrollMode.Auto);
            ScrollViewer.SetHorizontalScrollBarVisibility(horizontalListView,
                                                          Windows.UI.Xaml.Controls.ScrollBarVisibility.Auto);

            return(horizontalListView);
        }
Пример #45
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            txtRssUrl     = (Windows.UI.Xaml.Controls.TextBox) this.FindName("txtRssUrl");
            TitleText     = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("TitleText");
            ItemListView  = (Windows.UI.Xaml.Controls.ListView) this.FindName("ItemListView");
            PostTitleText = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PostTitleText");
            ContentView   = (Windows.UI.Xaml.Controls.WebView) this.FindName("ContentView");
        }
Пример #46
0
        public static IAsyncAction LoadAndDisplayTagOptionsAsync(ListView listView, string apiSiteParameter)
        {
            return AsyncInfo.Run(async (cancellationToken) =>
            {
                // Create a unique file name per website.
                string tagsFileName = "tags." + apiSiteParameter + ".json";
                string content = await FilesManager.LoadAsync(storageFolder, tagsFileName);

                if (String.IsNullOrEmpty(content))
                {
                    // Get content from the web.
                    string customUriString = String.Format(tagsUriString, apiSiteParameter);
                    content = await LoadFromWeb(customUriString);

                    if (String.IsNullOrEmpty(content))
                    {
                        // No content found, there is nothing else to do.
                        return;
                    }

                    // Save it locally.
                    await FilesManager.SaveAsync(storageFolder, tagsFileName, content);
                }

                // Parse content.
                JsonObject jsonObject;
                if (!JsonObject.TryParse(content, out jsonObject))
                {
                    Debug.WriteLine("Invalid JSON oject: {0}", content);
                    return;
                }

                if (!jsonObject.ContainsKey("items"))
                {
                    Debug.WriteLine("No items value.");
                    return;
                }

                JsonArray tagsArray = jsonObject.GetNamedArray("items");

                foreach (IJsonValue jsonValue in tagsArray)
                {
                    var option = new BindableTagOption(jsonValue.GetObject());
                    listView.Items.Add(option);
                }
            });
        }
Пример #47
0
        protected override void OnApplyTemplate()
        {
            _splitView = base.GetTemplateChild("splitView") as SplitView;
            _toggle = base.GetTemplateChild("toggle") as Button;
            _exitFS = base.GetTemplateChild("exitFS") as Button;
            _headerContainer = base.GetTemplateChild("headerContainer") as Panel;
            _commandBarContainer = base.GetTemplateChild("commandBarContainer") as ContentControl;
            _paneHeaderContainer = base.GetTemplateChild("paneHeaderContainer") as ContentControl;
            _lview = base.GetTemplateChild("lview") as ListView;
            _lviewSub = base.GetTemplateChild("lviewSub") as ListView;
            _container = base.GetTemplateChild("container") as Panel;
            _content = base.GetTemplateChild("content") as Panel;

            _topPane = base.GetTemplateChild("topPane") as ContentControl;
            _rightPane = base.GetTemplateChild("rightPane") as ContentControl;

            if (ListViewItemContainerStyle != null)
            {
                _lview.ItemContainerStyleSelector = new NavigationStyleSelector(ListViewItemContainerStyle, this.SeparatorStyle);
                _lviewSub.ItemContainerStyleSelector = new NavigationStyleSelector(ListViewItemContainerStyle, this.SeparatorStyle);
            }
            else
            {
                _lview.ItemContainerStyleSelector = new NavigationStyleSelector(_lview.ItemContainerStyle, this.SeparatorStyle);
                _lviewSub.ItemContainerStyleSelector = new NavigationStyleSelector(_lview.ItemContainerStyle, this.SeparatorStyle);
            }            
            _lview.ItemContainerStyle = null;            
            _lviewSub.ItemContainerStyle = null;

            _toggle.Click += OnToggleClick;
            _exitFS.Click += OnExitFSClick;
            _splitView.PaneClosed += OnPaneClosed;
            _lview.ItemClick += OnItemClick;
            _lviewSub.ItemClick += OnItemClick;
            _lview.SelectionChanged += OnSelectionChanged;

            _isInitialized = true;

            this.SelectFirstNavigationItem();

            SetDisplayMode(this.DisplayMode);
            SetCommandBar(_commandBar);
            SetCommandBarVerticalAlignment(this.CommandBarVerticalAlignment);
            SetPaneHeader(_paneHeader);

            base.OnApplyTemplate();
        }
Пример #48
0
        private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
        {
            var windowsHost = (WindowsXamlHost)sender;

            var childCtrl = (UwpControl.Grid)windowsHost.Child;

            if (childCtrl != null)
            {
                lstView      = new UwpControl.ListView();
                lstView.Name = "lstView";

                UwpControl.ParallaxView parallax = CreateParallaxView();

                CreateListView();
                myGrid = childCtrl;
                myGrid.Children.Add(parallax);
                myGrid.Children.Add(lstView);
            }
        }
Пример #49
0
        protected override void Dispose(bool disposing)
        {
            if (List != null)
            {
                List.ItemClick        -= OnListItemClicked;
                List.SelectionChanged -= OnControlSelectionChanged;

                List.DataContext = null;
                List             = null;
            }

            if (_zoom != null)
            {
                _zoom.ViewChangeCompleted -= OnViewChangeCompleted;
                _zoom = null;
            }

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                if (List != null)
                {
                    foreach (ViewToRendererConverter.WrapperControl wrapperControl in FindDescendants <ViewToRendererConverter.WrapperControl>(List))
                    {
                        wrapperControl.CleanUp();
                    }

                    if (_subscribedToTapped)
                    {
                        _subscribedToTapped = false;
                        List.Tapped        -= ListOnTapped;
                    }
                    if (_subscribedToItemClick)
                    {
                        _subscribedToItemClick = false;
                        List.ItemClick        -= OnListItemClicked;
                    }
                    List.SelectionChanged -= OnControlSelectionChanged;
                    List.DataContext       = null;
                    List = null;
                }

                if (_zoom != null)
                {
                    _zoom.ViewChangeCompleted -= OnViewChangeCompleted;
                    _zoom = null;
                }
            }

            base.Dispose(disposing);
        }
        private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Windows.UI.Xaml.Controls.ListView list = sender as Windows.UI.Xaml.Controls.ListView;
            ItemData item = list.SelectedItem as ItemData;

            if (item == null)
            {
                return;
            }

            AudioPlayInfo para = new AudioPlayInfo()
            {
                PlayType  = PLAYTYPE.PlaySingle,
                Name      = item.Name,
                Song      = item.Song + ".mp3",
                Path      = "ms-appx:///Assets/VideoSample/Media/红豆.mp3",
                fileToken = null
            };

            Frame.Navigate(typeof(AudioPlay), para);
        }
Пример #52
0
        protected override void Dispose(bool disposing)
        {
            if (List != null)
            {
                List.Tapped -= ListOnTapped;
                List.KeyUp  -= OnKeyPressed;

                List.SelectionChanged -= OnControlSelectionChanged;

                List.DataContext = null;
                List             = null;
            }

            if (_zoom != null)
            {
                _zoom.ViewChangeCompleted -= OnViewChangeCompleted;
                _zoom = null;
            }

            base.Dispose(disposing);
        }
Пример #53
0
        ListViewBase CreateCarouselListLayout(ItemsLayoutOrientation layoutOrientation)
        {
            Windows.UI.Xaml.Controls.ListView listView;

            if (layoutOrientation == ItemsLayoutOrientation.Horizontal)
            {
                listView = new Windows.UI.Xaml.Controls.ListView()
                {
                    Style      = (Windows.UI.Xaml.Style)UWPApp.Current.Resources["HorizontalCarouselListStyle"],
                    ItemsPanel = (ItemsPanelTemplate)UWPApp.Current.Resources["HorizontalListItemsPanel"]
                };
            }
            else
            {
                listView = new Windows.UI.Xaml.Controls.ListView()
                {
                    Style = (Windows.UI.Xaml.Style)UWPApp.Current.Resources["VerticalCarouselListStyle"]
                };
            }

            return(listView);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.ListView> e)
        {
            base.OnElementChanged(e);

            _listView = Control as ListView;

            if (e.OldElement != null)
            {
                // Unsubscribe
                _listView.SelectionChanged -= OnSelectedItemChanged;
            }

            if (e.NewElement != null)
            {
                _listView.SelectionMode      = ListViewSelectionMode.Single;
                _listView.IsItemClickEnabled = false;
                _listView.ItemsSource        = ((NativeListView)e.NewElement).Items;
                _listView.ItemTemplate       = App.Current.Resources["ListViewItemTemplate"] as Windows.UI.Xaml.DataTemplate;
                // Subscribe
                _listView.SelectionChanged += OnSelectedItemChanged;
            }
        }
Пример #55
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///ReportsPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            pageRoot              = (StreetFoo.Client.UI.Common.LayoutAwarePage) this.FindName("pageRoot");
            itemsViewSource       = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("itemsViewSource");
            itemGridView          = (StreetFoo.Client.UI.MyGridView) this.FindName("itemGridView");
            itemListView          = (Windows.UI.Xaml.Controls.ListView) this.FindName("itemListView");
            backButton            = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton");
            pageTitle             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates");
            FullScreenLandscape   = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape");
            Filled             = (Windows.UI.Xaml.VisualState) this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait");
            Snapped            = (Windows.UI.Xaml.VisualState) this.FindName("Snapped");
        }
Пример #56
0
        protected override void Dispose(bool disposing)
        {
            if (List != null)
            {
                List.Tapped -= ListOnTapped;

                if (ShouldCustomHighlight)
                {
                    List.SelectionChanged -= OnControlSelectionChanged;
                }

                List.DataContext = null;
                List             = null;
            }

            if (_zoom != null)
            {
                _zoom.ViewChangeCompleted -= OnViewChangeCompleted;
                _zoom = null;
            }

            base.Dispose(disposing);
        }
Пример #57
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/GroupedCollectionPage.xaml"));

            GroupedCollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("GroupedCollectionViewSource");
            LayoutRoot        = (Windows.UI.Xaml.Controls.Grid) this.FindName("LayoutRoot");
            OrientationStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("OrientationStates");
            Full          = (Windows.UI.Xaml.VisualState) this.FindName("Full");
            Fill          = (Windows.UI.Xaml.VisualState) this.FindName("Fill");
            Portrait      = (Windows.UI.Xaml.VisualState) this.FindName("Portrait");
            Snapped       = (Windows.UI.Xaml.VisualState) this.FindName("Snapped");
            AppBar        = (Windows.UI.Xaml.Controls.ApplicationBar) this.FindName("AppBar");
            ItemListView  = (Windows.UI.Xaml.Controls.ListView) this.FindName("ItemListView");
            ItemGridView  = (Windows.UI.Xaml.Controls.GridView) this.FindName("ItemGridView");
            BackButton    = (Windows.UI.Xaml.Controls.Button) this.FindName("BackButton");
            PageTitle     = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PageTitle");
            SearchTextBox = (Windows.UI.Xaml.Controls.TextBox) this.FindName("SearchTextBox");
        }
Пример #58
0
        static async void OnPageActionSheet(object sender, ActionSheetArguments options)
        {
            List <string> buttons = options.Buttons.ToList();

            var list = new Windows.UI.Xaml.Controls.ListView
            {
                Style              = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
                ItemsSource        = buttons,
                IsItemClickEnabled = true
            };

            var dialog = new ContentDialog
            {
                Template = (Windows.UI.Xaml.Controls.ControlTemplate)Windows.UI.Xaml.Application.Current.Resources["MyContentDialogControlTemplate"],
                Content  = list,
                Style    = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetStyle"]
            };

            if (options.Title != null)
            {
                dialog.Title = options.Title;
            }

            list.ItemClick += (s, e) =>
            {
                dialog.Hide();
                options.SetResult((string)e.ClickedItem);
            };

            TypedEventHandler <CoreWindow, CharacterReceivedEventArgs> onEscapeButtonPressed = delegate(CoreWindow window, CharacterReceivedEventArgs args)
            {
                if (args.KeyCode == 27)
                {
                    dialog.Hide();
                    options.SetResult(ContentDialogResult.None.ToString());
                }
            };

            Window.Current.CoreWindow.CharacterReceived += onEscapeButtonPressed;

            if (options.Cancel != null)
            {
                dialog.SecondaryButtonText = options.Cancel;
            }

            if (options.Destruction != null)
            {
                dialog.PrimaryButtonText = options.Destruction;
            }

            ContentDialogResult result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Secondary)
            {
                options.SetResult(options.Cancel);
            }
            else if (result == ContentDialogResult.Primary)
            {
                options.SetResult(options.Destruction);
            }

            Window.Current.CoreWindow.CharacterReceived -= onEscapeButtonPressed;
        }
Пример #59
0
        void OnPageActionSheet(Page sender, ActionSheetArguments options)
        {
            var finalArguments = new List <string>();

            if (options.Destruction != null)
            {
                finalArguments.Add(options.Destruction);
            }
            if (options.Buttons != null)
            {
                finalArguments.AddRange(options.Buttons);
            }
            if (options.Cancel != null)
            {
                finalArguments.Add(options.Cancel);
            }

            var list = new Windows.UI.Xaml.Controls.ListView
            {
                Style              = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
                ItemsSource        = finalArguments,
                IsItemClickEnabled = true
            };

            list.ItemClick += (s, e) =>
            {
                _currentActionSheet.IsOpen = false;
                options.SetResult((string)e.ClickedItem);
            };

            _actionSheetOptions = options;

            Size size = Device.Info.ScaledScreenSize;

            var stack = new StackPanel
            {
                MinWidth = 100,
                Children =
                {
                    new TextBlock
                    {
                        Text       = options.Title ?? string.Empty,
                        Style      = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["TitleTextBlockStyle"],
                        Margin     = new Windows.UI.Xaml.Thickness(0, 0, 0, 10),
                        Visibility = options.Title != null ? Visibility.Visible : Visibility.Collapsed
                    },
                    list
                }
            };

            var border = new Border
            {
                Child           = stack,
                BorderBrush     = new SolidColorBrush(Colors.White),
                BorderThickness = new Windows.UI.Xaml.Thickness(1),
                Padding         = new Windows.UI.Xaml.Thickness(15),
                Background      = (Brush)Windows.UI.Xaml.Application.Current.Resources["AppBarBackgroundThemeBrush"]
            };

            Windows.UI.Xaml.Controls.Grid.SetRow(border, 1);
            Windows.UI.Xaml.Controls.Grid.SetColumn(border, 1);

            var container = new Windows.UI.Xaml.Controls.Grid
            {
                RowDefinitions =
                {
                    new Windows.UI.Xaml.Controls.RowDefinition {
                        Height = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star)
                    },
                    new Windows.UI.Xaml.Controls.RowDefinition {
                        Height = new Windows.UI.Xaml.GridLength(0, Windows.UI.Xaml.GridUnitType.Auto)
                    },
                    new Windows.UI.Xaml.Controls.RowDefinition {
                        Height = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star)
                    }
                },
                ColumnDefinitions =
                {
                    new Windows.UI.Xaml.Controls.ColumnDefinition {
                        Width = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star)
                    },
                    new Windows.UI.Xaml.Controls.ColumnDefinition {
                        Width = new Windows.UI.Xaml.GridLength(0, Windows.UI.Xaml.GridUnitType.Auto)
                    },
                    new Windows.UI.Xaml.Controls.ColumnDefinition {
                        Width = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star)
                    }
                },
                Height   = size.Height,
                Width    = size.Width,
                Children = { border }
            };

            var bgPopup = new Popup {
                Child = new Canvas {
                    Width = size.Width, Height = size.Height, Background = new SolidColorBrush(new Windows.UI.Color {
                        A = 128, R = 0, G = 0, B = 0
                    })
                }
            };

            bgPopup.IsOpen = true;

            _currentActionSheet = new Popup {
                ChildTransitions = new TransitionCollection {
                    new PopupThemeTransition()
                }, IsLightDismissEnabled = true, Child = container
            };

            _currentActionSheet.Closed += (s, e) =>
            {
                bgPopup.IsOpen = false;
                CancelActionSheet();
            };

            if (Device.Idiom == TargetIdiom.Phone)
            {
                double height = WindowBounds.Height;
                stack.Height           = height;
                stack.Width            = size.Width;
                border.BorderThickness = new Windows.UI.Xaml.Thickness(0);

                _currentActionSheet.Height         = height;
                _currentActionSheet.VerticalOffset = size.Height - height;
            }

            _currentActionSheet.IsOpen = true;
        }