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 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
409 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,34 @@ | ||
<UserControl x:Class="UWPX_UI.Controls.OMEMO.OmemoFingerprintControl" | ||
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" | ||
mc:Ignorable="d"> | ||
|
||
<Grid/> | ||
<Grid Visibility="{x:Bind VIEW_MODEL.MODEL.Fingerprint, Mode=OneWay, Converter={StaticResource StringEmptyVisabilityValueConverter}}"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Grid Grid.Row="0"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock Margin="0,10,10,0" | ||
IsTextSelectionEnabled="True" | ||
Text="{x:Bind VIEW_MODEL.MODEL.Fingerprint, Mode=OneWay}" | ||
TextWrapping="WrapWholeWords"/> | ||
<Button x:Name="cpyFingerprint_btn" | ||
Grid.Column="1" | ||
VerticalAlignment="Center" | ||
Click="CpyFingerprint_btn_Click" | ||
Content="" | ||
FontFamily="Segoe MDL2 Assets"/> | ||
</Grid> | ||
<controls:QrCodeControl Grid.Row="1" | ||
Margin="0,10,0,0" | ||
QrCodeText="{x:Bind VIEW_MODEL.MODEL.Fingerprint, Mode=OneWay}"/> | ||
</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
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="UWPX_UI.Controls.QrCodeControl" | ||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<CheckBox Grid.Row="0" | ||
Margin="0,0,0,10" | ||
Content="Default QR-Code" | ||
IsChecked="{x:Bind VIEW_MODEL.MODEL.DefaultQrCode, Mode=TwoWay}"/> | ||
<Image Grid.Row="1" | ||
Source="{x:Bind VIEW_MODEL.MODEL.QrCodeImage, Mode=OneWay}"/> | ||
<ProgressRing Grid.Row="1" | ||
IsActive="True" | ||
Visibility="{x:Bind VIEW_MODEL.MODEL.IsLoading, Mode=OneWay, Converter={StaticResource BoolVisabilityValueConverter}}"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using UWPX_UI_Context.Classes.DataContext.Controls; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace UWPX_UI.Controls | ||
{ | ||
public sealed partial class QrCodeControl : UserControl | ||
{ | ||
//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\ | ||
#region --Attributes-- | ||
public string QrCodeText | ||
{ | ||
get { return (string)GetValue(QrCodeTextProperty); } | ||
set { SetValue(QrCodeTextProperty, value); } | ||
} | ||
public static readonly DependencyProperty QrCodeTextProperty = DependencyProperty.Register(nameof(QrCodeText), typeof(string), typeof(QrCodeControl), new PropertyMetadata("", OnQrCodeTextChanged)); | ||
|
||
public readonly QrCodeControlContext VIEW_MODEL = new QrCodeControlContext(); | ||
|
||
#endregion | ||
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ | ||
#region --Constructors-- | ||
public QrCodeControl() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
#endregion | ||
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ | ||
#region --Set-, Get- Methods-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ | ||
#region --Misc Methods (Public)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Private)-- | ||
private void UpdateView(DependencyPropertyChangedEventArgs e) | ||
{ | ||
VIEW_MODEL.UpdateView(e); | ||
} | ||
|
||
#endregion | ||
|
||
#region --Misc Methods (Protected)-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ | ||
#region --Events-- | ||
private static void OnQrCodeTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (d is QrCodeControl qrCodeControl) | ||
{ | ||
qrCodeControl.UpdateView(e); | ||
} | ||
} | ||
|
||
#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
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
54 changes: 54 additions & 0 deletions
54
UWPX_UI_Context/Classes/DataContext/Controls/QrCodeControlContext.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,54 @@ | ||
using UWPX_UI_Context.Classes.DataTemplates.Controls; | ||
using Windows.UI.Xaml; | ||
|
||
namespace UWPX_UI_Context.Classes.DataContext.Controls | ||
{ | ||
public sealed class QrCodeControlContext | ||
{ | ||
//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\ | ||
#region --Attributes-- | ||
public readonly QrCodeControlDataTemplate MODEL = new QrCodeControlDataTemplate(); | ||
|
||
#endregion | ||
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ | ||
#region --Constructors-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ | ||
#region --Set-, Get- Methods-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ | ||
#region --Misc Methods (Public)-- | ||
public void UpdateView(DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (e.NewValue is string s) | ||
{ | ||
MODEL.UpdateView(s); | ||
} | ||
else | ||
{ | ||
MODEL.UpdateView(null); | ||
} | ||
} | ||
|
||
#endregion | ||
|
||
#region --Misc Methods (Private)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Protected)-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ | ||
#region --Events-- | ||
|
||
|
||
#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
Oops, something went wrong.