本文整理匯總了C#中Windows.UI.Core.WindowSizeChangedEventArgs類的典型用法代碼示例。如果您正苦於以下問題:C# WindowSizeChangedEventArgs類的具體用法?C# WindowSizeChangedEventArgs怎麽用?C# WindowSizeChangedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WindowSizeChangedEventArgs類屬於Windows.UI.Core命名空間,在下文中一共展示了WindowSizeChangedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnSizeChanged
void OnSizeChanged(object sender,
WindowSizeChangedEventArgs e)
{
base.SetActive(
((this.AspectRatio == AspectRatio.Landscape) && (e.Size.Width > e.Size.Height)) ||
((this.AspectRatio == AspectRatio.Portrait) && (e.Size.Width <= e.Size.Height)));
}
示例2: ExtendedSplash_OnResize
void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e) {
if (splash != null) {
splashImageRect = splash.ImageLocation;
PositionImage();
//PositionRing();
PositionLoginButton();
}
}
示例3: OnWindowSizeChanged
private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
{
var size = e.Size;
var stateName = size.Width <= 500 ? "NarrowState" : "WideState";
VisualStateManager.GoToState(this, stateName, true);
}
示例4: ExtendedSplash_OnResize
void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e) {
// Safely update the extended splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
if (this.SP != null) {
// Update the coordinates of the splash screen image.
this.splashImageRect = this.SP.ImageLocation;
this.PositionImage();
}
}
示例5: ExtendedSplash_OnResize
// Safely update the extended splash screen image coordinates. This function will be executed when a user resizes the window.
private void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e)
{
if (splash != null)
{
// Update the coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
PositionRing();
}
}
示例6: ExtendedSplash_OnResize
private void ExtendedSplash_OnResize(object sender, WindowSizeChangedEventArgs e)
{
// Safely update the extended _splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
if (_splash == null) return;
// Update the coordinates of the _splash screen image.
SplashImageRect = _splash.ImageLocation;
PositionImage();
PositionRing();
}
示例7: CurrentOnSizeChanged
private void CurrentOnSizeChanged(object sender, WindowSizeChangedEventArgs windowSizeChangedEventArgs)
{
if (windowSizeChangedEventArgs.Size.Width < 1050)
{
VisualStateManager.GoToState(this, Loc.Main.Topics.Any() ? "SnapTopicView" : "SnapTopicList", false);
}
else
{
VisualStateManager.GoToState(this, "FullTwoColumns", false);
}
}
示例8: CurrentWindowOnSizeChanged
private void CurrentWindowOnSizeChanged(object sender, WindowSizeChangedEventArgs windowSizeChangedEventArgs)
{
if (windowSizeChangedEventArgs.Size.Width <= 992)
{
isOpened = false;
}
else
{
isOpened = true;
}
}
示例9: SizeChanged
private async void SizeChanged(object sender, WindowSizeChangedEventArgs e)
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
if (UIViewSettings.GetForCurrentView().UserInteractionMode == Windows.UI.ViewManagement.UserInteractionMode.Mouse)
{
SetActive(this.IsInMouseMode);
}
else
{
SetActive(!this.IsInMouseMode);
}
});
}
示例10: Current_SizeChanged
public void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
{
var page = sender as Page;
if (page == null)
throw new Exception("sender is not a page");
var o = ApplicationView.GetForCurrentView().Orientation;
var stateName = o.Equals(ApplicationViewOrientation.Landscape)
? LandscapeStateName
: PortraitStateName;
VisualStateManager.GoToState(page, stateName, true);
}
示例11: WindowSizeChanged
public static void WindowSizeChanged(object sender, WindowSizeChangedEventArgs args)
{
ApplicationViewState viewState = ApplicationView.Value;
if (viewState == ApplicationViewState.Snapped)
{
Window.Current.Content = App.SnappedViewFrame;
}
else
{
if (Window.Current.Content != App.MainWindowFrame)
{
Window.Current.Content = App.MainWindowFrame;
}
}
Window.Current.Activate();
}
示例12: OnWindowSizeChanged
//Tailor the user experience of your app to be touch-first for tablet mode or mouse-first for Desktop usage.
private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
{
switch (UIViewSettings.GetForCurrentView().UserInteractionMode)
{
// desktop
case UserInteractionMode.Mouse:
VisualStateManager.GoToState(this, "MediumState", true);
break;
// tablet
case UserInteractionMode.Touch:
default:
VisualStateManager.GoToState(this, "WideState", true);
break;
}
}
示例13: HandleWindowResized
//----------------------------------------------------------------------
// PRIVATE EVENT HANDLERS
//----------------------------------------------------------------------
//----------------------------------------------------------------------
private void HandleWindowResized( object sender, WindowSizeChangedEventArgs e )
{
if( ApplicationView.GetForCurrentView().IsFullScreenMode && mMediaElement.IsFullScreen ||
!ApplicationView.GetForCurrentView().IsFullScreenMode && !mMediaElement.IsFullScreen )
{
// do nothing
}
else if( ApplicationView.GetForCurrentView().IsFullScreenMode && !mMediaElement.IsFullScreen )
{
mMediaElement.IsFullScreen = true;
}
else if( !ApplicationView.GetForCurrentView().IsFullScreenMode && mMediaElement.IsFullScreen )
{
mMediaElement.IsFullScreen = false;
}
}
示例14: _window_SizeChanged
//called when the window is resized
static void _window_SizeChanged(CoreWindow sender, WindowSizeChangedEventArgs args)
{
if (args.Size.Width == _windowsBounds.Width)
{
_windowState = WindowState.Full;
}
else if (args.Size.Width <= 320.00)
{
_windowState = WindowState.Snap1Quarter;
}
else
{
_windowState = WindowState.Snap3Quarter;
}
_windowsBounds.Height = args.Size.Height;
_windowsBounds.Width = args.Size.Width;
}
示例15: CurrentOnSizeChanged
private void CurrentOnSizeChanged(object sender, WindowSizeChangedEventArgs e)
{
var viewState = ApplicationView.Value;
NormalView.Dispose();
NormalView.SetupGame();
SnappedView.Dispose();
SnappedView.SetupGame();
if (viewState == ApplicationViewState.Snapped)
{
NormalView.Visibility = Visibility.Collapsed;
SnappedView.Visibility = Visibility.Visible;
}
else
{
NormalView.Visibility = Visibility.Visible;
SnappedView.Visibility = Visibility.Collapsed;
}
}