Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /kunden/247608_14469/webseiten/wp-content/themes/wordblab/functions.php on line 28
Warning: Use of undefined constant text - assumed 'text' (this will throw an Error in a future version of PHP) in /kunden/247608_14469/webseiten/wp-content/themes/wordblab/functions.php on line 29
Warning: Use of undefined constant text - assumed 'text' (this will throw an Error in a future version of PHP) in /kunden/247608_14469/webseiten/wp-content/themes/wordblab/functions.php on line 9
Im Beitrag „Snap View mit XAML in Windows Store App definieren“ habe ich gezeigt, wie man mit dem VisualStateManager
auf verschiedene Visual Statues in XAML reagieren kann. Das gleiche Verhalten kann man natürlich auch mit reinem C#-Code erzeugen. Hier ein einfaches Beispiel, welches ein XAML-Element im Snapped-View ausblendet und andernfalls wieder anzeigt:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | public MainPage() { this.InitializeComponent(); Window.Current.SizeChanged += onSizeChanged; } private void onSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) { ApplicationViewState viewState = Windows.UI.ViewManagement.ApplicationView.Value; if (viewState == ApplicationViewState.Snapped) { MyElement.Visibility = Visibility.Collapsed; } else { MyElement.Visibility = Visibility.Visible; } } |
Für Windows Store-Apps gibt es folgende View States: FullScreenLandscape, FullScreenPortrait, Filled und Snapped.
Letzte Kommentare