From dfa35dc5a25b5c3262b544f9d4117743e4934059 Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Mon, 31 Jan 2022 01:14:09 +0100 Subject: [PATCH] Add separator between code samples, update code copy button to be on title line (#854) --- XamlControlsGallery/Controls/ControlExample.xaml | 13 ++++++++++++- XamlControlsGallery/Controls/ControlExample.xaml.cs | 11 +++++++++-- .../Controls/SampleCodePresenter.xaml | 4 ++-- .../Controls/SampleCodePresenter.xaml.cs | 2 ++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/XamlControlsGallery/Controls/ControlExample.xaml b/XamlControlsGallery/Controls/ControlExample.xaml index 58088c3a5..b56f49518 100644 --- a/XamlControlsGallery/Controls/ControlExample.xaml +++ b/XamlControlsGallery/Controls/ControlExample.xaml @@ -60,6 +60,15 @@ + + + + + + + + + @@ -154,12 +163,14 @@ - + + (); ControlPresenter.RegisterPropertyChangedCallback(ContentPresenter.PaddingProperty, ControlPaddingChangedCallback); + this.Loaded += ControlExample_Loaded; + } + + private void ControlExample_Loaded(object sender, RoutedEventArgs e) + { + if(!XamlPresenter.IsEmpty && !CSharpPresenter.IsEmpty) + { + VisualStateManager.GoToState(this, "SeparatorVisible", false); + } } private void rootGrid_Loaded(object sender, RoutedEventArgs e) diff --git a/XamlControlsGallery/Controls/SampleCodePresenter.xaml b/XamlControlsGallery/Controls/SampleCodePresenter.xaml index 1169ef332..e80ec973d 100644 --- a/XamlControlsGallery/Controls/SampleCodePresenter.xaml +++ b/XamlControlsGallery/Controls/SampleCodePresenter.xaml @@ -41,14 +41,14 @@ -