Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup and format some xaml files #1992

Merged
merged 4 commits into from Jul 29, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1,7 +1,7 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsHitTestVisible="{Binding IsLocked}">
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsHitTestVisible="{Binding IsLocked}">
<UserControl.DataTemplates>
<DataTemplate DataType="{x:Type lockscreen:PinLockScreenViewModel}">
<lockscreen:PinLockScreen />
@@ -40,10 +40,11 @@ public bool IsLocked

public void Initialize()
{
Global.UiConfig.WhenAnyValue(x => x.LockScreenActive)
.ObserveOn(RxApp.MainThreadScheduler)
.BindTo(this, y => y.IsLocked)
.DisposeWith(Disposables);
Global.UiConfig
.WhenAnyValue(x => x.LockScreenActive)
.ObserveOn(RxApp.MainThreadScheduler)
.BindTo(this, y => y.IsLocked)
.DisposeWith(Disposables);

this.WhenAnyValue(x => x.IsLocked)
.ObserveOn(RxApp.MainThreadScheduler)
@@ -1,15 +1,13 @@
<lockscreen:PinLockScreen xmlns="https://github.com/avaloniaui"
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsLocked="{Binding IsLocked}">
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsLocked="{Binding IsLocked}">
<lockscreen:PinLockScreen.Styles>

<Style Selector="Grid.Shade">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="-100" />
</Style>

<Style Selector="lockscreen|PinLockScreen[IsLocked=true] Grid.Shade">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:1.5" Easing="QuarticEaseInOut">
@@ -20,7 +18,6 @@
</Animation>
</Style.Animations>
</Style>

<Style Selector="lockscreen|PinLockScreen[IsLocked=false] Grid.Shade">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:1.5" Easing="QuarticEaseInOut">
@@ -35,11 +32,10 @@
<Grid>
<Grid Classes="Shade" Background="{DynamicResource ThemeBackgroundBrush}">
<controls:GroupBox VerticalAlignment="Center" HorizontalAlignment="Center" TextBlock.FontSize="25" Padding="20" Margin="10">
<DockPanel LastChildFill ="True">
<DockPanel LastChildFill="True">
<controls:NoparaPasswordBox x:Name="InputField" Password="{Binding PinInput}" Width="300" DockPanel.Dock="Top" Margin="4 0 4 20" Watermark="PIN" UseFloatingWatermark="True" />
<Grid DockPanel.Dock="Bottom">
<TextBlock Text="Wrong PIN!"
Margin="0,12,0,0" VerticalAlignment="Center" FontSize="20" Classes="warningMessage" IsVisible="{Binding WarningMessageVisible}" />
<TextBlock Text="Wrong PIN!" Margin="0,12,0,0" VerticalAlignment="Center" FontSize="20" Classes="warningMessage" IsVisible="{Binding WarningMessageVisible}" />
</Grid>
<Grid RowDefinitions="*,*,*,*" ColumnDefinitions="*,*,*">
<Grid.Styles>
@@ -13,8 +13,8 @@ public class PinLockScreen : UserControl
{
public static readonly DirectProperty<PinLockScreen, bool> IsLockedProperty =
AvaloniaProperty.RegisterDirect<PinLockScreen, bool>(nameof(IsLocked),
o => o.IsLocked,
(o, v) => o.IsLocked = v);
o => o.IsLocked,
(o, v) => o.IsLocked = v);

private bool _isLocked;

@@ -36,6 +36,11 @@ public PinLockScreen() : base()
.Subscribe(x => inputField.Focus());
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}

protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
@@ -52,10 +57,5 @@ protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
inputField.Focus();
});
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
@@ -1,120 +1,115 @@
<lockscreen:SlideLockScreen xmlns="https://github.com/avaloniaui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" IsLocked="{Binding IsLocked}" Offset="{Binding Offset}">

<lockscreen:SlideLockScreen.Clock>
<Clock />
</lockscreen:SlideLockScreen.Clock>
<lockscreen:SlideLockScreen.Styles>
<Styles>
<Styles.Resources>
<Template x:Key="Chevron">
<Path Stretch="Uniform" Fill="{DynamicResource ThemeForegroundBrush}" Data="M 478.97852 464.25977
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
IsLocked="{Binding IsLocked}"
Offset="{Binding Offset}">
<lockscreen:SlideLockScreen.Clock>
<Clock />
</lockscreen:SlideLockScreen.Clock>
<lockscreen:SlideLockScreen.Styles>
<Styles>
<Styles.Resources>
<Template x:Key="Chevron">
<Path Stretch="Uniform" Fill="{DynamicResource ThemeForegroundBrush}" Data="M 478.97852 464.25977
L 446.12109 470.33203
L 446.12109 478.72461
L 478.97852 472.65234
L 511.83398 478.72461
L 511.83398 470.33203
L 478.97852 464.25977 z " />
</Template>
</Styles.Resources>

<Style Selector="Border.Chevron">
<Setter Property="Width" Value="103" />
<Setter Property="Height" Value="50" />
<Setter Property="Child" Value="{StaticResource Chevron}" />
</Style>

<Style Selector="Grid[IsVisible=true] Border.Chev1">
<Style.Animations>
<Animation Duration="0:0:1.5" Easing="QuarticEaseInOut" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="100" />
</KeyFrame>
<KeyFrame Cue="90%">
<Setter Property="Opacity" Value="{Binding #Shade.Opacity}" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>

<Style Selector="Grid[IsVisible=true] Border.Chev2">
<Style.Animations>
<Animation Delay="0:0:0.3" Duration="0:0:1.5" Easing="QuarticEaseInOut" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="100" />
</KeyFrame>
<KeyFrame Cue="90%">
<Setter Property="Opacity" Value="{Binding #Shade.Opacity}" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>

<Style Selector="Grid[IsVisible=true] Border.Chev3">
<Style.Animations>
<Animation Delay="0:0:0.6" Duration="0:0:1.5" Easing="QuarticEaseInOut" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="100" />
</KeyFrame>
<KeyFrame Cue="90%">
<Setter Property="Opacity" Value="{Binding #Shade.Opacity}" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>

<Style Selector="lockscreen|SlideLockScreen.statechanged">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:1.5" Easing="QuarticEaseInOut">
<KeyFrame Cue="0%">
<Setter Property="DoneAnimating" Value="False" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="{Binding TargetOpacity}" />
<Setter Property="Offset" Value="{Binding TargetOffset}" />
<Setter Property="DoneAnimating" Value="True" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
</Styles>
</lockscreen:SlideLockScreen.Styles>
<Grid>
<Grid x:Name="Shade" Background="{DynamicResource ThemeBackgroundBrush}">
<Grid IsVisible="{Binding IsUserDragging}" VerticalAlignment="Center" HorizontalAlignment="Center">
<Border Classes="Chevron Chev1" />
<Border Classes="Chevron Chev2" />
<Border Classes="Chevron Chev3" />
</Grid>
<Grid VerticalAlignment="Bottom" HorizontalAlignment="Center">
<Border Classes="Chevron" Opacity="0.4" />
</Grid>
</Grid>
<Thumb x:Name="PART_DragThumb">
<Thumb.Template>
<ControlTemplate>
<Border Background="Transparent" />
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Template>
</Styles.Resources>
<Style Selector="Border.Chevron">
<Setter Property="Width" Value="103" />
<Setter Property="Height" Value="50" />
<Setter Property="Child" Value="{StaticResource Chevron}" />
</Style>
<Style Selector="Grid[IsVisible=true] Border.Chev1">
<Style.Animations>
<Animation Duration="0:0:1.5" Easing="QuarticEaseInOut" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="100" />
</KeyFrame>
<KeyFrame Cue="90%">
<Setter Property="Opacity" Value="{Binding #Shade.Opacity}" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="Grid[IsVisible=true] Border.Chev2">
<Style.Animations>
<Animation Delay="0:0:0.3" Duration="0:0:1.5" Easing="QuarticEaseInOut" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="100" />
</KeyFrame>
<KeyFrame Cue="90%">
<Setter Property="Opacity" Value="{Binding #Shade.Opacity}" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="Grid[IsVisible=true] Border.Chev3">
<Style.Animations>
<Animation Delay="0:0:0.6" Duration="0:0:1.5" Easing="QuarticEaseInOut" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="100" />
</KeyFrame>
<KeyFrame Cue="90%">
<Setter Property="Opacity" Value="{Binding #Shade.Opacity}" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="TranslateTransform.Y" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="lockscreen|SlideLockScreen.statechanged">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:1.5" Easing="QuarticEaseInOut">
<KeyFrame Cue="0%">
<Setter Property="DoneAnimating" Value="False" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="{Binding TargetOpacity}" />
<Setter Property="Offset" Value="{Binding TargetOffset}" />
<Setter Property="DoneAnimating" Value="True" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
</Styles>
</lockscreen:SlideLockScreen.Styles>
<Grid>
<Grid x:Name="Shade" Background="{DynamicResource ThemeBackgroundBrush}">
<Grid IsVisible="{Binding IsUserDragging}" VerticalAlignment="Center" HorizontalAlignment="Center">
<Border Classes="Chevron Chev1" />
<Border Classes="Chevron Chev2" />
<Border Classes="Chevron Chev3" />
</Grid>
<Grid VerticalAlignment="Bottom" HorizontalAlignment="Center">
<Border Classes="Chevron" Opacity="0.4" />
</Grid>
</Grid>
<Thumb x:Name="PART_DragThumb">
<Thumb.Template>
<ControlTemplate>
<Border Background="Transparent" />
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Grid>
</lockscreen:SlideLockScreen>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.