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.
Updated the account omemo info with label support
- Loading branch information
Showing
14 changed files
with
372 additions
and
120 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<UserControl x:Class="UWPX_UI.Controls.OMEMO.OmemoDeviceControl" | ||
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" | ||
xmlns:omemo="using:UWPX_UI_Context.Classes.ValueConverter.OMEMO" | ||
mc:Ignorable="d"> | ||
|
||
<UserControl.Resources> | ||
<omemo:OmemoDeviceIdStringValueConverter x:Key="OmemoDeviceIdStringValueConverter"/> | ||
</UserControl.Resources> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<TextBlock Grid.Row="0" | ||
MaxLines="1" | ||
Style="{ThemeResource BaseLineTextBlockStyle}" | ||
Text="{x:Bind VIEW_MODEL.MODEL.Label, Mode=OneWay}" | ||
TextTrimming="CharacterEllipsis" | ||
TextWrapping="NoWrap"/> | ||
<TextBlock Grid.Row="1" | ||
Foreground="{ThemeResource CaptionTextBrush}" | ||
MaxLines="1" | ||
Style="{ThemeResource CaptionLineTextBlockStyle}" | ||
Text="{x:Bind Device.deviceId, Mode=OneWay, Converter={StaticResource OmemoDeviceIdStringValueConverter}}" | ||
TextTrimming="CharacterEllipsis" | ||
TextWrapping="NoWrap" | ||
Visibility="{x:Bind Device.deviceLabel, Mode=OneWay, Converter={StaticResource StringEmptyVisibilityValueConverter}}"/> | ||
</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 Storage.Classes.Models.Omemo; | ||
using UWPX_UI_Context.Classes.DataContext.Controls.OMEMO; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace UWPX_UI.Controls.OMEMO | ||
{ | ||
public sealed partial class OmemoDeviceControl: UserControl | ||
{ | ||
//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\ | ||
#region --Attributes-- | ||
public OmemoDeviceModel Device | ||
{ | ||
get => (OmemoDeviceModel)GetValue(DeviceProperty); | ||
set => SetValue(DeviceProperty, value); | ||
} | ||
public static readonly DependencyProperty DeviceProperty = DependencyProperty.Register(nameof(Device), typeof(OmemoDeviceModel), typeof(OmemoDeviceControl), new PropertyMetadata(null, OnDeviceChanged)); | ||
|
||
public readonly OmemoDeviceControlContext VIEW_MODEL = new OmemoDeviceControlContext(); | ||
#endregion | ||
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ | ||
#region --Constructors-- | ||
public OmemoDeviceControl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
#endregion | ||
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ | ||
#region --Set-, Get- Methods-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ | ||
#region --Misc Methods (Public)-- | ||
private void UpdateView(DependencyPropertyChangedEventArgs e) | ||
{ | ||
VIEW_MODEL.UpdateView(e); | ||
} | ||
|
||
#endregion | ||
|
||
#region --Misc Methods (Private)-- | ||
|
||
|
||
#endregion | ||
|
||
#region --Misc Methods (Protected)-- | ||
|
||
|
||
#endregion | ||
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ | ||
#region --Events-- | ||
private static void OnDeviceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (d is OmemoDeviceControl control) | ||
{ | ||
control.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
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.