From de30b704d0a4122ef20ec13929d19bd78b346388 Mon Sep 17 00:00:00 2001 From: Yoojun Zhou Date: Wed, 6 Nov 2024 00:03:54 +0800 Subject: [PATCH] Example code for Image --- .../ControlPages/ImagePage.xaml | 18 ------------ .../ControlPages/ImagePage.xaml.cs | 28 ++++++++++++++++++- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml index 1889086b..5dd9db22 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml @@ -13,17 +13,10 @@ mc:Ignorable="d"> - - - - - <Image Source="/Assets/SampleMedia/treetops.jpg" Height="100" /> - - @@ -33,17 +26,6 @@ - - - -<Image Height="100"> - <Image.Source> - <BitmapImage UriSource="/Assets/SampleMedia/treetops.jpg" - DecodePixelHeight="100" /> - </Image.Source> -</Image> - - diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml.cs index 14c56abb..aa0c84e1 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/ImagePage.xaml.cs @@ -35,6 +35,8 @@ private void ImageStretch_Checked(object sender, RoutedEventArgs e) var strStretch = (sender as RadioButton).Content.ToString(); var stretch = (Stretch)Enum.Parse(typeof(Stretch), strStretch); StretchImage.Stretch = stretch; + + UpdateExampleCode(); } } @@ -51,15 +53,39 @@ private void Page_Loaded(object sender, RoutedEventArgs e) }); ObservableCollection Substitutions = new ObservableCollection() { Substitution }; Example3.Substitutions = Substitutions; + + UpdateExampleCode(); } #region Example Code public void UpdateExampleCode() { - + Example1.Xaml = Example1Xaml; + Example2.Xaml = Example2Xaml; + Example3.Xaml = Example3Xaml; } + public string Example1Xaml => $@" + +"; + + public string Example2Xaml => $@" + + + + + +"; + + public string Example3Xaml => $@" + +"; + #endregion }