This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const string EllipsisString = "…"; | |
public static string Ellipsis(this string str, int maxChars, bool breakOnNewLine = false) { | |
if (maxChars < 1) { | |
throw new ArgumentOutOfRangeException(nameof(maxChars), "maxChars must be 1 or more."); | |
} | |
string changed = str; | |
if (breakOnNewLine) { | |
int newLine = changed.IndexOf('\n'); | |
if (newLine > -1) { | |
changed = changed.Substring(0, newLine) + EllipsisString; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Linq; | |
using System.Threading; | |
using ServiceStack; | |
using ServiceStack.OrmLite; | |
using ServiceStack.Text; | |
namespace ORMLiteSerializationTests | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<controls:XamlLineArt LineArt="{TemplateBinding LineArt}" HorizontalAlignment="Center" | |
MaxWidth="{TemplateBinding ImageMaxWidth}" MaxHeight="{TemplateBinding ImageMaxHeight}" | |
Margin="{TemplateBinding ImageMargin}" DockPanel.Dock="{TemplateBinding ImagePosition}"> | |
<controls:XamlLineArt.Triggers> | |
<DataTrigger Value="true" Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type controls:LineArtButton}}}"> | |
<!-- This seems to set Stroke on LineArtButton and not XamlLineArt... :( --> | |
<Setter Property="Stroke" Value="Blue" /> | |
</DataTrigger> | |
</controls:XamlLineArt.Triggers> | |
</controls:XamlLineArt> |