Skip to content

Commit

Permalink
Put control's style and brushes to Style folder;
Browse files Browse the repository at this point in the history
Rmove unused namespace reference
  • Loading branch information
cjw1115 committed Jul 21, 2020
1 parent f3d6db3 commit c0b5ddb
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 327 deletions.
2 changes: 1 addition & 1 deletion AilianBT/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles/Brushes.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/Buttons.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/ItemsControls.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/InputControls.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/Buttons.xaml" />
</ResourceDictionary.MergedDictionaries>

<vm:ViewModelLocator x:Key="Locator" />
Expand Down
15 changes: 14 additions & 1 deletion AilianBT/Styles/Brushes.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:effects="using:AilianBT.Effects">
<!-- 整体主色调,适用于大标题背景,小标题前景 -->
<SolidColorBrush x:Name="AilianBtMainColor" Color="#FFE777AB" />
<SolidColorBrush x:Key="AilinaBtItemHoverColor" Color="#FFE7ADC8" />
Expand All @@ -19,4 +21,15 @@
FallbackColor="#FFF2F2F2"
TintOpacity="0.7" />
<SolidColorBrush x:Key="NavigationItemHoverBrush" Color="#44A5A5A5" />

<!-- Used by player view -->
<effects:MyRevealBorderBrush x:Key="NextRevealBorderBrush" Color="#118A8781" />
<effects:MyRevealBorderBrush x:Key="PlayRevealBorderBrush" Color="#33FFFFFF" />
<effects:MyRevealBorderBrush x:Key="RevealBackgroundBrush" Color="Transparent" />
<AcrylicBrush x:Key="AcrylicBackgroundBrush"
BackgroundSource="HostBackdrop"
FallbackColor="#8A8781"
TintColor="#8A8781"
TintOpacity="0.6" />
<effects:MyRevealBorderBrush x:Key="ProgressRevealTrackBrush" Color="#33FFFFFF" />
</ResourceDictionary>
305 changes: 226 additions & 79 deletions AilianBT/Styles/Buttons.xaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion AilianBT/ViewModels/MusicVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ private async Task _preparePlaylist()
}
}


public void ItemClicked(MusicModel model)
{
PlayerVM.PlayClicked();
Expand Down
5 changes: 2 additions & 3 deletions AilianBT/ViewModels/PlayerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
using AilianBT.Models;
using AilianBT.Services;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System;
using System.Threading.Tasks;

Expand Down Expand Up @@ -117,6 +115,7 @@ public double PlaybackProgress
}
#endregion

#region Playback control actions
public async void PlayClicked()
{
if (_musicList.Count <= 0 || CurrentIndex == -1)
Expand Down Expand Up @@ -183,9 +182,9 @@ public async void Seek(double targetProgress)
var targetPosition = targetProgress * CurrentMusic.Length;
await _musicManager.Seek(targetPosition);
}
#endregion

#region Manager events

private void _musicManagerMediaLoaded(MusicModel model)
{
SynchronizationContext.Post((o) =>
Expand Down
237 changes: 0 additions & 237 deletions AilianBT/Views/Controls/PlayerView.xaml

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions AilianBT/Views/Controls/PlayerView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
using Windows.UI.Xaml.Hosting;
using Windows.UI.Xaml.Input;

// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

namespace AilianBT.Views.Controls
{
public sealed partial class PlayerView : UserControl
{
private PlayerViewModel _playerVM;

private SynchronizationContext SynchronizationContext = SynchronizationContext.Current;

public PlayerView()
Expand All @@ -29,6 +26,7 @@ public PlayerView()
private bool _isScrollable = false;
private Visual _scrollableVisual = null;
private Timer _panelSizeChangedTimer = null;

private void _initPlayerTitleAnimationResources()
{
_scrollableVisual = ElementCompositionPreview.GetElementVisual(panelScrollPlayerTitle);
Expand Down
1 change: 0 additions & 1 deletion AilianBT/Views/MusicView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>

<ListView x:Name="list_music"
Grid.Row="0"
Grid.ColumnSpan="3"
Expand Down
2 changes: 1 addition & 1 deletion AilianBT/Views/MusicView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public MusicView()
this.InitializeComponent();
this.Loaded += _musicViewLoaded;
}

private void _musicViewLoaded(object sender, RoutedEventArgs e)
{
MusicVM.Load();
Expand Down

0 comments on commit c0b5ddb

Please sign in to comment.