當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.ScrollViewer類代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Controls.ScrollViewer的典型用法代碼示例。如果您正苦於以下問題:C# ScrollViewer類的具體用法?C# ScrollViewer怎麽用?C# ScrollViewer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ScrollViewer類屬於Windows.UI.Xaml.Controls命名空間,在下文中一共展示了ScrollViewer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InitializeComponent

        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");
        }
開發者ID:noelitoa,項目名稱:WinRT---Blog-Reader,代碼行數:29,代碼來源:SplitPage.g.i.cs

示例2: OnApplyTemplate

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.ScrollViewer = (ScrollViewer)this.GetTemplateChild("ScrollingHost");
            this.ScrollViewer.ViewChanged += ScrollViewer_ViewChanged;
        }
開發者ID:eurofurence,項目名稱:ef-app_wp,代碼行數:7,代碼來源:FixedFlipView.cs

示例3: InitializeComponent

        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");
        }
開發者ID:beaugunderson,項目名稱:Spotify-Metro-Style-App,代碼行數:26,代碼來源:CollectionSummaryPage.g.i.cs

示例4: Attach

        public void Attach(DependencyObject associatedObject)
        {
            offsets = new List<double>();
            isHidden = true;
            buttonAdded = false;

            if (!DesignMode.DesignModeEnabled)
            {
                _associatedObject = associatedObject;

                scrollviewer = _associatedObject as ScrollViewer;

                if (scrollviewer != null)
                {
                    scrollviewer.ViewChanging += Scrollviewer_ViewChanging;
                    scrollviewer.Loaded += Scrollviewer_Loaded;
                }

                if (ScrollToTopButton != null)
                {
                    ScrollToTopButton.Tapped += ScrollToTopButton_Tapped;
                    ScrollToTopButton.Name = "ScrollToTopButton";
                }
            }
        }
開發者ID:jayharry28,項目名稱:ScrollToTop,代碼行數:25,代碼來源:ScrollToTopBehavior.cs

示例5: init

        void init()
        {
            Background = new SolidColorBrush(Colors.Transparent);
            VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
            HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
            _transform = new CompositeTransform();
            _c_transform = new CompositeTransform();
            RenderTransform = _transform;

            //scroll
            _scroll = new ScrollViewer()
            {
                HorizontalScrollMode = ScrollMode.Enabled,
                VerticalScrollMode = ScrollMode.Enabled,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden,
                VerticalScrollBarVisibility = ScrollBarVisibility.Hidden
            };
            Children.Add(_scroll);
            //content
            _content = new Grid() { HorizontalAlignment = HorizontalAlignment.Left, ManipulationMode = ManipulationModes.All };
            _content.RenderTransform = _c_transform;
            _image = new Image() { Stretch = Stretch.UniformToFill };
            _border = new Border() { CornerRadius = new Windows.UI.Xaml.CornerRadius(10) };
            _content.Children.Add(_image);
            _content.Children.Add(_border);
            _scroll.Content = _content;
        }
開發者ID:Milton761,項目名稱:mLearningCoreEN,代碼行數:27,代碼來源:AnimatedBorderImage.cs

示例6: initcontrols

        void initcontrols()
        {
            _grouppanel = new StackPanel();
            _grouppanel.Background = new SolidColorBrush(Windows.UI.Colors.Transparent);
            _grouppanel.Orientation = Orientation.Horizontal;
            _grouppanel.ManipulationMode = ManipulationModes.All;
            _grouppanel.ManipulationDelta += Panel_ManipulationDelta_1;
            _grouppanel.ManipulationCompleted += Panel_ManipulationCompleted_1;
            _grouppanel.ManipulationInertiaStarting += Panel_ManipulationInertiaStarting_1;
            _grouppanel.PointerPressed += Panel_PointerPressed_1;
            _grouppanel.PointerReleased += Panel_PointerReleased_1;

            _groupscroll = new ScrollViewer();
            _groupscroll.Background = new SolidColorBrush(Windows.UI.Colors.Transparent);
            _groupscroll.HorizontalScrollMode = Windows.UI.Xaml.Controls.ScrollMode.Disabled;
            _groupscroll.VerticalScrollMode = Windows.UI.Xaml.Controls.ScrollMode.Disabled;
            _groupscroll.HorizontalScrollBarVisibility = Windows.UI.Xaml.Controls.ScrollBarVisibility.Hidden;
            _groupscroll.VerticalScrollBarVisibility = Windows.UI.Xaml.Controls.ScrollBarVisibility.Hidden;
            _groupscroll.ZoomMode = ZoomMode.Disabled;
            _groupscroll.IsHorizontalRailEnabled = false;
            Children.Add(_groupscroll);
            _groupscroll.Content = _grouppanel;

            _paneltransform = new CompositeTransform();
            _grouppanel.RenderTransform = _paneltransform;
        }
開發者ID:Milton761,項目名稱:mLearningCoreEN,代碼行數:26,代碼來源:IGroupList.cs

示例7: InitializeComponent

        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");
        }
開發者ID:sagar-sm,項目名稱:Mu,代碼行數:33,代碼來源:Tweet.g.i.cs

示例8: OnApplyTemplate

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // make sure we listen at the right time to add/remove the back button event handlers
            if(_backButton != null)
            {
                _backButton.Tapped -= OnBackButtonTapped;
            }
            _backButton = GetTemplateChild("SettingsBackButton") as Button;
            if(_backButton != null)
            {
                _backButton.Tapped += OnBackButtonTapped;
            }

            // need to get these grids in order to set the offsets correctly in RTL situations
            if (_contentGrid == null)
            {
                _contentGrid = GetTemplateChild("SettingsFlyoutContentGrid") as Grid;
            }
            _contentGrid.Transitions = new TransitionCollection();
            _contentGrid.Transitions.Add(new EntranceThemeTransition()
            {
                FromHorizontalOffset = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? CONTENT_HORIZONTAL_OFFSET : (CONTENT_HORIZONTAL_OFFSET * -1)
            });

            // need the root border for RTL scenarios
            _rootBorder = GetTemplateChild("PART_RootBorder") as Border;

            // need the content scrollviewer to set the fixed width to be the same size as flyout
            _contentScrollViewer = GetTemplateChild("PART_ContentScrollViewer") as ScrollViewer;
            
        }
開發者ID:scottdorman,項目名稱:callisto,代碼行數:33,代碼來源:SettingsFlyout.cs

示例9: Execute

        public object Execute(object sender, object parameter)
        {
            Debug.Assert(ScrollDirection != ScrollDirection.None, $"{nameof(ScrollDirection)} is set to {nameof(ScrollDirection.None)}. This behavior isn't doing anything");

            if (ScrollTarget != null && ScrollDirection != ScrollDirection.None)
            {
                if (_scrollViewer == null)
                {
                    _scrollViewer = FindScrollViewer();
                }

                if (_scrollViewer != null)
                {
                    if (ScrollDirection == ScrollDirection.Left || ScrollDirection == ScrollDirection.Right)
                    {
                        ScrollPageHorizontal(_scrollViewer, ScrollDirection);
                    }
                    else
                    {
                        ScrollPageVertical(_scrollViewer, ScrollDirection);
                    }
                }
            }

            return null;
        }
開發者ID:ali-hk,項目名稱:Toolkit,代碼行數:26,代碼來源:PagedScrollAction.cs

示例10: ListPage

        //-------------------------------------------------------------------------------
        #endregion (Util)

        //-------------------------------------------------------------------------------
        #region Constructor
        //-------------------------------------------------------------------------------
        //
        public ListPage()
        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
            this.navigationHelper.SaveState += navigationHelper_SaveState;

            CANVASES = new Canvas[] {
                    canvasMap1_E123, canvasMap1_E456, canvasMap1_W,
                    canvasMap2_E123, canvasMap2_E456, canvasMap2_W,
                    canvasMap3_E123, canvasMap3_E456, canvasMap3_W
                };
            SCROLLVIEWERS = new ScrollViewer[] {
                    scImgMap1_E123, scImgMap1_E456, scImgMap1_W,
                    scImgMap2_E123, scImgMap2_E456, scImgMap2_W,
                    scImgMap3_E123, scImgMap3_E456, scImgMap3_W
                };
            SELECT_BORDERS = new Border[] {
                borderMap1_E123, borderMap1_E456, borderMap1_W,
                borderMap2_E123, borderMap2_E456, borderMap2_W,
                borderMap3_E123, borderMap3_E456, borderMap3_W
            };
            RADIOBUTTONS = new RadioButton[] {
                rbSearch_Checklist, rbSearch_SearchString, rbSearch_Genre
            };
        }
開發者ID:kavenblog,項目名稱:ComicStarViewer,代碼行數:33,代碼來源:ListPage.xaml.cs

示例11: InitializeComponent

        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");
        }
開發者ID:sagar-sm,項目名稱:Mu,代碼行數:28,代碼來源:ArtistDetails.g.i.cs

示例12: OnApplyTemplate

 protected override void OnApplyTemplate()
 {
     scrollViewer = GetTemplateChild("ScrollViewer") as ScrollViewer;
     progressRing = GetTemplateChild("ProgressRing") as ProgressRing;
     scrollViewer.Loaded += scrollViewer_Loaded;
     base.OnApplyTemplate();
 }
開發者ID:GJian,項目名稱:UWP-master,代碼行數:7,代碼來源:GroupListView1.cs

示例13: HomeWorkList

        public HomeWorkList(double w, double h, string icon)
        {
            this.Width = w;
            this.Height = h;
            _icon = icon;
            _mainpanel = new StackPanel() 
            {
                Width = w,
                Orientation = Orientation.Vertical,
                VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top                 
            };

            _mainscroll = new ScrollViewer()
            {
                Width = w,
                Height =h ,
                HorizontalScrollMode = ScrollMode.Disabled,
                VerticalScrollMode = ScrollMode.Enabled,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled,
                VerticalScrollBarVisibility = ScrollBarVisibility.Auto
            };

            this.Children.Add(_mainscroll);
            _mainscroll.Content = _mainpanel;
        }
開發者ID:Milton761,項目名稱:mLearningCoreEN,代碼行數:25,代碼來源:HomeWorkList.cs

示例14: DayCalendar

 public DayCalendar(DateTime date, ScrollViewer myScroll)
 {
     Date = date;
     this.InitializeComponent();
     Canvas = new Canvas[24, 7];
     initBorder();
 }
開發者ID:Delvius,項目名稱:KIEPresentationV2,代碼行數:7,代碼來源:DayCalendar.xaml.cs

示例15: ChatAppWinRT

 /// <summary>
 /// Constructor for the WP8 chat app.
 /// </summary>
 public ChatAppWinRT(TextBox currentMessageInputBox, TextBlock chatHistory, ScrollViewer chatHistoryScroller)
     : base("WinRT", ConnectionType.TCP)
 {
     this.CurrentMessageInputBox = currentMessageInputBox;
     this.ChatHistory = chatHistory;
     this.ChatHistoryScroller = chatHistoryScroller;
 }
開發者ID:MarcFletcher,項目名稱:NetworkComms.Net,代碼行數:10,代碼來源:ChatAppWinRT.cs


注:本文中的Windows.UI.Xaml.Controls.ScrollViewer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。