mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-04-19 23:03:49 +02:00
small changes
This commit is contained in:
parent
b1e70f09b1
commit
45370afa95
@ -7,6 +7,7 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Controls
|
namespace Controls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -85,8 +86,10 @@ namespace Controls
|
|||||||
run.FontSize = 12;
|
run.FontSize = 12;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
block.Inlines.Add(run);
|
block.Inlines.Add(run);
|
||||||
}
|
}
|
||||||
|
|
||||||
block.HorizontalAlignment = HorizontalAlignment.Right;
|
block.HorizontalAlignment = HorizontalAlignment.Right;
|
||||||
block.VerticalAlignment = VerticalAlignment.Center;
|
block.VerticalAlignment = VerticalAlignment.Center;
|
||||||
return block;
|
return block;
|
||||||
@ -109,7 +112,10 @@ namespace Controls
|
|||||||
textComponents.Add(comp);
|
textComponents.Add(comp);
|
||||||
snippet.Clear();
|
snippet.Clear();
|
||||||
}
|
}
|
||||||
alignment = alignment == BaselineAlignment.Subscript ? BaselineAlignment.Baseline : BaselineAlignment.Subscript;
|
|
||||||
|
alignment = alignment == BaselineAlignment.Subscript
|
||||||
|
? BaselineAlignment.Baseline
|
||||||
|
: BaselineAlignment.Subscript;
|
||||||
break;
|
break;
|
||||||
case '^':
|
case '^':
|
||||||
if (snippet.Length > 0)
|
if (snippet.Length > 0)
|
||||||
@ -118,13 +124,17 @@ namespace Controls
|
|||||||
textComponents.Add(comp);
|
textComponents.Add(comp);
|
||||||
snippet.Clear();
|
snippet.Clear();
|
||||||
}
|
}
|
||||||
alignment = alignment == BaselineAlignment.Superscript ? BaselineAlignment.Baseline : BaselineAlignment.Superscript;
|
|
||||||
|
alignment = alignment == BaselineAlignment.Superscript
|
||||||
|
? BaselineAlignment.Baseline
|
||||||
|
: BaselineAlignment.Superscript;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
snippet.Append(c);
|
snippet.Append(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (snippet.Length > 0)
|
if (snippet.Length > 0)
|
||||||
{
|
{
|
||||||
var comp = new TextComponent(snippet.ToString(), alignment);
|
var comp = new TextComponent(snippet.ToString(), alignment);
|
||||||
|
@ -89,10 +89,11 @@
|
|||||||
<controls:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" />
|
<controls:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" />
|
||||||
<DataTemplate x:Key="EnumComboBoxDataTemplate">
|
<DataTemplate x:Key="EnumComboBoxDataTemplate">
|
||||||
<ComboBox
|
<ComboBox
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
DisplayMemberPath="Key"
|
DisplayMemberPath="Key"
|
||||||
ItemsSource="{Binding Value, ElementName=LayoutRoot, Converter={StaticResource EnumToKeyValuePairConverter}}"
|
ItemsSource="{Binding Value, ElementName=LayoutRoot, Converter={StaticResource EnumToKeyValuePairConverter}}"
|
||||||
SelectedValue="{Binding Value, ElementName=LayoutRoot}"
|
SelectedValue="{Binding Value, ElementName=LayoutRoot}"
|
||||||
SelectedValuePath="Value" HorizontalAlignment="Stretch"
|
SelectedValuePath="Value"
|
||||||
Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}"
|
Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}"
|
||||||
Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}">
|
Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}">
|
||||||
<ComboBox.Style>
|
<ComboBox.Style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user