Skip to content

Commit

Permalink
Example code for ScrollViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Dec 22, 2024
1 parent fb92db2 commit ec1a9f1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="ScrollViewer Page"
d:DesignWidth="800"
mc:Ignorable="d">
mc:Ignorable="d" Loaded="Page_Loaded">
<StackPanel>
<local:ControlExample x:Name="Example1" HeaderText="Content inside of a ScrollViewer.">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public ScrollViewerPage()
InitializeComponent();
}

private void Page_Loaded(object sender, RoutedEventArgs e)
{
UpdateExampleCode();
}


private void hsbvCombo_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
if (Control1 != null)
Expand All @@ -53,6 +59,8 @@ private void hsbvCombo_SelectionChanged_1(object sender, SelectionChangedEventAr
}
}
}

UpdateExampleCode();
}

private void vsbvCombo_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
Expand Down Expand Up @@ -81,6 +89,8 @@ private void vsbvCombo_SelectionChanged_1(object sender, SelectionChangedEventAr
}
}
}

UpdateExampleCode();
}

private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
Expand All @@ -100,10 +110,23 @@ private void Page_SizeChanged(object sender, SizeChangedEventArgs e)

public void UpdateExampleCode()
{
if (!this.IsLoaded) return;

Example1.Xaml = Example1Xaml;
}

#endregion
public string Example1Xaml => $@"
<ui:ScrollViewerEx x:Name=""Control1""
HorizontalScrollBarVisibility=""{Control1.HorizontalScrollBarVisibility}""
VerticalScrollBarVisibility=""{Control1.VerticalScrollBarVisibility}"">
<Image HorizontalAlignment=""Left""
VerticalAlignment=""Top""
AutomationProperties.Name=""cliff""
Source=""/Assets/SampleMedia/cliff.jpg""
Stretch=""None"" />
</ui:ScrollViewerEx>
";

#endregion
}
}

0 comments on commit ec1a9f1

Please sign in to comment.