Browse Source

update samples

pull/21771/head
Emmanuel Hansen 3 weeks ago
parent
commit
2bf08f34ef
  1. 6
      samples/ControlCatalog/App.xaml.cs
  2. 5
      samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml
  3. 4
      samples/ControlCatalog/Pages/CarouselPage.xaml
  4. 9
      samples/ControlCatalog/Pages/NumericUpDownPage.xaml

6
samples/ControlCatalog/App.xaml.cs

@ -37,7 +37,7 @@ namespace ControlCatalog
_colorPickerFluent = (IStyle)Resources["ColorPickerFluent"]!; _colorPickerFluent = (IStyle)Resources["ColorPickerFluent"]!;
_colorPickerSimple = (IStyle)Resources["ColorPickerSimple"]!; _colorPickerSimple = (IStyle)Resources["ColorPickerSimple"]!;
SetCatalogThemes(CatalogTheme.Fluent2); SetCatalogThemes(CatalogTheme.Fluent2, skipWindowCreation: true);
} }
public override void OnFrameworkInitializationCompleted() public override void OnFrameworkInitializationCompleted()
@ -108,12 +108,12 @@ namespace ControlCatalog
private CatalogTheme _prevTheme; private CatalogTheme _prevTheme;
public static CatalogTheme CurrentTheme => ((App)Current!)._prevTheme; public static CatalogTheme CurrentTheme => ((App)Current!)._prevTheme;
public static void SetCatalogThemes(CatalogTheme theme) public static void SetCatalogThemes(CatalogTheme theme, bool skipWindowCreation = false)
{ {
var app = (App)Current!; var app = (App)Current!;
var prevTheme = app._prevTheme; var prevTheme = app._prevTheme;
app._prevTheme = theme; app._prevTheme = theme;
var shouldReopenWindow = prevTheme != theme; var shouldReopenWindow = prevTheme != theme && !skipWindowCreation;
if (app._themeStylesContainer.Count == 0) if (app._themeStylesContainer.Count == 0)
{ {

5
samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml

@ -15,6 +15,11 @@
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"> ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Everest"/> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Everest"/>
</ButtonSpinner> </ButtonSpinner>
<ButtonSpinner Spin="OnSpin" Height="30" Classes="fluent2-compact"
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Everest"/>
</ButtonSpinner>
<ButtonSpinner Spin="OnSpin" Height="30" ButtonSpinnerLocation="Left" <ButtonSpinner Spin="OnSpin" Height="30" ButtonSpinnerLocation="Left"
AllowSpin="{Binding #allowSpinCheck.IsChecked}" AllowSpin="{Binding #allowSpinCheck.IsChecked}"
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"> ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}">

4
samples/ControlCatalog/Pages/CarouselPage.xaml

@ -9,7 +9,7 @@
MaxWidth="760" MaxWidth="760"
HorizontalAlignment="Stretch" Margin="0 16 0 0"> HorizontalAlignment="Stretch" Margin="0 16 0 0">
<Button Name="left" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="10,20" Margin="4"> <Button Name="left" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="10,20" Margin="4">
<Path Name="leftArrow" Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" Fill="Black"/> <PathIcon Name="leftArrow" Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"/>
</Button> </Button>
<Carousel Name="carousel" Grid.Column="1" Grid.Row="1" Background="Transparent" Height="400" Focusable="True" ViewportFraction="1.0"> <Carousel Name="carousel" Grid.Column="1" Grid.Row="1" Background="Transparent" Height="400" Focusable="True" ViewportFraction="1.0">
<Carousel.PageTransition> <Carousel.PageTransition>
@ -44,7 +44,7 @@
</Border> </Border>
</Carousel> </Carousel>
<Button Name="right" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="10,20" Margin="4"> <Button Name="right" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="10,20" Margin="4">
<Path Name="rightArrow" Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" Fill="Black"/> <PathIcon Name="rightArrow" Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"/>
</Button> </Button>
</Grid> </Grid>

9
samples/ControlCatalog/Pages/NumericUpDownPage.xaml

@ -123,6 +123,15 @@
PlaceholderForeground="Orange"/> PlaceholderForeground="Orange"/>
</StackPanel> </StackPanel>
<StackPanel Margin="10">
<Label FontSize="14" FontWeight="Bold" Target="InnerContent"
Content="Clear Button"/>
<NumericUpDown
TextAlignment="Right"
Classes="clearButton"
x:Name="ClearButton"/>
</StackPanel>
<StackPanel Margin="10"> <StackPanel Margin="10">
<Label FontSize="14" FontWeight="Bold" Target="InnerContent" <Label FontSize="14" FontWeight="Bold" Target="InnerContent"
Content="Inner Contents"/> Content="Inner Contents"/>

Loading…
Cancel
Save