diff --git a/ModernKeePass.Application/Entry/Models/EntryVm.cs b/ModernKeePass.Application/Entry/Models/EntryVm.cs index 281ad3d..cef4094 100644 --- a/ModernKeePass.Application/Entry/Models/EntryVm.cs +++ b/ModernKeePass.Application/Entry/Models/EntryVm.cs @@ -20,7 +20,7 @@ namespace ModernKeePass.Application.Entry.Models public FieldVm Password { get; set; } public FieldVm Notes { get; set; } public FieldVm Url { get; set; } - public bool HasUrl => !string.IsNullOrEmpty(Url.Value); + public bool IsValidUrl => Uri.IsWellFormedUriString(Url.Value, UriKind.Absolute); public List AdditionalFields { get; set; } public List History { get; set; } public Icon Icon { get; set; } diff --git a/ModernKeePass/ResourceDictionaries/Styles.xaml b/ModernKeePass/ResourceDictionaries/Styles.xaml index ee0f9b7..ecbc6d0 100644 --- a/ModernKeePass/ResourceDictionaries/Styles.xaml +++ b/ModernKeePass/ResourceDictionaries/Styles.xaml @@ -86,4 +86,8 @@ 0 + + 0 + + diff --git a/ModernKeePass/ResourceDictionaries/TextBoxWithButtonStyle.xaml b/ModernKeePass/ResourceDictionaries/TextBoxWithButtonStyle.xaml index 6ad9db9..fce5830 100644 --- a/ModernKeePass/ResourceDictionaries/TextBoxWithButtonStyle.xaml +++ b/ModernKeePass/ResourceDictionaries/TextBoxWithButtonStyle.xaml @@ -300,7 +300,6 @@ Grid.Column="1" Style="{StaticResource ActionButtonStyle}" Content="{TemplateBinding ButtonSymbol}" - IsEnabled="{TemplateBinding IsButtonEnabled}" Command="{TemplateBinding ButtonCommand}" CommandParameter="{TemplateBinding ButtonCommandParameter}"> diff --git a/ModernKeePass/Views/GroupDetailPage.xaml b/ModernKeePass/Views/GroupDetailPage.xaml index 1b7229a..46a22db 100644 --- a/ModernKeePass/Views/GroupDetailPage.xaml +++ b/ModernKeePass/Views/GroupDetailPage.xaml @@ -134,7 +134,7 @@ - + diff --git a/WinAppCommon/Actions/NavigateToUrlAction.cs b/WinAppCommon/Actions/NavigateToUrlAction.cs index a8cd9dd..82a63d3 100644 --- a/WinAppCommon/Actions/NavigateToUrlAction.cs +++ b/WinAppCommon/Actions/NavigateToUrlAction.cs @@ -1,7 +1,5 @@ using System; using Windows.UI.Xaml; -using GalaSoft.MvvmLight.Views; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Xaml.Interactivity; namespace ModernKeePass.Actions @@ -24,10 +22,8 @@ namespace ModernKeePass.Actions var uri = new Uri(Url); return Windows.System.Launcher.LaunchUriAsync(uri).GetAwaiter().GetResult(); } - catch (Exception ex) + catch (Exception) { - var dialogService = App.Services.GetRequiredService(); - dialogService.ShowError(ex, ex.Message, null, () => {}).Wait(); return false; } } diff --git a/WinAppCommon/Controls/TextBoxWithButton.cs b/WinAppCommon/Controls/TextBoxWithButton.cs index 7558e10..24b3999 100644 --- a/WinAppCommon/Controls/TextBoxWithButton.cs +++ b/WinAppCommon/Controls/TextBoxWithButton.cs @@ -69,19 +69,6 @@ namespace ModernKeePass.Controls typeof(TextBoxWithButton), new PropertyMetadata(null, (o, args) => { })); - public bool IsButtonEnabled - { - get { return (bool)GetValue(IsButtonEnabledProperty); } - set { SetValue(IsButtonEnabledProperty, value); } - } - public static readonly DependencyProperty IsButtonEnabledProperty = - DependencyProperty.Register( - nameof(IsButtonEnabled), - typeof(bool), - typeof(TextBoxWithButton), - new PropertyMetadata(true, (o, args) => { })); - - public TextBoxWithButton() { DefaultStyleKey = typeof(TextBoxWithButton);