mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Some design changes
Again fixed open url bug
This commit is contained in:
@@ -20,7 +20,7 @@ namespace ModernKeePass.Application.Entry.Models
|
|||||||
public FieldVm Password { get; set; }
|
public FieldVm Password { get; set; }
|
||||||
public FieldVm Notes { get; set; }
|
public FieldVm Notes { get; set; }
|
||||||
public FieldVm Url { 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<FieldVm> AdditionalFields { get; set; }
|
public List<FieldVm> AdditionalFields { get; set; }
|
||||||
public List<EntryVm> History { get; set; }
|
public List<EntryVm> History { get; set; }
|
||||||
public Icon Icon { get; set; }
|
public Icon Icon { get; set; }
|
||||||
|
@@ -86,4 +86,8 @@
|
|||||||
<Thickness x:Key="FlyoutBorderThemeThickness">0</Thickness>
|
<Thickness x:Key="FlyoutBorderThemeThickness">0</Thickness>
|
||||||
<SolidColorBrush x:Key="FlyoutBorderThemeBrush" Color="{ThemeResource FlyoutColor}" />
|
<SolidColorBrush x:Key="FlyoutBorderThemeBrush" Color="{ThemeResource FlyoutColor}" />
|
||||||
<SolidColorBrush x:Key="FlyoutBackgroundThemeBrush" Color="{ThemeResource FlyoutColor}" />
|
<SolidColorBrush x:Key="FlyoutBackgroundThemeBrush" Color="{ThemeResource FlyoutColor}" />
|
||||||
|
|
||||||
|
<Thickness x:Key="ToolTipBorderThemeThickness">0</Thickness>
|
||||||
|
<SolidColorBrush x:Key="ToolTipBorderThemeBrush" Color="{ThemeResource FlyoutColor}" />
|
||||||
|
<SolidColorBrush x:Key="ToolTipBackgroundThemeBrush" Color="{ThemeResource FlyoutColor}" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
@@ -300,7 +300,6 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource ActionButtonStyle}"
|
Style="{StaticResource ActionButtonStyle}"
|
||||||
Content="{TemplateBinding ButtonSymbol}"
|
Content="{TemplateBinding ButtonSymbol}"
|
||||||
IsEnabled="{TemplateBinding IsButtonEnabled}"
|
|
||||||
Command="{TemplateBinding ButtonCommand}"
|
Command="{TemplateBinding ButtonCommand}"
|
||||||
CommandParameter="{TemplateBinding ButtonCommandParameter}">
|
CommandParameter="{TemplateBinding ButtonCommandParameter}">
|
||||||
<ToolTipService.ToolTip>
|
<ToolTipService.ToolTip>
|
||||||
|
@@ -134,7 +134,7 @@
|
|||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</MenuFlyoutItem>
|
</MenuFlyoutItem>
|
||||||
<MenuFlyoutItem x:Uid="EntryItemCopyUrl" IsEnabled="{Binding HasUrl}">
|
<MenuFlyoutItem x:Uid="EntryItemCopyUrl" IsEnabled="{Binding IsValidUrl}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<actions:NavigateToUrlAction Url="{Binding Url}" />
|
<actions:NavigateToUrlAction Url="{Binding Url}" />
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using GalaSoft.MvvmLight.Views;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Xaml.Interactivity;
|
using Microsoft.Xaml.Interactivity;
|
||||||
|
|
||||||
namespace ModernKeePass.Actions
|
namespace ModernKeePass.Actions
|
||||||
@@ -24,10 +22,8 @@ namespace ModernKeePass.Actions
|
|||||||
var uri = new Uri(Url);
|
var uri = new Uri(Url);
|
||||||
return Windows.System.Launcher.LaunchUriAsync(uri).GetAwaiter().GetResult();
|
return Windows.System.Launcher.LaunchUriAsync(uri).GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
var dialogService = App.Services.GetRequiredService<IDialogService>();
|
|
||||||
dialogService.ShowError(ex, ex.Message, null, () => {}).Wait();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,19 +69,6 @@ namespace ModernKeePass.Controls
|
|||||||
typeof(TextBoxWithButton),
|
typeof(TextBoxWithButton),
|
||||||
new PropertyMetadata(null, (o, args) => { }));
|
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()
|
public TextBoxWithButton()
|
||||||
{
|
{
|
||||||
DefaultStyleKey = typeof(TextBoxWithButton);
|
DefaultStyleKey = typeof(TextBoxWithButton);
|
||||||
|
Reference in New Issue
Block a user