Skip to content

Commit e94f7ec

Browse files
authored
Merge pull request #155 from reactivemarbles/CP_UpdateCard
Update Card to allow wrapping
2 parents e7d384b + ceb4134 commit e94f7ec

File tree

8 files changed

+87
-14
lines changed

8 files changed

+87
-14
lines changed

Version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "2.1.3",
3+
"version": "2.2",
44
"publicReleaseRefSpec": [
55
"^refs/heads/master$",
66
"^refs/heads/main$"

src/CrissCross.WPF.UI.Gallery/MainWindow.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
x:TypeArguments="local:MainWindowViewModel"
1515
mc:Ignorable="d">
1616
<ui:FluentNavigationWindow.LeftContent>
17-
<StackPanel>
17+
<ui:StackPanel>
1818
<ui:TextBox Margin="3,0,0,0" Text="{Binding Filter, ElementName=NavigationLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
1919
<ui:TextBox.Icon>
2020
<ui:SymbolIcon Symbol="Search20" />
2121
</ui:TextBox.Icon>
2222
</ui:TextBox>
2323
<ui:NavigationVMLeft x:Name="NavigationLeft" />
24-
</StackPanel>
24+
</ui:StackPanel>
2525
</ui:FluentNavigationWindow.LeftContent>
26-
<Grid />
2726
</ui:FluentNavigationWindow>

src/CrissCross.WPF.UI.Gallery/Views/MainView.xaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,46 @@
1313
Margin="0,0,0,20"
1414
CanContentScroll="True"
1515
VerticalScrollBarVisibility="Auto">
16-
<StackPanel>
16+
<Grid>
17+
<Grid.RowDefinitions>
18+
<RowDefinition Height="Auto" />
19+
<RowDefinition Height="Auto" />
20+
<RowDefinition Height="Auto" />
21+
<RowDefinition Height="Auto" />
22+
<RowDefinition Height="Auto" />
23+
<RowDefinition Height="Auto" />
24+
<RowDefinition Height="Auto" />
25+
<RowDefinition Height="Auto" />
26+
<RowDefinition />
27+
<RowDefinition />
28+
<RowDefinition />
29+
</Grid.RowDefinitions>
1730
<ui:TextBlock
1831
FontSize="20"
1932
FontWeight="Medium"
2033
Text="Welcome to CrissCross" />
2134
<ui:TextBlock
35+
Grid.Row="1"
2236
FontSize="16"
2337
FontWeight="Normal"
2438
Text="Step 1: Add the CrissCross.UI namespace to your XAML file." />
2539
<ui:TextBlock
40+
Grid.Row="2"
2641
FontSize="16"
2742
FontWeight="Normal"
2843
Text="xmlns:ui='https://github.com/reactivemarbles/CrissCross.ui'" />
2944
<ui:TextBlock
45+
Grid.Row="3"
3046
FontSize="16"
3147
FontWeight="Normal"
3248
Text="Step 2: Use CrissCross UI components in your XAML." />
3349
<ui:TextBlock
50+
Grid.Row="4"
3451
FontSize="16"
3552
FontWeight="Normal"
3653
Text="Example:" />
3754
<Border
55+
Grid.Row="5"
3856
Padding="10"
3957
BorderBrush="Black"
4058
BorderThickness="1">
@@ -44,29 +62,34 @@
4462
Text="&lt;ui:TextBlock FontSize='20' FontWeight='Medium' Text='Welcome to CrissCross' /&gt;" />
4563
</Border>
4664
<ui:TextBlock
65+
Grid.Row="6"
4766
FontSize="16"
4867
FontWeight="Normal"
4968
Text="Step 3: Build and run your application to see the CrissCross UI components in action." />
5069
<ui:TextBlock
70+
Grid.Row="7"
5171
Margin="0,10"
5272
FontSize="20"
5373
FontWeight="Medium"
5474
Text="Project Setup - use the following as a guide for setting up your initial application" />
5575
<ui:TextBlock
5676
x:Name="AppXamlSetup"
77+
Grid.Row="8"
5778
Margin="0,10"
5879
FontSize="12"
5980
FontWeight="Normal" />
6081
<ui:TextBlock
6182
x:Name="MainWindowXamlSetup"
83+
Grid.Row="9"
6284
Margin="0,10"
6385
FontSize="12"
6486
FontWeight="Normal" />
6587
<ui:TextBlock
6688
x:Name="MainWindowXamlCsSetup"
89+
Grid.Row="10"
6790
Margin="0,10"
6891
FontSize="12"
6992
FontWeight="Normal" />
70-
</StackPanel>
93+
</Grid>
7194
</ui:DynamicScrollViewer>
7295
</UserControl>

src/CrissCross.WPF.UI/Controls/Card/Card.xaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@
4444
<ContentPresenter
4545
x:Name="ContentPresenter"
4646
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
47-
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
47+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
48+
<ContentPresenter.Resources>
49+
<Style TargetType="{x:Type TextBlock}">
50+
<Setter Property="TextWrapping" Value="Wrap" />
51+
<Setter Property="TextAlignment" Value="Center" />
52+
</Style>
53+
</ContentPresenter.Resources>
54+
</ContentPresenter>
4855
</Border>
4956

5057
<Border
@@ -56,7 +63,14 @@
5663
BorderThickness="1"
5764
CornerRadius="0,0,4,4"
5865
Visibility="Collapsed">
59-
<ContentPresenter x:Name="FooterContentPresenter" Content="{TemplateBinding Footer}" />
66+
<ContentPresenter x:Name="FooterContentPresenter" Content="{TemplateBinding Footer}">
67+
<ContentPresenter.Resources>
68+
<Style TargetType="{x:Type TextBlock}">
69+
<Setter Property="TextWrapping" Value="Wrap" />
70+
<Setter Property="TextAlignment" Value="Center" />
71+
</Style>
72+
</ContentPresenter.Resources>
73+
</ContentPresenter>
6074
</Border>
6175
</Grid>
6276

src/CrissCross.WPF.UI/Controls/CardAction/CardAction.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@
6868
Grid.Column="1"
6969
VerticalAlignment="Center"
7070
Content="{TemplateBinding Content}"
71-
TextElement.Foreground="{TemplateBinding Foreground}" />
71+
TextElement.Foreground="{TemplateBinding Foreground}">
72+
<ContentPresenter.Resources>
73+
<Style TargetType="{x:Type TextBlock}">
74+
<Setter Property="TextWrapping" Value="Wrap" />
75+
<Setter Property="TextAlignment" Value="Center" />
76+
</Style>
77+
</ContentPresenter.Resources>
78+
</ContentPresenter>
7279

7380
<controls:SymbolIcon
7481
x:Name="ChevronIcon"

src/CrissCross.WPF.UI/Controls/CardColor/CardColor.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
Margin="0"
4545
FontSize="{TemplateBinding SubtitleFontSize}"
4646
Foreground="{DynamicResource CardForegroundPressed}"
47-
Text="{TemplateBinding Subtitle}" />
47+
Text="{TemplateBinding Subtitle}"
48+
TextAlignment="Center"
49+
TextWrapping="Wrap" />
4850
</StackPanel>
4951
</Border>
5052
</ControlTemplate>

src/CrissCross.WPF.UI/Controls/CardControl/CardControl.xaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,28 @@
6565
Grid.Column="1"
6666
VerticalAlignment="Center"
6767
Content="{TemplateBinding Header}"
68-
TextElement.Foreground="{TemplateBinding Foreground}" />
68+
TextElement.Foreground="{TemplateBinding Foreground}">
69+
<ContentPresenter.Resources>
70+
<Style TargetType="{x:Type TextBlock}">
71+
<Setter Property="TextWrapping" Value="Wrap" />
72+
<Setter Property="TextAlignment" Value="Center" />
73+
</Style>
74+
</ContentPresenter.Resources>
75+
</ContentPresenter>
6976
<ContentPresenter
7077
x:Name="ContentPresenter"
7178
Grid.Column="2"
7279
Margin="{StaticResource CardControlContentMargin}"
7380
VerticalAlignment="Center"
7481
Content="{TemplateBinding Content}"
75-
TextElement.Foreground="{TemplateBinding Foreground}" />
82+
TextElement.Foreground="{TemplateBinding Foreground}">
83+
<ContentPresenter.Resources>
84+
<Style TargetType="{x:Type TextBlock}">
85+
<Setter Property="TextWrapping" Value="Wrap" />
86+
<Setter Property="TextAlignment" Value="Center" />
87+
</Style>
88+
</ContentPresenter.Resources>
89+
</ContentPresenter>
7690
</Grid>
7791
</Border>
7892
<ControlTemplate.Triggers>

src/CrissCross.WPF.UI/Controls/CardExpander/CardExpander.xaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
Grid.Column="0"
2525
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
2626
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
27-
Content="{TemplateBinding Content}" />
27+
Content="{TemplateBinding Content}">
28+
<ContentPresenter.Resources>
29+
<Style TargetType="{x:Type TextBlock}">
30+
<Setter Property="TextWrapping" Value="Wrap" />
31+
<Setter Property="TextAlignment" Value="Center" />
32+
</Style>
33+
</ContentPresenter.Resources>
34+
</ContentPresenter>
2835
<Grid
2936
x:Name="ChevronGrid"
3037
Grid.Column="1"
@@ -147,7 +154,14 @@
147154
x:Name="HeaderContentPresenter"
148155
Grid.Column="1"
149156
Content="{TemplateBinding Header}"
150-
TextElement.Foreground="{TemplateBinding Foreground}" />
157+
TextElement.Foreground="{TemplateBinding Foreground}">
158+
<ContentPresenter.Resources>
159+
<Style TargetType="{x:Type TextBlock}">
160+
<Setter Property="TextWrapping" Value="Wrap" />
161+
<Setter Property="TextAlignment" Value="Center" />
162+
</Style>
163+
</ContentPresenter.Resources>
164+
</ContentPresenter>
151165
</Grid>
152166
</ToggleButton.Content>
153167
</ToggleButton>

0 commit comments

Comments
 (0)