mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Additional fields rendering done
Removed lots of unused classes
This commit is contained in:
@@ -16,17 +16,22 @@
|
||||
<Color x:Key="TextColorLight">WhiteSmoke</Color>
|
||||
<Color x:Key="BorderColor">DarkGray</Color>
|
||||
<Color x:Key="FlyoutColor">#FFF0F0F0</Color>
|
||||
<Color x:Key="HubSectionColor">#FF777777</Color>
|
||||
|
||||
<SolidColorBrush x:Key="MainColorBrush" Color="{ThemeResource MainColor}" />
|
||||
<SolidColorBrush x:Key="MainColorLightBrush" Color="{ThemeResource MainColorLight}" />
|
||||
<SolidColorBrush x:Key="MainColorDarkBrush" Color="{ThemeResource MainColorDark}" />
|
||||
<SolidColorBrush x:Key="TextColorLightBrush" Color="{ThemeResource TextColorLight}" />
|
||||
<SolidColorBrush x:Key="HubSectionBrush" Color="{ThemeResource HubSectionColor}" />
|
||||
|
||||
<Style TargetType="TextBlock" x:Key="TextBlockSettingsHeaderStyle" >
|
||||
<Setter Property="FontFamily" Value="Segoe UI" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="FontWeight" Value="SemiLight" />
|
||||
</Style>
|
||||
<Style TargetType="HyperlinkButton">
|
||||
<Setter Property="FontWeight" Value="SemiLight" />
|
||||
</Style>
|
||||
|
||||
<SolidColorBrush x:Key="TextBoxBorderThemeBrush" Color="{ThemeResource BorderColor}" />
|
||||
<SolidColorBrush x:Key="TextSelectionHighlightColorThemeBrush" Color="{ThemeResource MainColor}" />
|
||||
|
@@ -525,8 +525,8 @@
|
||||
<data name="EntryHubMain.Header" xml:space="preserve">
|
||||
<value>Main</value>
|
||||
</data>
|
||||
<data name="EntryHubOther.Header" xml:space="preserve">
|
||||
<value>Other</value>
|
||||
<data name="EntryHubPresentation.Header" xml:space="preserve">
|
||||
<value>Presentation</value>
|
||||
</data>
|
||||
<data name="EntryIcon.Text" xml:space="preserve">
|
||||
<value>Icon</value>
|
||||
|
@@ -525,8 +525,8 @@
|
||||
<data name="EntryHubMain.Header" xml:space="preserve">
|
||||
<value>Principal</value>
|
||||
</data>
|
||||
<data name="EntryHubOther.Header" xml:space="preserve">
|
||||
<value>Autres</value>
|
||||
<data name="EntryHubPresentation.Header" xml:space="preserve">
|
||||
<value>Affichage</value>
|
||||
</data>
|
||||
<data name="EntryIcon.Text" xml:space="preserve">
|
||||
<value>Icone</value>
|
||||
|
@@ -388,7 +388,7 @@
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
</Hub.Resources>
|
||||
<HubSection x:Uid="EntryHubMain" IsHeaderInteractive="True">
|
||||
<HubSection x:Uid="EntryHubMain">
|
||||
<DataTemplate>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="20,0,0,20" MinWidth="400">
|
||||
@@ -440,9 +440,9 @@
|
||||
<ToolTip x:Uid="EntryExpirationTooltip" />
|
||||
</ToolTipService.ToolTip>
|
||||
</SymbolIcon>
|
||||
<StackPanel Grid.Column="1" x:Name="ExpirationDatePanel" Orientation="Horizontal" Visibility="{Binding HasExpirationDate, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<StackPanel Grid.Column="1" x:Name="ExpirationDatePanel" Orientation="Vertical" Visibility="{Binding HasExpirationDate, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<DatePicker Margin="0,0,20,0" Date="{Binding ExpiryDate, Mode=TwoWay}" />
|
||||
<TimePicker Time="{Binding ExpiryTime, Mode=TwoWay}" />
|
||||
<TimePicker Margin="0,10,0,0" Time="{Binding ExpiryTime, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -468,23 +468,7 @@
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</HubSection>
|
||||
<HubSection x:Uid="EntryHubAdditional" IsHeaderInteractive="True">
|
||||
<DataTemplate>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding AdditionalFields}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{Binding Name}" Style="{StaticResource EntryTextBlockStyle}" />
|
||||
<TextBox HorizontalAlignment="Left" Text="{Binding Value, Mode=TwoWay}" Width="350" IsEnabled="{Binding Source={StaticResource Locator}, Path=Entry.IsCurrentEntry}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</HubSection>
|
||||
<HubSection x:Uid="EntryHubOther" IsHeaderInteractive="True">
|
||||
<HubSection x:Uid="EntryHubPresentation">
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock x:Uid="EntryIcon" Style="{StaticResource EntryTextBlockStyle}" />
|
||||
@@ -496,7 +480,34 @@
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</HubSection>
|
||||
<HubSection x:Uid="EntryHubAttachments" IsHeaderInteractive="True">
|
||||
<HubSection x:Uid="EntryHubAdditional">
|
||||
<DataTemplate>
|
||||
<local:SelectableTemplateListView
|
||||
ItemsSource="{Binding AdditionalFields}"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<local:SelectableTemplateListView.SelectedItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBox Text="{Binding Name, Mode=TwoWay}" Width="350"
|
||||
IsEnabled="{Binding Path=DataContext.IsCurrentEntry, ElementName=Page}" />
|
||||
<TextBox HorizontalAlignment="Left" AcceptsReturn="True" Height="100" TextWrapping="Wrap" Width="350"
|
||||
Text="{Binding Value, Mode=TwoWay}"
|
||||
IsEnabled="{Binding Path=DataContext.IsCurrentEntry, ElementName=Page}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</local:SelectableTemplateListView.SelectedItemTemplate>
|
||||
<local:SelectableTemplateListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{Binding Name}" Style="{StaticResource EntryTextBlockStyle}" FontWeight="SemiBold" />
|
||||
<TextBlock HorizontalAlignment="Left" MaxLines="3" FontSize="12" Margin="2,0,2,5" Text="{Binding Value}" Style="{StaticResource EntryTextBlockStyle}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</local:SelectableTemplateListView.ItemTemplate>
|
||||
</local:SelectableTemplateListView>
|
||||
</DataTemplate>
|
||||
</HubSection>
|
||||
<HubSection x:Uid="EntryHubAttachments" Foreground="{StaticResource HubSectionBrush}">
|
||||
<DataTemplate>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Vertical">
|
||||
|
@@ -53,7 +53,7 @@
|
||||
</Button>
|
||||
<TextBlock x:Name="TitleTextBox" Text="{Binding Name}" Grid.Column="1" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<controls:ListViewWithDisable
|
||||
<controls:DisableListView
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
x:Name="MenuListView"
|
||||
@@ -62,15 +62,15 @@
|
||||
ItemsSource="{Binding Source={StaticResource MenuItemsSource}}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<controls:ListViewWithDisable.ItemTemplate>
|
||||
<controls:DisableListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding SymbolIcon}" />
|
||||
<TextBlock Text="{Binding Title}" Margin="10,5,0,0" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</controls:ListViewWithDisable.ItemTemplate>
|
||||
<controls:ListViewWithDisable.GroupStyle>
|
||||
</controls:DisableListView.ItemTemplate>
|
||||
<controls:DisableListView.GroupStyle>
|
||||
<GroupStyle HidesIfEmpty="True">
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
@@ -80,8 +80,8 @@
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</controls:ListViewWithDisable.GroupStyle>
|
||||
</controls:ListViewWithDisable>
|
||||
</controls:DisableListView.GroupStyle>
|
||||
</controls:DisableListView>
|
||||
<TextBlock x:Name="PageTitleTextBlock" Grid.Column="1" Grid.Row="0" FontSize="24" VerticalAlignment="Center" Margin="10,0,0,0" >
|
||||
<Run Text="{Binding SelectedItem}" />
|
||||
</TextBlock>
|
||||
|
@@ -3,14 +3,11 @@
|
||||
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:converters="using:ModernKeePass.Converters"
|
||||
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||
xmlns:controls="using:ModernKeePass.Controls"
|
||||
x:Class="ModernKeePass.Views.RecentDatabasesPage"
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=Recent}">
|
||||
<Page.Resources>
|
||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</Page.Resources>
|
||||
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
@@ -22,11 +19,10 @@
|
||||
<TextBlock x:Uid="RecentClear" VerticalAlignment="Center" Margin="10,0,0,0" />
|
||||
</StackPanel>
|
||||
</HyperlinkButton>
|
||||
<ListView Grid.Row="1"
|
||||
<controls:SelectableTemplateListView Grid.Row="1"
|
||||
ItemsSource="{Binding RecentItems}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<ListView.ItemTemplate>
|
||||
<controls:SelectableTemplateListView.SelectedItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="10,0,10,0">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -41,11 +37,18 @@
|
||||
<TextBlock Grid.Row="1" Text="{Binding Path}" Padding="5,0,0,0" FontSize="10" />
|
||||
<userControls:OpenDatabaseUserControl Grid.Row="2"
|
||||
HorizontalAlignment="Stretch" MinWidth="400" Margin="0,10,0,0"
|
||||
Visibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
DatabaseFilePath="{Binding Token}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</controls:SelectableTemplateListView.SelectedItemTemplate>
|
||||
<controls:SelectableTemplateListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="10,0,10,0" Orientation="Vertical">
|
||||
<TextBlock Text="{Binding Name}" Padding="5,0,0,0" />
|
||||
<TextBlock Text="{Binding Path}" Padding="5,0,0,0" FontSize="10" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</controls:SelectableTemplateListView.ItemTemplate>
|
||||
</controls:SelectableTemplateListView>
|
||||
</Grid>
|
||||
</Page>
|
@@ -48,7 +48,7 @@
|
||||
</Button>
|
||||
<TextBlock x:Name="TitleTextBox" x:Uid="SettingsTitle" Grid.Column="1" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<controls:ListViewWithDisable
|
||||
<controls:DisableListView
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
x:Name="MenuListView"
|
||||
@@ -58,15 +58,15 @@
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<controls:ListViewWithDisable.ItemTemplate>
|
||||
<controls:DisableListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding SymbolIcon}" />
|
||||
<TextBlock Text="{Binding Title}" Margin="10,5,0,0" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</controls:ListViewWithDisable.ItemTemplate>
|
||||
<controls:ListViewWithDisable.GroupStyle>
|
||||
</controls:DisableListView.ItemTemplate>
|
||||
<controls:DisableListView.GroupStyle>
|
||||
<GroupStyle HidesIfEmpty="True">
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
@@ -79,8 +79,8 @@
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</controls:ListViewWithDisable.GroupStyle>
|
||||
</controls:ListViewWithDisable>
|
||||
</controls:DisableListView.GroupStyle>
|
||||
</controls:DisableListView>
|
||||
<TextBlock x:Name="PageTitleTextBlock" Grid.Column="1" Grid.Row="0" FontSize="24" VerticalAlignment="Center" Margin="10,0,0,0" >
|
||||
<Run Text="{Binding SelectedItem}" />
|
||||
</TextBlock>
|
||||
|
@@ -1,46 +0,0 @@
|
||||
<UserControl x:Name="UserControl"
|
||||
x:Class="ModernKeePass.Views.UserControls.BreadCrumbUserControl"
|
||||
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:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
||||
mc:Ignorable="d">
|
||||
<ItemsControl ItemsSource="{Binding ItemsSource, ElementName=UserControl}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate x:Name="FirstItemTemplate">
|
||||
<HyperlinkButton FontWeight="Light" FontSize="12" Padding="0" Content="{Binding Title}">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<core:EventTriggerBehavior EventName="Click">
|
||||
<core:NavigateToPageAction Parameter="{Binding Id}" TargetPage="ModernKeePass.Views.GroupDetailPage" />
|
||||
</core:EventTriggerBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
</HyperlinkButton>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Name="OtherItemsTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Viewbox MaxHeight="10" Margin="0,2,0,0">
|
||||
<SymbolIcon Symbol="Forward" />
|
||||
</Viewbox>
|
||||
<HyperlinkButton Content="{Binding Title}" FontWeight="Light" FontSize="12" Padding="0">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<core:EventTriggerBehavior EventName="Click">
|
||||
<core:NavigateToPageAction Parameter="{Binding Id}" TargetPage="ModernKeePass.Views.GroupDetailPage" />
|
||||
</core:EventTriggerBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
<ItemsControl.ItemTemplateSelector>
|
||||
<templateSelectors:FirstItemDataTemplateSelector FirstItem="{StaticResource FirstItemTemplate}" OtherItem="{StaticResource OtherItemsTemplate}"/>
|
||||
</ItemsControl.ItemTemplateSelector>
|
||||
</ItemsControl>
|
||||
</UserControl>
|
@@ -1,29 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
|
||||
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
namespace ModernKeePass.Views.UserControls
|
||||
{
|
||||
public sealed partial class BreadCrumbUserControl
|
||||
{
|
||||
public BreadCrumbUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public IEnumerable<IEntityVm> ItemsSource
|
||||
{
|
||||
get { return (IEnumerable<IEntityVm>)GetValue(ItemsSourceProperty); }
|
||||
set { SetValue(ItemsSourceProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ItemsSourceProperty =
|
||||
DependencyProperty.Register(
|
||||
nameof(ItemsSource),
|
||||
typeof(IEnumerable<IEntityVm>),
|
||||
typeof(BreadCrumbUserControl),
|
||||
new PropertyMetadata(new Stack<IEntityVm>(), (o, args) => { }));
|
||||
}
|
||||
}
|
@@ -4,7 +4,6 @@
|
||||
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:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:converters="using:ModernKeePass.Converters"
|
||||
@@ -88,17 +87,7 @@
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
Background="{ThemeResource AppBarBackgroundThemeBrush}"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<ListView.Resources>
|
||||
<DataTemplate x:Name="IsSpecial">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</SymbolIcon>
|
||||
<TextBlock Text="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" x:Name="GroupTextBlock" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" FontStyle="Italic" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:Name="IsNormal">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
|
||||
@@ -109,10 +98,7 @@
|
||||
<TextBlock Text="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" x:Name="GroupTextBlock" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.Resources>
|
||||
<ListView.ItemTemplateSelector>
|
||||
<templateSelectors:SelectableDataTemplateSelector FalseItem="{StaticResource IsNormal}" TrueItem="{StaticResource IsSpecial}" />
|
||||
</ListView.ItemTemplateSelector>
|
||||
</ListView.ItemTemplate>
|
||||
<ListView.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Visibility="{Binding IsButtonVisible, ElementName=UserControl}">
|
||||
|
@@ -117,9 +117,6 @@
|
||||
<Compile Include="Views\SettingsPageFrames\SettingsWelcomePage.xaml.cs">
|
||||
<DependentUpon>SettingsWelcomePage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\UserControls\BreadCrumbUserControl.xaml.cs">
|
||||
<DependentUpon>BreadCrumbUserControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\UserControls\ColorPickerUserControl.xaml.cs">
|
||||
<DependentUpon>ColorPickerUserControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -208,10 +205,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\UserControls\BreadCrumbUserControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\UserControls\ColorPickerUserControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@@ -0,0 +1,2 @@
|
||||
Support for additional fields
|
||||
Support for attachments
|
@@ -0,0 +1,2 @@
|
||||
Ajout des champs additionnels
|
||||
Ajout des pi<70>ces-jointes
|
@@ -4,7 +4,7 @@ using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
namespace ModernKeePass.Controls
|
||||
{
|
||||
public class ListViewWithDisable: ListView
|
||||
public class DisableListView: ListView
|
||||
{
|
||||
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
|
||||
{
|
43
WinAppCommon/Controls/SelectableTemplateListView.cs
Normal file
43
WinAppCommon/Controls/SelectableTemplateListView.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace ModernKeePass.Controls
|
||||
{
|
||||
public class SelectableTemplateListView: ListView
|
||||
{
|
||||
public DataTemplate SelectedItemTemplate
|
||||
{
|
||||
get { return (DataTemplate)GetValue(SelectedItemTemplateProperty); }
|
||||
set { SetValue(SelectedItemTemplateProperty, value); }
|
||||
}
|
||||
public static readonly DependencyProperty SelectedItemTemplateProperty =
|
||||
DependencyProperty.Register(
|
||||
nameof(SelectedItemTemplate),
|
||||
typeof(DataTemplate),
|
||||
typeof(PasswordBoxWithButton),
|
||||
new PropertyMetadata(null, (o, args) => { }));
|
||||
|
||||
public SelectableTemplateListView()
|
||||
{
|
||||
SelectionChanged += SelectableTemplateListView_SelectionChanged;
|
||||
}
|
||||
|
||||
private void SelectableTemplateListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
var listView = sender as ListView;
|
||||
if (listView == null) return;
|
||||
|
||||
foreach (var item in e.AddedItems)
|
||||
{
|
||||
var listViewItem = listView.ContainerFromItem(item) as ListViewItem;
|
||||
if (listViewItem != null) listViewItem.ContentTemplate = SelectedItemTemplate;
|
||||
}
|
||||
//Remove DataTemplate for unselected items
|
||||
foreach (var item in e.RemovedItems)
|
||||
{
|
||||
var listViewItem = listView.ContainerFromItem(item) as ListViewItem;
|
||||
if (listViewItem != null) listViewItem.ContentTemplate = ItemTemplate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace ModernKeePass.TemplateSelectors
|
||||
{
|
||||
public class FirstItemDataTemplateSelector: DataTemplateSelector
|
||||
{
|
||||
public DataTemplate FirstItem { get; set; }
|
||||
public DataTemplate OtherItem { get; set; }
|
||||
|
||||
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
|
||||
{
|
||||
var itemsControl = ItemsControl.ItemsControlFromItemContainer(container);
|
||||
var returnTemplate = itemsControl?.IndexFromContainer(container) == 0 ? FirstItem : OtherItem;
|
||||
return returnTemplate;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
namespace ModernKeePass.TemplateSelectors
|
||||
{
|
||||
public class SelectableDataTemplateSelector: DataTemplateSelector
|
||||
{
|
||||
public DataTemplate TrueItem { get; set; }
|
||||
public DataTemplate FalseItem { get; set; }
|
||||
|
||||
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
|
||||
{
|
||||
var isSelectableItem = item as ISelectableModel;
|
||||
return isSelectableItem != null && isSelectableItem.IsSelected ? TrueItem : FalseItem;
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,15 +5,13 @@ using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using Messages;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
using ModernKeePass.ViewModels.ListItems;
|
||||
|
||||
namespace ModernKeePass.ViewModels
|
||||
{
|
||||
public class RecentVm : ViewModelBase, IHasSelectableObject
|
||||
public class RecentVm : ViewModelBase
|
||||
{
|
||||
private readonly IRecentProxy _recent;
|
||||
private ISelectableModel _selectedItem;
|
||||
private ObservableCollection<RecentItemVm> _recentItems;
|
||||
|
||||
public ObservableCollection<RecentItemVm> RecentItems
|
||||
@@ -22,24 +20,6 @@ namespace ModernKeePass.ViewModels
|
||||
set { Set(() => RecentItems, ref _recentItems, value); }
|
||||
}
|
||||
|
||||
public ISelectableModel SelectedItem
|
||||
{
|
||||
get { return _selectedItem; }
|
||||
set
|
||||
{
|
||||
if (_selectedItem == value) return;
|
||||
if (_selectedItem != null)
|
||||
{
|
||||
_selectedItem.IsSelected = false;
|
||||
}
|
||||
|
||||
Set(() => SelectedItem, ref _selectedItem, value);
|
||||
|
||||
if (_selectedItem == null) return;
|
||||
_selectedItem.IsSelected = true;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand ClearAllCommand { get; }
|
||||
|
||||
public RecentVm(IRecentProxy recent)
|
||||
@@ -54,8 +34,6 @@ namespace ModernKeePass.ViewModels
|
||||
{
|
||||
var recentItems = _recent.GetAll().Select(r => new RecentItemVm(r));
|
||||
RecentItems = new ObservableCollection<RecentItemVm>(recentItems);
|
||||
if (RecentItems.Count > 0)
|
||||
SelectedItem = RecentItems[0];
|
||||
}
|
||||
|
||||
private void ClearAll()
|
||||
|
@@ -16,8 +16,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Common\Constants.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Common\NavigationHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Common\SuspensionManager.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\ListViewWithDisable.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\DisableListView.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\PasswordBoxWithButton.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\SelectableTemplateListView.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\TextBoxWithButton.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\BooleanToVisibilityConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Converters\ColorToBrushConverter.cs" />
|
||||
@@ -40,8 +41,6 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\FileNotFoundMessage.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\NavigateToPageMessage.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\SaveErrorMessage.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)TemplateSelectors\FirstItemDataTemplateSelector.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)TemplateSelectors\SelectableDataTemplateSelector.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\AboutVm.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\ViewModelLocatorCommon.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\Items\ListMenuItemVm.cs" />
|
||||
|
Reference in New Issue
Block a user