public void InitializeComponent() { if (this._contentLoaded) { return; } this._contentLoaded = true; Application.LoadComponent(this, new Uri("/VKClient.Common;component/FavoritesPage.xaml", UriKind.Relative)); this.LayoutRoot = (Grid)base.FindName("LayoutRoot"); this.ucHeader = (GenericHeaderUC)base.FindName("ucHeader"); this.pivot = (Pivot)base.FindName("pivot"); this.pivotItemPhotos = (PivotItem)base.FindName("pivotItemPhotos"); this.photosListBox = (ExtendedLongListSelector)base.FindName("photosListBox"); this.pivotItemVideos = (PivotItem)base.FindName("pivotItemVideos"); this.videosListBox = (ExtendedLongListSelector)base.FindName("videosListBox"); this.pivotItemPosts = (PivotItem)base.FindName("pivotItemPosts"); this.scrollPosts = (ViewportControl)base.FindName("scrollPosts"); this.stackPanelPosts = (MyVirtualizingStackPanel)base.FindName("stackPanelPosts"); this.panelPosts = (MyVirtualizingPanel2)base.FindName("panelPosts"); this.pivotItemPersons = (PivotItem)base.FindName("pivotItemPersons"); this.usersListBox = (ExtendedLongListSelector)base.FindName("usersListBox"); this.pivotItemLinks = (PivotItem)base.FindName("pivotItemLinks"); this.linksListBox = (ExtendedLongListSelector)base.FindName("linksListBox"); this.pivotItemProducts = (PivotItem)base.FindName("pivotItemProducts"); this.productsListBox = (ExtendedLongListSelector)base.FindName("productsListBox"); this.ucPullToRefresh = (PullToRefreshUC)base.FindName("ucPullToRefresh"); }
public void InitializeComponent() { if (this._contentLoaded) { return; } this._contentLoaded = true; Application.LoadComponent(this, new Uri("/VKClient.Common;component/Profiles/Shared/Views/ProfilePage.xaml", UriKind.Relative)); this.Common = (VisualStateGroup)base.FindName("Common"); this.Loading = (VisualState)base.FindName("Loading"); this.Reloading = (VisualState)base.FindName("Reloading"); this.Blocked = (VisualState)base.FindName("Blocked"); this.Private = (VisualState)base.FindName("Private"); this.LoadingFailed = (VisualState)base.FindName("LoadingFailed"); this.Loaded = (VisualState)base.FindName("Loaded"); this.viewportControl = (ViewportControl)base.FindName("viewportControl"); this.stackPanelRoot = (MyVirtualizingStackPanel)base.FindName("stackPanelRoot"); this.canvasBackground = (Canvas)base.FindName("canvasBackground"); this.gridHeader = (Grid)base.FindName("gridHeader"); this.ucUserProfileInfoHeader = (VKClient.Common.Profiles.Users.Views.ProfileInfoHeaderUC)base.FindName("ucUserProfileInfoHeader"); this.ucGroupProfileInfoHeader = (VKClient.Common.Profiles.Groups.Views.ProfileInfoHeaderUC)base.FindName("ucGroupProfileInfoHeader"); this.PhotoMenu = (ContextMenu)base.FindName("PhotoMenu"); this.borderHeaderPlaceholder = (Border)base.FindName("borderHeaderPlaceholder"); this.ucMedia = (MediaItemsHorizontalUC)base.FindName("ucMedia"); this.stackPanelNotLoaded = (StackPanel)base.FindName("stackPanelNotLoaded"); this.progressRing = (ProgressRing)base.FindName("progressRing"); this.textBlockLoadingStatus = (TextBlock)base.FindName("textBlockLoadingStatus"); this.buttonTryAgain = (Button)base.FindName("buttonTryAgain"); this.wallPanel = (MyVirtualizingPanel2)base.FindName("wallPanel"); this.ucHeader = (GenericHeaderUC)base.FindName("ucHeader"); this.ucPullToRefresh = (PullToRefreshUC)base.FindName("ucPullToRefresh"); }
/// <summary> /// ay 2015-05-23 15:34:08 增加,不需要查找子容器 /// </summary> /// <param name="container"></param> /// <param name="item"></param> /// <returns></returns> public static TreeViewItem GetTreeViewItem2(ItemsControl container, object item) { if (container != null) { if (container.DataContext == item) { return(container as TreeViewItem); } // Expand the current container if (container is TreeViewItem && !((TreeViewItem)container).IsExpanded) { container.SetValue(TreeViewItem.IsExpandedProperty, true); } // Try to generate the ItemsPresenter and the ItemsPanel. // by calling ApplyTemplate. Note that in the // virtualizing case even if the item is marked // expanded we still need to do this step in order to // regenerate the visuals because they may have been virtualized away. container.ApplyTemplate(); ItemsPresenter itemsPresenter = (ItemsPresenter)container.Template.FindName("ItemsHost", container); if (itemsPresenter != null) { itemsPresenter.ApplyTemplate(); } else { // The Tree template has not named the ItemsPresenter, // so walk the descendents and find the child. itemsPresenter = WpfTreeHelper.FindVisualChild <ItemsPresenter>(container); if (itemsPresenter == null) { container.UpdateLayout(); itemsPresenter = WpfTreeHelper.FindVisualChild <ItemsPresenter>(container); } } Panel itemsHostPanel = (Panel)VisualTreeHelper.GetChild(itemsPresenter, 0); // Ensure that the generator for this panel has been created. UIElementCollection children = itemsHostPanel.Children; MyVirtualizingStackPanel virtualizingPanel = itemsHostPanel as MyVirtualizingStackPanel; for (int i = 0, count = container.Items.Count; i < count; i++) { TreeViewItem subContainer = (TreeViewItem)container.ItemContainerGenerator.ContainerFromIndex(i); if (subContainer.DataContext == item) { subContainer.IsExpanded = false; return(subContainer as TreeViewItem); } } } return(null); }
public void InitializeComponent() { if (this._contentLoaded) { return; } this._contentLoaded = true; Application.LoadComponent(this, new Uri("/VKClient.Common;component/NewsPage.xaml", UriKind.Relative)); this.LayoutRoot = (Grid)base.FindName("LayoutRoot"); this.ContentPanel = (Grid)base.FindName("ContentPanel"); this.scrollNews = (ViewportControl)base.FindName("scrollNews"); this.stackPanel = (MyVirtualizingStackPanel)base.FindName("stackPanel"); //this.ucNewPost = (NewsfeedNewPostUC)base.FindName("ucNewPost"); this.panelNews = (MyVirtualizingPanel2)base.FindName("panelNews"); this.Header = (NewsfeedHeaderUC)base.FindName("Header"); this.rectSystemTrayPlaceholder = (Rectangle)base.FindName("rectSystemTrayPlaceholder"); this.ucPullToRefresh = (PullToRefreshUC)base.FindName("ucPullToRefresh"); }
public void InitializeComponent() { if (this._contentLoaded) { return; } this._contentLoaded = true; Application.LoadComponent((object)this, new Uri("/VKClient.Groups;component/GroupPage.xaml", UriKind.Relative)); this.LayoutRoot = (Grid)base.FindName("LayoutRoot"); this.Header = (GenericHeaderUC)base.FindName("Header"); this.pivot = (Pivot)base.FindName("pivot"); this.pivotItemMain = (PivotItem)base.FindName("pivotItemMain"); this.scrollViewer = (ViewportControl)base.FindName("scrollViewer"); this.stackPanelMain = (MyVirtualizingStackPanel)base.FindName("stackPanelMain"); this.wallPanel = (MyVirtualizingPanel2)base.FindName("wallPanel"); this.ucPullToRefresh = (PullToRefreshUC)base.FindName("ucPullToRefresh"); // this.rectangleGeometry = (RectangleGeometry)base.FindName("rectangleGeometry"); this.rectangleGeometry2 = (RectangleGeometry)base.FindName("rectangleGeometry2"); }