本文整理匯總了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");
}
示例2: OnApplyTemplate
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
this.ScrollViewer = (ScrollViewer)this.GetTemplateChild("ScrollingHost");
this.ScrollViewer.ViewChanged += ScrollViewer_ViewChanged;
}
示例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");
}
示例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";
}
}
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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
};
}
示例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");
}
示例12: OnApplyTemplate
protected override void OnApplyTemplate()
{
scrollViewer = GetTemplateChild("ScrollViewer") as ScrollViewer;
progressRing = GetTemplateChild("ProgressRing") as ProgressRing;
scrollViewer.Loaded += scrollViewer_Loaded;
base.OnApplyTemplate();
}
示例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;
}
示例14: DayCalendar
public DayCalendar(DateTime date, ScrollViewer myScroll)
{
Date = date;
this.InitializeComponent();
Canvas = new Canvas[24, 7];
initBorder();
}
示例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;
}