Skip to content

Commit

Permalink
Update Card to allow wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Nov 18, 2024
1 parent e7d384b commit ceb4134
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.1.3",
"version": "2.2",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/main$"
Expand Down
5 changes: 2 additions & 3 deletions src/CrissCross.WPF.UI.Gallery/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
x:TypeArguments="local:MainWindowViewModel"
mc:Ignorable="d">
<ui:FluentNavigationWindow.LeftContent>
<StackPanel>
<ui:StackPanel>
<ui:TextBox Margin="3,0,0,0" Text="{Binding Filter, ElementName=NavigationLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<ui:TextBox.Icon>
<ui:SymbolIcon Symbol="Search20" />
</ui:TextBox.Icon>
</ui:TextBox>
<ui:NavigationVMLeft x:Name="NavigationLeft" />
</StackPanel>
</ui:StackPanel>
</ui:FluentNavigationWindow.LeftContent>
<Grid />
</ui:FluentNavigationWindow>
27 changes: 25 additions & 2 deletions src/CrissCross.WPF.UI.Gallery/Views/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,46 @@
Margin="0,0,0,20"
CanContentScroll="True"
VerticalScrollBarVisibility="Auto">
<StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ui:TextBlock
FontSize="20"
FontWeight="Medium"
Text="Welcome to CrissCross" />
<ui:TextBlock
Grid.Row="1"
FontSize="16"
FontWeight="Normal"
Text="Step 1: Add the CrissCross.UI namespace to your XAML file." />
<ui:TextBlock
Grid.Row="2"
FontSize="16"
FontWeight="Normal"
Text="xmlns:ui='https://github.com/reactivemarbles/CrissCross.ui'" />
<ui:TextBlock
Grid.Row="3"
FontSize="16"
FontWeight="Normal"
Text="Step 2: Use CrissCross UI components in your XAML." />
<ui:TextBlock
Grid.Row="4"
FontSize="16"
FontWeight="Normal"
Text="Example:" />
<Border
Grid.Row="5"
Padding="10"
BorderBrush="Black"
BorderThickness="1">
Expand All @@ -44,29 +62,34 @@
Text="&lt;ui:TextBlock FontSize='20' FontWeight='Medium' Text='Welcome to CrissCross' /&gt;" />
</Border>
<ui:TextBlock
Grid.Row="6"
FontSize="16"
FontWeight="Normal"
Text="Step 3: Build and run your application to see the CrissCross UI components in action." />
<ui:TextBlock
Grid.Row="7"
Margin="0,10"
FontSize="20"
FontWeight="Medium"
Text="Project Setup - use the following as a guide for setting up your initial application" />
<ui:TextBlock
x:Name="AppXamlSetup"
Grid.Row="8"
Margin="0,10"
FontSize="12"
FontWeight="Normal" />
<ui:TextBlock
x:Name="MainWindowXamlSetup"
Grid.Row="9"
Margin="0,10"
FontSize="12"
FontWeight="Normal" />
<ui:TextBlock
x:Name="MainWindowXamlCsSetup"
Grid.Row="10"
Margin="0,10"
FontSize="12"
FontWeight="Normal" />
</StackPanel>
</Grid>
</ui:DynamicScrollViewer>
</UserControl>
18 changes: 16 additions & 2 deletions src/CrissCross.WPF.UI/Controls/Card/Card.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@
<ContentPresenter
x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Border>

<Border
Expand All @@ -56,7 +63,14 @@
BorderThickness="1"
CornerRadius="0,0,4,4"
Visibility="Collapsed">
<ContentPresenter x:Name="FooterContentPresenter" Content="{TemplateBinding Footer}" />
<ContentPresenter x:Name="FooterContentPresenter" Content="{TemplateBinding Footer}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Border>
</Grid>

Expand Down
9 changes: 8 additions & 1 deletion src/CrissCross.WPF.UI/Controls/CardAction/CardAction.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@
Grid.Column="1"
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
TextElement.Foreground="{TemplateBinding Foreground}" />
TextElement.Foreground="{TemplateBinding Foreground}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>

<controls:SymbolIcon
x:Name="ChevronIcon"
Expand Down
4 changes: 3 additions & 1 deletion src/CrissCross.WPF.UI/Controls/CardColor/CardColor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
Margin="0"
FontSize="{TemplateBinding SubtitleFontSize}"
Foreground="{DynamicResource CardForegroundPressed}"
Text="{TemplateBinding Subtitle}" />
Text="{TemplateBinding Subtitle}"
TextAlignment="Center"
TextWrapping="Wrap" />
</StackPanel>
</Border>
</ControlTemplate>
Expand Down
18 changes: 16 additions & 2 deletions src/CrissCross.WPF.UI/Controls/CardControl/CardControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,28 @@
Grid.Column="1"
VerticalAlignment="Center"
Content="{TemplateBinding Header}"
TextElement.Foreground="{TemplateBinding Foreground}" />
TextElement.Foreground="{TemplateBinding Foreground}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
<ContentPresenter
x:Name="ContentPresenter"
Grid.Column="2"
Margin="{StaticResource CardControlContentMargin}"
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
TextElement.Foreground="{TemplateBinding Foreground}" />
TextElement.Foreground="{TemplateBinding Foreground}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Grid>
</Border>
<ControlTemplate.Triggers>
Expand Down
18 changes: 16 additions & 2 deletions src/CrissCross.WPF.UI/Controls/CardExpander/CardExpander.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@
Grid.Column="0"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}" />
Content="{TemplateBinding Content}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
<Grid
x:Name="ChevronGrid"
Grid.Column="1"
Expand Down Expand Up @@ -147,7 +154,14 @@
x:Name="HeaderContentPresenter"
Grid.Column="1"
Content="{TemplateBinding Header}"
TextElement.Foreground="{TemplateBinding Foreground}" />
TextElement.Foreground="{TemplateBinding Foreground}">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Grid>
</ToggleButton.Content>
</ToggleButton>
Expand Down

0 comments on commit ceb4134

Please sign in to comment.