Skip to content

Commit

Permalink
Merge pull request #152 from reactivemarbles/CP_AddTextWrappingForButton
Browse files Browse the repository at this point in the history
Add Text Wrapping for Button
  • Loading branch information
ChrisPulman authored Nov 5, 2024
2 parents d35d579 + 01bfcd6 commit 88c4e1d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 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.1",
"version": "2.1.2",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/main$"
Expand Down
6 changes: 3 additions & 3 deletions src/CrissCross.WPF.Plot/CrissCross.WPF.Plot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<PackageReference Include="ScottPlot.WPF" Version="5.0.43" />
</ItemGroup>

<!--<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<PackageReference Include="Polyfill" Version="7.0.0">
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<PackageReference Include="Polyfill" Version="7.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>-->
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CrissCross.WPF\CrissCross.WPF.csproj" />
Expand Down
3 changes: 2 additions & 1 deletion src/CrissCross.WPF.UI.Test/Views/Pages/DashboardPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
</ui:Grid.RowDefinitions>
<ui:Button
Grid.Column="0"
Width="118"
Command="{Binding ViewModel.CounterIncrementCommand, Mode=OneWay}"
Content="Click me!"
Content="Click me! Because I am very long"
Icon="{ui:SymbolIcon Fluent24}" />
<ui:TextBlock
Grid.Column="1"
Expand Down
18 changes: 16 additions & 2 deletions src/CrissCross.WPF.UI/Controls/Button/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
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>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
Expand Down Expand Up @@ -136,7 +143,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>
</Grid>
</Border>
</Border>
Expand Down
2 changes: 1 addition & 1 deletion src/CrissCross.WPF.UI/CrissCross.WPF.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PackageReference Include="CP.Extensions.Hosting.ReactiveUI.Wpf" Version="2.0.5" />
<PackageReference Include="ReactiveList" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" />
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" PrivateAssets="all" />
<PackageReference Include="AppBarButton.WPF" Version="1.0.2" />
<PackageReference Include="BBCode.WPF" Version="0.2.0" />
<PackageReference Include="CP.Xaml.Converters" Version="1.0.2" />
Expand Down

0 comments on commit 88c4e1d

Please sign in to comment.