Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
在番剧和国创页面添加我的追番按钮 (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Mar 21, 2022
1 parent 5f0b21b commit 03dcdd1
Show file tree
Hide file tree
Showing 120 changed files with 296 additions and 287 deletions.
12 changes: 6 additions & 6 deletions src/App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public sealed partial class App : Application, ILogProvider
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += this.OnSuspending;
this.UnhandledException += this.OnUnhandledException;
InitializeComponent();
Suspending += OnSuspending;
UnhandledException += OnUnhandledException;
_ = AppViewModel.Instance;
ServiceLocator.Instance.GetService<IAppToolkit>()
.InitializeTheme();
Expand Down Expand Up @@ -59,7 +59,7 @@ public void Log(LogLevel level, string message)
/// <param name="e">Detailed information about the start request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
this.OnLaunchedOrActivated(e);
OnLaunchedOrActivated(e);
}

/// <summary>
Expand All @@ -68,7 +68,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
/// <param name="args">Detailed information about the active request and process.</param>
protected override void OnActivated(IActivatedEventArgs args)
{
this.OnLaunchedOrActivated(args);
OnLaunchedOrActivated(args);
}

private void OnLaunchedOrActivated(IActivatedEventArgs e)
Expand All @@ -90,7 +90,7 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e)
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();

rootFrame.NavigationFailed += this.OnNavigationFailed;
rootFrame.NavigationFailed += OnNavigationFailed;

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
Expand Down
8 changes: 4 additions & 4 deletions src/App/Controls/App/BubbleView/Bubble.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ public Bubble(

if (size.HasValue)
{
this._size = size.Value.ToVector2();
_size = size.Value.ToVector2();
}
else
{
var maxRadius = (int)Math.Min(targetSize.Width, targetSize.Height);
if (isFill.Value)
{
this._size = new Vector2(_rnd.Next(maxRadius / 7, maxRadius / 4));
_size = new Vector2(_rnd.Next(maxRadius / 7, maxRadius / 4));
}
else
{
this._size = new Vector2(_rnd.Next(maxRadius / 6, maxRadius / 3));
_size = new Vector2(_rnd.Next(maxRadius / 6, maxRadius / 3));
}
}

Draw(isFill.Value, color);

_offset = new Vector3((float)targetSize.Width / 2, (float)targetSize.Height / 2, 0f);
_visual.Size = this._size;
_visual.Size = _size;
_visual.Offset = _offset;
_visual.Scale = Vector3.Zero;
_visual.BindCenterPoint();
Expand Down
12 changes: 6 additions & 6 deletions src/App/Controls/App/BubbleView/BubbleView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public partial class BubbleView : Control
/// </summary>
public BubbleView()
{
this.DefaultStyleKey = typeof(BubbleView);
DefaultStyleKey = typeof(BubbleView);
_foregroundPropertyChangedToken = RegisterPropertyChangedCallback(ForegroundProperty, ForegroundPropertyChanged);
this.Unloaded += OnBubbleViewUnloaded;
this.Loaded += OnBubbleViewLoaded;
Unloaded += OnBubbleViewUnloaded;
Loaded += OnBubbleViewLoaded;
}

/// <summary>
Expand Down Expand Up @@ -170,7 +170,7 @@ private void CreateBubbles()
return;
}

if (_foregroundColor != Colors.Transparent && this.ActualWidth > 0 && this.ActualHeight > 0)
if (_foregroundColor != Colors.Transparent && ActualWidth > 0 && ActualHeight > 0)
{
var count = 20;
_bubbles = new List<Bubble>();
Expand All @@ -182,7 +182,7 @@ private void CreateBubbles()
_compositor,
_canvasDevice,
_graphicsDevice,
new Size(this.ActualWidth, this.ActualHeight),
new Size(ActualWidth, ActualHeight),
_foregroundColor,
duration,
true);
Expand All @@ -196,7 +196,7 @@ private void CreateBubbles()
_compositor,
_canvasDevice,
_graphicsDevice,
new Size(this.ActualWidth, this.ActualHeight),
new Size(ActualWidth, ActualHeight),
_foregroundColor,
duration,
false);
Expand Down
68 changes: 34 additions & 34 deletions src/App/Controls/App/CardPanel/CardPanel.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,110 +70,110 @@ public partial class CardPanel
/// </summary>
public bool IsEnableHoverAnimation
{
get { return (bool)this.GetValue(IsEnableHoverAnimationProperty); }
set { this.SetValue(IsEnableHoverAnimationProperty, value); }
get { return (bool)GetValue(IsEnableHoverAnimationProperty); }
set { SetValue(IsEnableHoverAnimationProperty, value); }
}

/// <summary>
/// 是否显示阴影.
/// </summary>
public bool IsEnableShadow
{
get { return (bool)this.GetValue(IsEnableShadowProperty); }
set { this.SetValue(IsEnableShadowProperty, value); }
get { return (bool)GetValue(IsEnableShadowProperty); }
set { SetValue(IsEnableShadowProperty, value); }
}

/// <summary>
/// 是否支持选中.
/// </summary>
public bool IsEnableCheck
{
get { return (bool)this.GetValue(IsEnableCheckProperty); }
set { this.SetValue(IsEnableCheckProperty, value); }
get { return (bool)GetValue(IsEnableCheckProperty); }
set { SetValue(IsEnableCheckProperty, value); }
}

public Brush PointerOverBorderBrush
{
get { return (Brush)this.GetValue(PointerOverBorderBrushProperty); }
set { this.SetValue(PointerOverBorderBrushProperty, value); }
get { return (Brush)GetValue(PointerOverBorderBrushProperty); }
set { SetValue(PointerOverBorderBrushProperty, value); }
}

public Brush PointerOverBackground
{
get { return (Brush)this.GetValue(PointerOverBackgroundProperty); }
set { this.SetValue(PointerOverBackgroundProperty, value); }
get { return (Brush)GetValue(PointerOverBackgroundProperty); }
set { SetValue(PointerOverBackgroundProperty, value); }
}

public Brush PressedBorderBrush
{
get { return (Brush)this.GetValue(PressedBorderBrushProperty); }
set { this.SetValue(PressedBorderBrushProperty, value); }
get { return (Brush)GetValue(PressedBorderBrushProperty); }
set { SetValue(PressedBorderBrushProperty, value); }
}

public Brush PressedBackground
{
get { return (Brush)this.GetValue(PressedBackgroundProperty); }
set { this.SetValue(PressedBackgroundProperty, value); }
get { return (Brush)GetValue(PressedBackgroundProperty); }
set { SetValue(PressedBackgroundProperty, value); }
}

public Brush DisabledBorderBrush
{
get { return (Brush)this.GetValue(DisabledBorderBrushProperty); }
set { this.SetValue(DisabledBorderBrushProperty, value); }
get { return (Brush)GetValue(DisabledBorderBrushProperty); }
set { SetValue(DisabledBorderBrushProperty, value); }
}

public Brush DisabledBackground
{
get { return (Brush)this.GetValue(DisabledBackgroundProperty); }
set { this.SetValue(DisabledBackgroundProperty, value); }
get { return (Brush)GetValue(DisabledBackgroundProperty); }
set { SetValue(DisabledBackgroundProperty, value); }
}

public Brush CheckedBorderBrush
{
get { return (Brush)this.GetValue(CheckedBorderBrushProperty); }
set { this.SetValue(CheckedBorderBrushProperty, value); }
get { return (Brush)GetValue(CheckedBorderBrushProperty); }
set { SetValue(CheckedBorderBrushProperty, value); }
}

public Brush CheckedBackground
{
get { return (Brush)this.GetValue(CheckedBackgroundProperty); }
set { this.SetValue(CheckedBackgroundProperty, value); }
get { return (Brush)GetValue(CheckedBackgroundProperty); }
set { SetValue(CheckedBackgroundProperty, value); }
}

public Brush CheckedPointerOverBorderBrush
{
get { return (Brush)this.GetValue(CheckedPointerOverBorderBrushProperty); }
set { this.SetValue(CheckedPointerOverBorderBrushProperty, value); }
get { return (Brush)GetValue(CheckedPointerOverBorderBrushProperty); }
set { SetValue(CheckedPointerOverBorderBrushProperty, value); }
}

public Brush CheckedPointerOverBackground
{
get { return (Brush)this.GetValue(CheckedPointerOverBackgroundProperty); }
set { this.SetValue(CheckedPointerOverBackgroundProperty, value); }
get { return (Brush)GetValue(CheckedPointerOverBackgroundProperty); }
set { SetValue(CheckedPointerOverBackgroundProperty, value); }
}

public Brush CheckedPressedBorderBrush
{
get { return (Brush)this.GetValue(CheckedPressedBorderBrushProperty); }
set { this.SetValue(CheckedPressedBorderBrushProperty, value); }
get { return (Brush)GetValue(CheckedPressedBorderBrushProperty); }
set { SetValue(CheckedPressedBorderBrushProperty, value); }
}

public Brush CheckedPressedBackground
{
get { return (Brush)this.GetValue(CheckedPressedBackgroundProperty); }
set { this.SetValue(CheckedPressedBackgroundProperty, value); }
get { return (Brush)GetValue(CheckedPressedBackgroundProperty); }
set { SetValue(CheckedPressedBackgroundProperty, value); }
}

public Brush CheckedDisabledBorderBrush
{
get { return (Brush)this.GetValue(CheckedDisabledBorderBrushProperty); }
set { this.SetValue(CheckedDisabledBorderBrushProperty, value); }
get { return (Brush)GetValue(CheckedDisabledBorderBrushProperty); }
set { SetValue(CheckedDisabledBorderBrushProperty, value); }
}

public Brush CheckedDisabledBackground
{
get { return (Brush)this.GetValue(CheckedDisabledBackgroundProperty); }
set { this.SetValue(CheckedDisabledBackgroundProperty, value); }
get { return (Brush)GetValue(CheckedDisabledBackgroundProperty); }
set { SetValue(CheckedDisabledBackgroundProperty, value); }
}

/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions src/App/Controls/App/CardPanel/CardPanelAutomationPeer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ namespace Richasy.Bili.App.Controls
/// </summary>
public class CardPanelAutomationPeer : ToggleButtonAutomationPeer
{
private readonly CardPanel owner;
private readonly CardPanel _owner;

/// <summary>
/// Initializes a new instance of the <see cref="CardPanelAutomationPeer"/> class.
/// </summary>
/// <param name="owner">对象.</param>
public CardPanelAutomationPeer(CardPanel owner)
: base(owner) => this.owner = owner;
: base(owner) => _owner = owner;

/// <inheritdoc/>
protected override AutomationControlType GetAutomationControlTypeCore()
Expand All @@ -29,12 +29,12 @@ protected override AutomationControlType GetAutomationControlTypeCore()
/// <inheritdoc/>
protected override int GetPositionInSetCore()
{
var element = this.owner as FrameworkElement;
var parent = this.owner.Parent;
var element = _owner as FrameworkElement;
var parent = _owner.Parent;
if (!(parent is ItemsRepeater) && parent != null)
{
parent = (parent as FrameworkElement).Parent;
element = this.owner.Parent as FrameworkElement;
element = _owner.Parent as FrameworkElement;
}

return (parent as ItemsRepeater)?.GetElementIndex(element) + 1
Expand All @@ -44,7 +44,7 @@ protected override int GetPositionInSetCore()
/// <inheritdoc/>
protected override int GetSizeOfSetCore()
{
var parent = this.owner.Parent;
var parent = _owner.Parent;
if (!(parent is ItemsRepeater) && parent != null)
{
parent = (parent as FrameworkElement).Parent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class CardPanelStateChangedEventArgs : EventArgs
/// <param name="isPressed">是否处于按压状态.</param>
public CardPanelStateChangedEventArgs(bool isPointerOver, bool isPressed)
{
this.IsPointerOver = isPointerOver;
this.IsPressed = isPressed;
IsPointerOver = isPointerOver;
IsPressed = isPressed;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/App/Controls/App/CenterPopup/CenterPopup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class CenterPopup : ContentControl
/// </summary>
public CenterPopup()
{
this.DefaultStyleKey = typeof(CenterPopup);
DefaultStyleKey = typeof(CenterPopup);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/App/Controls/App/CommonImageEx/CommonImageEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class CommonImageEx : Control
public CommonImageEx()
{
DefaultStyleKey = typeof(CommonImageEx);
this.Loaded += OnLoaded;
Loaded += OnLoaded;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/App/Controls/App/ErrorPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed partial class ErrorPanel : UserControl
/// </summary>
public ErrorPanel()
{
this.InitializeComponent();
InitializeComponent();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/App/Controls/App/OffsetButton/OffsetButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class OffsetButton : Button
/// </summary>
public OffsetButton()
{
this.DefaultStyleKey = typeof(OffsetButton);
DefaultStyleKey = typeof(OffsetButton);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/App/Controls/App/OverlayLoadingPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed partial class OverlayLoadingPanel : UserControl
/// </summary>
public OverlayLoadingPanel()
{
this.InitializeComponent();
InitializeComponent();
}

/// <summary>
Expand Down
Loading

0 comments on commit 03dcdd1

Please sign in to comment.