|
|
@@ -8,6 +8,7 @@ using Perspex.Controls.Primitives;
|
|
|
using Perspex.Controls.Templates;
|
|
|
using Perspex.Media;
|
|
|
using Perspex.Styling;
|
|
|
+using System.Reactive.Linq;
|
|
|
|
|
|
namespace Perspex.Themes.Default
|
|
|
{
|
|
|
@@ -58,19 +59,34 @@ namespace Perspex.Themes.Default
|
|
|
[~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty],
|
|
|
[~Border.BorderBrushProperty] = control[~TemplatedControl.BorderBrushProperty],
|
|
|
[~Border.BorderThicknessProperty] = control[~TemplatedControl.BorderThicknessProperty],
|
|
|
- Child = new ScrollViewer
|
|
|
+
|
|
|
+ Child = new Panel
|
|
|
{
|
|
|
- [~ScrollViewer.CanScrollHorizontallyProperty] = control[~ScrollViewer.CanScrollHorizontallyProperty],
|
|
|
- [~ScrollViewer.HorizontalScrollBarVisibilityProperty] = control[~ScrollViewer.HorizontalScrollBarVisibilityProperty],
|
|
|
- [~ScrollViewer.VerticalScrollBarVisibilityProperty] = control[~ScrollViewer.VerticalScrollBarVisibilityProperty],
|
|
|
- Content = new TextPresenter
|
|
|
+ Children = new Controls.Controls
|
|
|
{
|
|
|
- Name = "textPresenter",
|
|
|
- [~TextPresenter.CaretIndexProperty] = control[~TextBox.CaretIndexProperty],
|
|
|
- [~TextPresenter.SelectionStartProperty] = control[~TextBox.SelectionStartProperty],
|
|
|
- [~TextPresenter.SelectionEndProperty] = control[~TextBox.SelectionEndProperty],
|
|
|
- [~TextBlock.TextProperty] = control[~TextBox.TextProperty],
|
|
|
- [~TextBlock.TextWrappingProperty] = control[~TextBox.TextWrappingProperty],
|
|
|
+ new TextBlock
|
|
|
+ {
|
|
|
+ Name="waterMark",
|
|
|
+ Opacity=0.5,
|
|
|
+ [~TextBlock.TextProperty] = control[~TextBox.WatermarkProperty],
|
|
|
+ [~TextBlock.IsVisibleProperty] = control[~TextBox.TextProperty].Cast<string>().Select(x => (object)string.IsNullOrEmpty(x))
|
|
|
+ },
|
|
|
+
|
|
|
+ new ScrollViewer
|
|
|
+ {
|
|
|
+ [~ScrollViewer.CanScrollHorizontallyProperty] = control[~ScrollViewer.CanScrollHorizontallyProperty],
|
|
|
+ [~ScrollViewer.HorizontalScrollBarVisibilityProperty] = control[~ScrollViewer.HorizontalScrollBarVisibilityProperty],
|
|
|
+ [~ScrollViewer.VerticalScrollBarVisibilityProperty] = control[~ScrollViewer.VerticalScrollBarVisibilityProperty],
|
|
|
+ Content = new TextPresenter
|
|
|
+ {
|
|
|
+ Name = "textPresenter",
|
|
|
+ [~TextPresenter.CaretIndexProperty] = control[~TextBox.CaretIndexProperty],
|
|
|
+ [~TextPresenter.SelectionStartProperty] = control[~TextBox.SelectionStartProperty],
|
|
|
+ [~TextPresenter.SelectionEndProperty] = control[~TextBox.SelectionEndProperty],
|
|
|
+ [~TextBlock.TextProperty] = control[~TextBox.TextProperty],
|
|
|
+ [~TextBlock.TextWrappingProperty] = control[~TextBox.TextWrappingProperty],
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|