This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added buttons to the ContactInfoControl
- Loading branch information
Showing
10 changed files
with
259 additions
and
52 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
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
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
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,47 @@ | ||
<UserControl x:Class="UWPX_UI.Controls.OMEMO.OmemoButtonControl" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:UWPX_UI.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:valueconverter="using:UWPX_UI_Context.Classes.ValueConverter" | ||
mc:Ignorable="d"> | ||
|
||
<UserControl.Resources> | ||
<valueconverter:OmemoBoolGlyphTextValueConverter x:Key="OmemoBoolGlyphTextValueConverter"/> | ||
<valueconverter:OmemoBoolBrushValueConverter x:Key="OmemoBoolBrushValueConverter"/> | ||
</UserControl.Resources> | ||
|
||
<Button Grid.Column="2" | ||
Height="35" | ||
Background="Transparent" | ||
Content="{x:Bind OmemoEnabled, Mode=OneWay, Converter={StaticResource OmemoBoolGlyphTextValueConverter}}" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
FontSize="20" | ||
FontWeight="Bold" | ||
Foreground="{x:Bind OmemoEnabled, Mode=OneWay, Converter={StaticResource OmemoBoolBrushValueConverter}}" | ||
Style="{ThemeResource ButtonRevealStyle}"> | ||
<Button.Flyout> | ||
<Flyout> | ||
<StackPanel> | ||
<RadioButton GroupName="OMEMO" | ||
IsChecked="{x:Bind OmemoEnabled, Mode=TwoWay}"> | ||
<controls:IconTextBlockControl Glyph="" | ||
GlyphForeground="DarkGreen" | ||
Text="Encrypted (OMEMO)"/> | ||
</RadioButton> | ||
<RadioButton GroupName="OMEMO" | ||
IsChecked="{x:Bind OmemoEnabled, Mode=TwoWay, Converter={StaticResource BoolInverterValueConverter}}"> | ||
<controls:IconTextBlockControl Glyph="" | ||
GlyphForeground="DarkRed" | ||
Text="Unencrypted"/> | ||
</RadioButton> | ||
<HyperlinkButton x:Name="readOnOmemo_link" | ||
Margin="0,10,0,0" | ||
Click="ReadOnOmemo_link_Click" | ||
Content="What is OMEMO?"/> | ||
</StackPanel> | ||
</Flyout> | ||
</Button.Flyout> | ||
</Button> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using UWPX_UI_Context.Classes.DataContext.Controls; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace UWPX_UI.Controls.OMEMO | ||
{ | ||
public sealed partial class OmemoButtonControl: UserControl | ||
{ | ||
//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\ | ||
#region --Attributes-- | ||
public bool OmemoEnabled | ||
{ | ||
get { return (bool)GetValue(OmemoEnabledProperty); } | ||
set { SetValue(OmemoEnabledProperty, value); } | ||
} | ||
public static readonly DependencyProperty OmemoEnabledProperty = DependencyProperty.Register(nameof(OmemoEnabled), typeof(bool), typeof(OmemoButtonControl), new PropertyMetadata(false)); | ||
|
||
public readonly OmemoButtonControlContext VIEW_MODEL = new OmemoButtonControlContext(); | ||
|
||
#endregion | ||
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ | ||
#region --Constructors-- | ||
public OmemoButtonControl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
#endregion | ||
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ | ||
#region --Set-, Get- Methods-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ | ||
#region --Misc Methods (Public)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Private)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Protected)-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ | ||
#region --Events-- | ||
private async void ReadOnOmemo_link_Click(object sender, RoutedEventArgs e) | ||
{ | ||
await VIEW_MODEL.OnReadOnOmemoClickedAsync(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
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
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
48 changes: 48 additions & 0 deletions
48
UWPX_UI_Context/Classes/DataContext/Controls/OmemoButtonControlContext.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,48 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using UWPX_UI_Context.Classes.DataTemplates.Controls; | ||
|
||
namespace UWPX_UI_Context.Classes.DataContext.Controls | ||
{ | ||
public sealed class OmemoButtonControlContext | ||
{ | ||
//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\ | ||
#region --Attributes-- | ||
public readonly OmemoButtonControlDataTemplate MODEL = new OmemoButtonControlDataTemplate(); | ||
|
||
#endregion | ||
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ | ||
#region --Constructors-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ | ||
#region --Set-, Get- Methods-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ | ||
#region --Misc Methods (Public)-- | ||
public async Task OnReadOnOmemoClickedAsync() | ||
{ | ||
await UiUtils.LaunchUriAsync(new Uri("https://conversations.im/omemo/")); | ||
} | ||
|
||
#endregion | ||
|
||
#region --Misc Methods (Private)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Protected)-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ | ||
#region --Events-- | ||
|
||
|
||
#endregion | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
UWPX_UI_Context/Classes/DataTemplates/Controls/OmemoButtonControlDataTemplate.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,41 @@ | ||
namespace UWPX_UI_Context.Classes.DataTemplates.Controls | ||
{ | ||
public class OmemoButtonControlDataTemplate | ||
{ | ||
//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\ | ||
#region --Attributes-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ | ||
#region --Constructors-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ | ||
#region --Set-, Get- Methods-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ | ||
#region --Misc Methods (Public)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Private)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Protected)-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ | ||
#region --Events-- | ||
|
||
|
||
#endregion | ||
} | ||
} |
Oops, something went wrong.