ScrollChangedEventArgs.ViewportWidthChange Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft einen Wert ab, der die Änderung der Breite des Anzeigebereichs eines ScrollViewer angibt.
public:
property double ViewportWidthChange { double get(); };
public double ViewportWidthChange { get; }
member this.ViewportWidthChange : double
Public ReadOnly Property ViewportWidthChange As Double
Eigenschaftswert
Ein Double-Wert, der die Änderung der Breite des Anzeigebereichs für einen ScrollViewer darstellt.
Beispiele
Das folgende Beispiel zeigt, wie Sie den Wert der ViewportWidthChange -Eigenschaft abrufen.
private void sChanged(object sender, ScrollChangedEventArgs e)
{
if (svrContent.CanContentScroll == true)
{
tBlock1.Foreground = System.Windows.Media.Brushes.Red;
tBlock1.Text = "ScrollChangedEvent just Occurred";
tBlock2.Text = "ExtentHeight is now " + e.ExtentHeight.ToString();
tBlock3.Text = "ExtentWidth is now " + e.ExtentWidth.ToString();
tBlock4.Text = "ExtentHeightChange was " + e.ExtentHeightChange.ToString();
tBlock5.Text = "ExtentWidthChange was " + e.ExtentWidthChange.ToString();
tBlock6.Text = "HorizontalOffset is now " + e.HorizontalOffset.ToString();
tBlock7.Text = "VerticalOffset is now " + e.VerticalOffset.ToString();
tBlock8.Text = "HorizontalChange was " + e.HorizontalChange.ToString();
tBlock9.Text = "VerticalChange was " + e.VerticalChange.ToString();
tBlock10.Text = "ViewportHeight is now " + e.ViewportHeight.ToString();
tBlock11.Text = "ViewportWidth is now " + e.ViewportWidth.ToString();
tBlock12.Text = "ViewportHeightChange was " + e.ViewportHeightChange.ToString();
tBlock13.Text = "ViewportWidthChange was " + e.ViewportWidthChange.ToString();
}
else
{
tBlock1.Text = "";
}
Private Sub sChanged(ByVal sender As Object, ByVal args As ScrollChangedEventArgs)
If (sv1.CanContentScroll = True) Then
tBlock1.Foreground = System.Windows.Media.Brushes.Red
tBlock1.Text = "ScrollChangedEvent just Occurred"
tBlock3.Text = "ExtentWidth is now " + args.ExtentWidth.ToString()
tBlock4.Text = "ExtentHeightChange was " + args.ExtentHeightChange.ToString()
tBlock5.Text = "ExtentWidthChange was " + args.ExtentWidthChange.ToString()
tBlock6.Text = "HorizontalOffset is now " + args.HorizontalOffset.ToString()
tBlock7.Text = "VerticalOffset is now " + args.VerticalOffset.ToString()
tBlock8.Text = "HorizontalChange was " + args.HorizontalChange.ToString()
tBlock9.Text = "VerticalChange was " + args.VerticalChange.ToString()
tBlock10.Text = "ViewportHeight is now " + args.ViewportHeight.ToString()
tBlock11.Text = "ViewportWidth is now " + args.ViewportWidth.ToString()
tBlock12.Text = "ViewportHeightChange was " + args.ViewportHeightChange.ToString()
tBlock13.Text = "ViewportWidthChange was " + args.ViewportWidthChange.ToString()
Else
tBlock1.Text = ""
End If
Gilt für:
Zusammenarbeit auf GitHub
Die Quelle für diesen Inhalt finden Sie auf GitHub, wo Sie auch Issues und Pull Requests erstellen und überprüfen können. Weitere Informationen finden Sie in unserem Leitfaden für Mitwirkende.