Skip to content

Commit

Permalink
worked on KeyInvisibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Miaam committed Feb 18, 2018
1 parent cd60071 commit 19287d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ClientApp/ModernEncryption.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="b1ecc622-7a1b-4a3c-8715-73e39e12c4ah" Publisher="CN=ModernEncryption Team" Version="0.9.15.0" />
<Identity Name="b1ecc622-7a1b-4a3c-8715-73e39e12c4am" Publisher="CN=ModernEncryption Team" Version="0.9.15.0" />
<mp:PhoneIdentity PhoneProductId="b1ecc622-7a1b-4a3c-8715-73e39e12c4a5" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>DontSpyUniversalWindows</DisplayName>
Expand Down
2 changes: 2 additions & 0 deletions ClientApp/ModernEncryption/Model/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class Channel : IEntity
[Ignore]
public ChannelPage View => _channelView ?? (_channelView = new ChannelPage(this));

public static bool ChannelKeyVisibility { get; set; } = true;

This comment has been minimized.

Copy link
@tobiasstraub

tobiasstraub Feb 18, 2018

Member

@Miaam Wenn Du das auf static setzt, ist es losgelöst vom Objektmodell. Und kann nicht für einzelne Channels funktionieren. static muss raus


public Channel()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ListView.Header>
<StackLayout HorizontalOptions="FillAndExpand">
<Label Text="{i18n:Translate ChannelHeading}" Font="Bold" HorizontalTextAlignment="Center"/>
<Button Text="{i18n:Translate Key}" HorizontalOptions="Center" Command ="{Binding ShowKeyCommand}" TextColor="Gray" BorderColor="Gray" BorderRadius="0"></Button>
<Button Text="{i18n:Translate Key}" HorizontalOptions="Center" Command ="{Binding ShowKeyCommand}" TextColor="Gray" BorderColor="Gray" BorderRadius="0" IsVisible="{Binding KeyVisibility}"></Button>
</StackLayout>
</ListView.Header>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Input;
using ModernEncryption.Model;
Expand All @@ -20,6 +21,8 @@ public class ChannelPageViewModel : ValidationBase, INotifyPropertyChanged
public ICommand ValidateMessageCommand { protected set; get; }
public ICommand ShowKeyCommand { protected set; get; }
public Page KeyPage { get; set; }
public bool KeyVisibility { get; set; }
public bool ChannelKeyVisibility { get; }

This comment has been minimized.

Copy link
@tobiasstraub

tobiasstraub Feb 18, 2018

Member

@Miaam Das macht ja keinen Sinn. ChannelKeyVisibility muss raus.


public string Title
{
Expand Down Expand Up @@ -64,14 +67,17 @@ public ChannelPageViewModel(Channel channel)
Validate();
});

KeyVisibility = Channel.ChannelKeyVisibility;

This comment has been minimized.

Copy link
@tobiasstraub

tobiasstraub Feb 18, 2018

Member

Nicht Channel! - Der Konstruktorparameter lautet doch 'channel'. Richtig wäre channel.ChannelKeyVisibility @Miaam


ShowKeyCommand = new Command<object>(param =>
{
DependencyManager.AnchorPage.Children[1].Navigation.PopToRootAsync(false);
_view.Navigation.PushAsync(new KeyPage());
KeyVisibility = false;
Channel.ChannelKeyVisibility = false;
});
}


protected sealed override void AddValidations()
{
_message.Validations.Add(new IsNullOrEmptyRule<string>());
Expand Down

0 comments on commit 19287d9

Please sign in to comment.