From 649a0260ea951a8126cfe4986c1480a9c7b65000 Mon Sep 17 00:00:00 2001 From: Yoojun Zhou Date: Mon, 4 Nov 2024 16:00:18 +0800 Subject: [PATCH] Example code for HyperlinkButton --- .../ControlPages/HyperlinkButtonPage.xaml | 22 +++++----------- .../ControlPages/HyperlinkButtonPage.xaml.cs | 25 +++++++++++++++++-- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml index ae64f48e..4e132fe8 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml @@ -14,36 +14,26 @@ - + NavigateUri="http://www.inkore.net" /> - + - - - <ui:HyperlinkButton Content="Microsoft home page" NavigateUri="http://www.microsoft.com" $(IsEnabled)/> - - - + - - - <ui:HyperlinkButton Content="ToggleButton" Click="HyperlinkButton_Click"/> - - diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml.cs index 48550791..e48d521e 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/HyperlinkButtonPage.xaml.cs @@ -33,16 +33,37 @@ private void Page_Loaded(object sender, RoutedEventArgs e) }); ObservableCollection Substitutions = new ObservableCollection() { Substitution }; Example1.Substitutions = Substitutions; + + UpdateExampleCode(); + } + + private void DisableControl1_Click(object sender, RoutedEventArgs e) + { + UpdateExampleCode(); } #region Example Code public void UpdateExampleCode() { - + Example1.Xaml = Example1Xaml; + Example2.Xaml = Example2Xaml; } - #endregion + public string Example1Xaml => $@" + +"; + public string Example2Xaml => $@" + +"; + + #endregion } }