From 19287d9e25955cb5a93be4a0b4c6388b1115f35f Mon Sep 17 00:00:00 2001 From: Mai Saito Date: Sun, 18 Feb 2018 11:16:35 +0100 Subject: [PATCH] worked on KeyInvisibility --- ClientApp/ModernEncryption.UWP/Package.appxmanifest | 2 +- ClientApp/ModernEncryption/Model/Channel.cs | 2 ++ .../Presentation/View/ChannelPage.xaml | 2 +- .../Presentation/ViewModel/ChannelPageViewModel.cs | 10 ++++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ClientApp/ModernEncryption.UWP/Package.appxmanifest b/ClientApp/ModernEncryption.UWP/Package.appxmanifest index 6ef8c45..a4decc7 100644 --- a/ClientApp/ModernEncryption.UWP/Package.appxmanifest +++ b/ClientApp/ModernEncryption.UWP/Package.appxmanifest @@ -1,6 +1,6 @@  - + DontSpyUniversalWindows diff --git a/ClientApp/ModernEncryption/Model/Channel.cs b/ClientApp/ModernEncryption/Model/Channel.cs index 1f5979d..d9fe687 100644 --- a/ClientApp/ModernEncryption/Model/Channel.cs +++ b/ClientApp/ModernEncryption/Model/Channel.cs @@ -26,6 +26,8 @@ public class Channel : IEntity [Ignore] public ChannelPage View => _channelView ?? (_channelView = new ChannelPage(this)); + public static bool ChannelKeyVisibility { get; set; } = true; + public Channel() { } diff --git a/ClientApp/ModernEncryption/Presentation/View/ChannelPage.xaml b/ClientApp/ModernEncryption/Presentation/View/ChannelPage.xaml index b676ee7..31066e5 100644 --- a/ClientApp/ModernEncryption/Presentation/View/ChannelPage.xaml +++ b/ClientApp/ModernEncryption/Presentation/View/ChannelPage.xaml @@ -20,7 +20,7 @@ diff --git a/ClientApp/ModernEncryption/Presentation/ViewModel/ChannelPageViewModel.cs b/ClientApp/ModernEncryption/Presentation/ViewModel/ChannelPageViewModel.cs index 66eb248..42d3586 100644 --- a/ClientApp/ModernEncryption/Presentation/ViewModel/ChannelPageViewModel.cs +++ b/ClientApp/ModernEncryption/Presentation/ViewModel/ChannelPageViewModel.cs @@ -1,4 +1,5 @@ -using System.Collections.ObjectModel; +using System; +using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Input; using ModernEncryption.Model; @@ -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; } public string Title { @@ -64,14 +67,17 @@ public ChannelPageViewModel(Channel channel) Validate(); }); + KeyVisibility = Channel.ChannelKeyVisibility; + ShowKeyCommand = new Command(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());