-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
References: #382
- Loading branch information
Showing
7 changed files
with
103 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
45 changes: 45 additions & 0 deletions
45
source/Eppie.App/Eppie.App.UI/Eppie.App.UI.Shared/Controls/MessageControl.xaml.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#if WINDOWS_UWP | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
#else | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
#endif | ||
|
||
namespace Eppie.App.UI.Controls | ||
{ | ||
public sealed partial class MessageControl : UserControl | ||
{ | ||
public bool HasHtmlBody | ||
{ | ||
get { return (bool)GetValue(HasHtmlBodyProperty); } | ||
set { SetValue(HasHtmlBodyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty HasHtmlBodyProperty = | ||
DependencyProperty.Register(nameof(HasHtmlBody), typeof(bool), typeof(MessageControl), new PropertyMetadata(false)); | ||
|
||
public string TextBody | ||
{ | ||
get { return (string)GetValue(TextBodyProperty); } | ||
set { SetValue(TextBodyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty TextBodyProperty = | ||
DependencyProperty.Register(nameof(TextBody), typeof(string), typeof(MessageControl), new PropertyMetadata(null)); | ||
|
||
public string HtmlBody | ||
{ | ||
get { return (string)GetValue(HtmlBodyProperty); } | ||
set { SetValue(HtmlBodyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty HtmlBodyProperty = | ||
DependencyProperty.Register(nameof(HtmlBody), typeof(string), typeof(MessageControl), new PropertyMetadata(null)); | ||
|
||
public MessageControl() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains 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
23 changes: 23 additions & 0 deletions
23
source/Eppie.App/Eppie.App.UI/Eppie.App.UI.UWP/Controls/MessageControl.xaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<UserControl x:Class="Eppie.App.UI.Controls.MessageControl" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:extensions="using:Tuvi.App.Shared.Extensions" | ||
xmlns:local="using:Eppie.App.UI.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<WebView extensions:WebViewExtension.StringSourceWithDisabledJavaScript="{x:Bind HtmlBody, Mode=OneWay}" Visibility="{x:Bind HasHtmlBody, Mode=OneWay}" /> | ||
|
||
<ScrollViewer Padding="4" Visibility="{x:Bind HasHtmlBody, Converter={StaticResource InverseBoolToVisibilityConverter}, Mode=OneWay}"> | ||
|
||
<TextBlock IsTextSelectionEnabled="True" | ||
Style="{StaticResource MessageTextStyle}" | ||
Text="{x:Bind TextBody, Mode=OneWay}" /> | ||
|
||
</ScrollViewer> | ||
</Grid> | ||
</UserControl> |
This file contains 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
20 changes: 20 additions & 0 deletions
20
source/Eppie.App/Eppie.App.UI/Eppie.App.UI.Uno/Controls/MessageControl.xaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<UserControl x:Class="Eppie.App.UI.Controls.MessageControl" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Eppie.App.UI.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<ScrollViewer Padding="4"> | ||
|
||
<TextBlock IsTextSelectionEnabled="True" | ||
Style="{StaticResource MessageTextStyle}" | ||
Text="{x:Bind TextBody, Mode=OneWay}" /> | ||
|
||
</ScrollViewer> | ||
</Grid> | ||
</UserControl> |
This file contains 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