Replaced almost all CallMethodActions with RelayCommands (allows using async)

SonarQube bug correction
This commit is contained in:
BONNEVILLE Geoffroy
2018-06-20 18:41:56 +02:00
parent ca377a6684
commit 803dab0fb5
8 changed files with 87 additions and 108 deletions

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks;
using Windows.ApplicationModel; using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation; using Windows.ApplicationModel.Activation;
using Windows.Storage; using Windows.Storage;
@@ -81,18 +82,17 @@ namespace ModernKeePass
/// <param name="args">Details about the launch request and process.</param> /// <param name="args">Details about the launch request and process.</param>
protected override async void OnLaunched(LaunchActivatedEventArgs args) protected override async void OnLaunched(LaunchActivatedEventArgs args)
{ {
OnLaunchOrActivated(args); await OnLaunchOrActivated(args);
await HockeyClient.Current.SendCrashesAsync(/* sendWithoutAsking: true */); await HockeyClient.Current.SendCrashesAsync(/* sendWithoutAsking: true */);
} }
protected override void OnActivated(IActivatedEventArgs args) protected override async void OnActivated(IActivatedEventArgs args)
{ {
OnLaunchOrActivated(args); await OnLaunchOrActivated(args);
} }
private async void OnLaunchOrActivated(IActivatedEventArgs e) private async Task OnLaunchOrActivated(IActivatedEventArgs e)
{ {
#if DEBUG #if DEBUG
if (System.Diagnostics.Debugger.IsAttached) if (System.Diagnostics.Debugger.IsAttached)
{ {

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Input;
using ModernKeePass.ViewModels; using ModernKeePass.ViewModels;
namespace ModernKeePass.Interfaces namespace ModernKeePass.Interfaces
@@ -14,6 +15,14 @@ namespace ModernKeePass.Interfaces
bool IsEditMode { get; } bool IsEditMode { get; }
bool IsRecycleOnDelete { get; } bool IsRecycleOnDelete { get; }
/// <summary>
/// Save changes to Model
/// </summary>
ICommand SaveCommand { get; }
/// <summary>
/// Restore ViewModel
/// </summary>
ICommand UndoDeleteCommand { get; }
/// <summary> /// <summary>
/// Move a entity to the destination group /// Move a entity to the destination group
/// </summary> /// </summary>
@@ -24,14 +33,6 @@ namespace ModernKeePass.Interfaces
/// </summary> /// </summary>
void CommitDelete(); void CommitDelete();
/// <summary> /// <summary>
/// Restore ViewModel
/// </summary>
void UndoDelete();
/// <summary>
/// Save changes to Model
/// </summary>
void Save();
/// <summary>
/// Delete from ViewModel /// Delete from ViewModel
/// </summary> /// </summary>
void MarkForDelete(string recycleBinTitle); void MarkForDelete(string recycleBinTitle);

View File

@@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Input;
using ModernKeePass.Common;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;
using ModernKeePassLib; using ModernKeePassLib;
@@ -158,6 +160,10 @@ namespace ModernKeePass.ViewModels
} }
} }
public ICommand SaveCommand { get; }
public ICommand GeneratePasswordCommand { get; }
public ICommand UndoDeleteCommand { get; }
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
private readonly PwEntry _pwEntry; private readonly PwEntry _pwEntry;
@@ -184,6 +190,10 @@ namespace ModernKeePass.ViewModels
_resource = resource; _resource = resource;
_pwEntry = entry; _pwEntry = entry;
ParentGroup = parent; ParentGroup = parent;
SaveCommand = new RelayCommand(() => _database.Save());
GeneratePasswordCommand = new RelayCommand(GeneratePassword);
UndoDeleteCommand = new RelayCommand(() => Move(PreviousGroup));
} }
public void GeneratePassword() public void GeneratePassword()
@@ -215,21 +225,6 @@ namespace ModernKeePass.ViewModels
NotifyPropertyChanged("PasswordComplexityIndicator"); NotifyPropertyChanged("PasswordComplexityIndicator");
} }
private string GetEntryValue(string key)
{
return _pwEntry?.Strings.GetSafe(key).ReadString();
}
private void SetEntryValue(string key, string newValue)
{
if (!_isDirty)
{
_pwEntry.Touch(true);
_pwEntry?.CreateBackup(null);
}
_pwEntry?.Strings.Set(key, new ProtectedString(true, newValue));
_isDirty = true;
}
public void MarkForDelete(string recycleBinTitle) public void MarkForDelete(string recycleBinTitle)
{ {
@@ -237,12 +232,7 @@ namespace ModernKeePass.ViewModels
_database.CreateRecycleBin(recycleBinTitle); _database.CreateRecycleBin(recycleBinTitle);
Move(_database.RecycleBinEnabled && !ParentGroup.IsSelected ? _database.RecycleBin : null); Move(_database.RecycleBinEnabled && !ParentGroup.IsSelected ? _database.RecycleBin : null);
} }
public void UndoDelete()
{
Move(PreviousGroup);
}
public void Move(GroupVm destination) public void Move(GroupVm destination)
{ {
PreviousGroup = ParentGroup; PreviousGroup = ParentGroup;
@@ -261,12 +251,7 @@ namespace ModernKeePass.ViewModels
_pwEntry.ParentGroup.Entries.Remove(_pwEntry); _pwEntry.ParentGroup.Entries.Remove(_pwEntry);
if (!_database.RecycleBinEnabled || PreviousGroup.IsSelected) _database.AddDeletedItem(IdUuid); if (!_database.RecycleBinEnabled || PreviousGroup.IsSelected) _database.AddDeletedItem(IdUuid);
} }
public void Save()
{
_database.Save();
}
public PwEntry GetPwEntry() public PwEntry GetPwEntry()
{ {
return _pwEntry; return _pwEntry;
@@ -281,5 +266,20 @@ namespace ModernKeePass.ViewModels
return IsSelected ? _resource.GetResourceValue("EntryCurrent") : _pwEntry.LastModificationTime.ToString("g"); return IsSelected ? _resource.GetResourceValue("EntryCurrent") : _pwEntry.LastModificationTime.ToString("g");
} }
private string GetEntryValue(string key)
{
return _pwEntry?.Strings.GetSafe(key).ReadString();
}
private void SetEntryValue(string key, string newValue)
{
if (!_isDirty)
{
_pwEntry.Touch(true);
_pwEntry?.CreateBackup(null);
}
_pwEntry?.Strings.Set(key, new ProtectedString(true, newValue));
_isDirty = true;
}
} }
} }

View File

@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;
@@ -106,7 +108,12 @@ namespace ModernKeePass.ViewModels
return groups; return groups;
} }
} }
public ICommand SaveCommand { get; }
public ICommand SortEntriesCommand { get; }
public ICommand SortGroupsCommand { get; }
public ICommand UndoDeleteCommand { get; }
private readonly PwGroup _pwGroup; private readonly PwGroup _pwGroup;
private readonly IDatabaseService _database; private readonly IDatabaseService _database;
private bool _isEditMode; private bool _isEditMode;
@@ -126,6 +133,13 @@ namespace ModernKeePass.ViewModels
_database = database; _database = database;
ParentGroup = parent; ParentGroup = parent;
SaveCommand = new RelayCommand(() => _database.Save());
SortEntriesCommand = new RelayCommand(async () =>
await SortEntriesAsync().ConfigureAwait(false));
SortGroupsCommand = new RelayCommand(async () =>
await SortGroupsAsync().ConfigureAwait(false));
UndoDeleteCommand = new RelayCommand(() => Move(PreviousGroup));
if (recycleBinId != null && _pwGroup.Uuid.Equals(recycleBinId)) _database.RecycleBin = this; if (recycleBinId != null && _pwGroup.Uuid.Equals(recycleBinId)) _database.RecycleBin = this;
Entries = new ObservableCollection<EntryVm>(pwGroup.Entries.Select(e => new EntryVm(e, this))); Entries = new ObservableCollection<EntryVm>(pwGroup.Entries.Select(e => new EntryVm(e, this)));
Entries.CollectionChanged += Entries_CollectionChanged; Entries.CollectionChanged += Entries_CollectionChanged;
@@ -199,13 +213,13 @@ namespace ModernKeePass.ViewModels
if (_database.RecycleBinEnabled && !PreviousGroup.IsSelected) _database.RecycleBin._pwGroup.AddGroup(_pwGroup, true); if (_database.RecycleBinEnabled && !PreviousGroup.IsSelected) _database.RecycleBin._pwGroup.AddGroup(_pwGroup, true);
else _database.AddDeletedItem(IdUuid); else _database.AddDeletedItem(IdUuid);
} }
public void Save()
{
_database.Save();
}
public void SortEntries() public override string ToString()
{
return Name;
}
private async Task SortEntriesAsync()
{ {
var comparer = new PwEntryComparer(PwDefs.TitleField, true, false); var comparer = new PwEntryComparer(PwDefs.TitleField, true, false);
try try
@@ -215,11 +229,11 @@ namespace ModernKeePass.ViewModels
} }
catch (Exception e) catch (Exception e)
{ {
MessageDialogHelper.ShowErrorDialog(e).Wait(); await MessageDialogHelper.ShowErrorDialog(e);
} }
} }
public void SortGroups() private async Task SortGroupsAsync()
{ {
try try
{ {
@@ -229,13 +243,9 @@ namespace ModernKeePass.ViewModels
} }
catch (Exception e) catch (Exception e)
{ {
MessageDialogHelper.ShowErrorDialog(e).Wait(); await MessageDialogHelper.ShowErrorDialog(e);
} }
} }
public override string ToString()
{
return Name;
}
} }
} }

View File

@@ -1,4 +1,5 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Windows.Input;
using ModernKeePass.Common; using ModernKeePass.Common;
using ModernKeePass.Interfaces; using ModernKeePass.Interfaces;
using ModernKeePass.Services; using ModernKeePass.Services;
@@ -34,6 +35,8 @@ namespace ModernKeePass.ViewModels
_selectedItem.IsSelected = true; _selectedItem.IsSelected = true;
} }
} }
public ICommand ClearAllCommand { get; }
public RecentVm() : this (RecentService.Instance) public RecentVm() : this (RecentService.Instance)
{ } { }
@@ -41,12 +44,14 @@ namespace ModernKeePass.ViewModels
public RecentVm(IRecentService recent) public RecentVm(IRecentService recent)
{ {
_recent = recent; _recent = recent;
ClearAllCommand = new RelayCommand(ClearAll);
RecentItems = _recent.GetAllFiles(); RecentItems = _recent.GetAllFiles();
if (RecentItems.Count > 0) if (RecentItems.Count > 0)
SelectedItem = RecentItems[0] as RecentItemVm; SelectedItem = RecentItems[0] as RecentItemVm;
} }
public void ClearAll() private void ClearAll()
{ {
_recent.ClearAll(); _recent.ClearAll();
RecentItems.Clear(); RecentItems.Clear();

View File

@@ -15,11 +15,11 @@
mc:Ignorable="d" mc:Ignorable="d"
SizeChanged="EntryDetailPage_OnSizeChanged"> SizeChanged="EntryDetailPage_OnSizeChanged">
<Page.Resources> <Page.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/> <converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" />
<converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter"/> <converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter" />
<converters:DoubleToSolidColorBrushConverter x:Key="DoubleToForegroungBrushComplexityConverter"/> <converters:DoubleToSolidColorBrushConverter x:Key="DoubleToForegroungBrushComplexityConverter" />
<converters:NullToBooleanConverter x:Key="NullToBooleanConverter"/> <converters:NullToBooleanConverter x:Key="NullToBooleanConverter" />
<Style TargetType="PasswordBox" x:Name="PasswordBoxWithButtonStyle"> <Style TargetType="PasswordBox" x:Name="PasswordBoxWithButtonStyle">
<Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" /> <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" /> <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
@@ -353,13 +353,7 @@
<CheckBox IsChecked="{Binding BracketsPatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorBrackets" /> <CheckBox IsChecked="{Binding BracketsPatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorBrackets" />
<TextBlock x:Uid="PasswordGeneratorAlso" Margin="0,5,0,0"/> <TextBlock x:Uid="PasswordGeneratorAlso" Margin="0,5,0,0"/>
<TextBox Text="{Binding CustomChars, Mode=TwoWay}" /> <TextBox Text="{Binding CustomChars, Mode=TwoWay}" />
<Button x:Uid="PasswordGeneratorButton"> <Button x:Uid="PasswordGeneratorButton" Command="{Binding GeneratePasswordCommand}" />
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction TargetObject="{Binding}" MethodName="GeneratePassword"/>
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</StackPanel> </StackPanel>
</Flyout> </Flyout>
</Button.Flyout> </Button.Flyout>
@@ -373,9 +367,9 @@
</Setter> </Setter>
</Style> </Style>
</Page.Resources> </Page.Resources>
<!--<Page.DataContext> <Page.DataContext>
<viewModels:EntryVm /> <viewModels:EntryVm />
</Page.DataContext>--> </Page.DataContext>
<Page.BottomAppBar> <Page.BottomAppBar>
<CommandBar x:Name="CommandBar" VerticalAlignment="Center"> <CommandBar x:Name="CommandBar" VerticalAlignment="Center">
<CommandBar.SecondaryCommands> <CommandBar.SecondaryCommands>
@@ -386,10 +380,9 @@
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
</AppBarButton> </AppBarButton>
<AppBarButton Icon="Save" x:Uid="AppBarSave"> <AppBarButton Icon="Save" x:Uid="AppBarSave" Command="{Binding SaveCommand}">
<interactivity:Interaction.Behaviors> <interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click"> <core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction TargetObject="{Binding}" MethodName="Save"/>
<core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" /> <core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
@@ -409,13 +402,7 @@
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
</AppBarToggleButton> </AppBarToggleButton>
<AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ParentGroup.IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Click="RestoreButton_Click"> <AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ParentGroup.IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Click="RestoreButton_Click" Command="{Binding UndoDeleteCommand}" />
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="UndoDelete" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</AppBarButton>
<AppBarButton Icon="Delete" x:Uid="AppBarDelete" Click="DeleteButton_Click" /> <AppBarButton Icon="Delete" x:Uid="AppBarDelete" Click="DeleteButton_Click" />
</CommandBar> </CommandBar>
</Page.BottomAppBar> </Page.BottomAppBar>
@@ -434,7 +421,7 @@
<ColumnDefinition Width="50" x:Name="LeftListViewColumn" /> <ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<userControls:HamburgerMenuUserControl x:Name="HamburgerMenu" x:Uid="HistoryLeftListView" ItemsSource="{Binding History}" ResizeTarget="{Binding ElementName=LeftListViewColumn}" SelectionChanged="HamburgerMenuUserControl_OnSelectionChanged" /> <userControls:HamburgerMenuUserControl x:Uid="HistoryLeftListView" ItemsSource="{Binding History}" ResizeTarget="{Binding ElementName=LeftListViewColumn}" SelectionChanged="HamburgerMenuUserControl_OnSelectionChanged" />
<StackPanel x:Name="StackPanel" Grid.Column="1" Margin="20,0,0,0"> <StackPanel x:Name="StackPanel" Grid.Column="1" Margin="20,0,0,0">
<StackPanel.Resources> <StackPanel.Resources>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">

View File

@@ -34,10 +34,9 @@
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
</AppBarButton> </AppBarButton>
<AppBarButton Icon="Save" x:Uid="AppBarSave"> <AppBarButton Icon="Save" x:Uid="AppBarSave" Command="{Binding SaveCommand}">
<interactivity:Interaction.Behaviors> <interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click"> <core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction TargetObject="{Binding}" MethodName="Save"/>
<core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" /> <core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
@@ -53,20 +52,8 @@
<AppBarButton Icon="Sort" x:Uid="AppBarSort" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"> <AppBarButton Icon="Sort" x:Uid="AppBarSort" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}">
<Button.Flyout> <Button.Flyout>
<MenuFlyout> <MenuFlyout>
<MenuFlyoutItem x:Uid="AppBarSortEntries"> <MenuFlyoutItem x:Uid="AppBarSortEntries" Command="{Binding SortEntriesCommand}" />
<interactivity:Interaction.Behaviors> <MenuFlyoutItem x:Uid="AppBarSortGroups" Command="{Binding SortGroupsCommand}" />
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="SortEntries" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</MenuFlyoutItem>
<MenuFlyoutItem x:Uid="AppBarSortGroups">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="SortGroups" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</MenuFlyoutItem>
</MenuFlyout> </MenuFlyout>
</Button.Flyout> </Button.Flyout>
</AppBarButton> </AppBarButton>
@@ -77,13 +64,7 @@
</core:EventTriggerBehavior> </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors> </interactivity:Interaction.Behaviors>
</AppBarToggleButton> </AppBarToggleButton>
<AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ShowRestore, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Click="RestoreButton_Click"> <AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ShowRestore, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Click="RestoreButton_Click" Command="{Binding UndoDeleteCommand}" />
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="UndoDelete" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</AppBarButton>
<AppBarButton Icon="Delete" x:Uid="AppBarDelete" IsEnabled="{Binding IsNotRoot}" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" Click="DeleteButton_Click" /> <AppBarButton Icon="Delete" x:Uid="AppBarDelete" IsEnabled="{Binding IsNotRoot}" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" Click="DeleteButton_Click" />
</CommandBar> </CommandBar>
</Page.BottomAppBar> </Page.BottomAppBar>

View File

@@ -22,16 +22,11 @@
<RowDefinition Height="40" /> <RowDefinition Height="40" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<HyperlinkButton Grid.Row="0" HorizontalAlignment="Right" Style="{StaticResource MainColorHyperlinkButton}" Foreground="{StaticResource MainColor}"> <HyperlinkButton Grid.Row="0" HorizontalAlignment="Right" Style="{StaticResource MainColorHyperlinkButton}" Foreground="{StaticResource MainColor}" Command="{Binding ClearAllCommand}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="Cancel" /> <SymbolIcon Symbol="Cancel" />
<TextBlock x:Uid="RecentClear" VerticalAlignment="Center" Margin="10,0,0,0" /> <TextBlock x:Uid="RecentClear" VerticalAlignment="Center" Margin="10,0,0,0" />
</StackPanel> </StackPanel>
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction TargetObject="{Binding}" MethodName="ClearAll" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</HyperlinkButton> </HyperlinkButton>
<ListView Grid.Row="1" <ListView Grid.Row="1"
ItemsSource="{Binding Source={StaticResource RecentItemsSource}}" ItemsSource="{Binding Source={StaticResource RecentItemsSource}}"