From fb92db2de61197d6c7aa91fc3dff8de414d496e5 Mon Sep 17 00:00:00 2001 From: Yoojun Zhou Date: Sun, 22 Dec 2024 12:00:07 +0800 Subject: [PATCH] Example code for RichEditBox --- .../ControlPages/RichEditBoxPage.xaml | 41 +++++++------- .../ControlPages/RichEditBoxPage.xaml.cs | 54 +++++++++++++++++-- 2 files changed, 73 insertions(+), 22 deletions(-) diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml index d9e7fdee..77a3ff2a 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml @@ -5,56 +5,59 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" - xmlns:sc="clr-namespace:SamplesCommon;assembly=SamplesCommon" + xmlns:local="clr-namespace:iNKORE.UI.WPF.Modern.Gallery" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" - mc:Ignorable="d"> + mc:Ignorable="d" Loaded="Page_Loaded"> - + - + - + - + - - - - - - - - + + + + + + + + + SelectedItem="{Binding ElementName=textBox, Path=HorizontalScrollBarVisibility}" + SelectionChanged="ComboBox_SelectionChanged"/> + SelectedItem="{Binding ElementName=textBox, Path=VerticalScrollBarVisibility}" + SelectionChanged="ComboBox_SelectionChanged"/> + SelectedItem="{Binding ElementName=textBox, Path=SelectionOpacity}" + SelectionChanged="ComboBox_SelectionChanged"> 0 0.4 1 - - + + diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml.cs index 3645bcf1..10a8f00e 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml.cs @@ -1,22 +1,70 @@ -using System.Windows.Controls; +using System.Windows; +using System.Windows.Controls; +using iNKORE.UI.WPF.Modern.Controls.Helpers; +using iNKORE.UI.WPF.Modern.Controls; +using Page = iNKORE.UI.WPF.Modern.Controls.Page; + namespace iNKORE.UI.WPF.Modern.Gallery.ControlPages { - public partial class RichEditBoxPage + public partial class RichEditBoxPage : Page { public RichEditBoxPage() { InitializeComponent(); } + private void Page_Loaded(object sender, RoutedEventArgs e) + { + UpdateExampleCode(); + } + + private void CheckBox_Click(object sender, RoutedEventArgs e) + { + UpdateExampleCode(); + } + + private void TextBox_TextChanged(object sender, TextChangedEventArgs e) + { + UpdateExampleCode(); + } + + private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + UpdateExampleCode(); + } + + #region Example Code public void UpdateExampleCode() { + if (!this.IsLoaded) return; + Example1.Xaml = Example1Xaml; + Example2.Xaml = Example2Xaml; } - #endregion + public string Example1Xaml => $@" + +"; + + public string Example2Xaml => $@" + +"; + + #endregion } }