私は、今再生している曲をスクロールした後に利用可能なプレイリストのようなGrooveを実装したいと思います。 Visual State Managerでアニメーションを使用することでこれが可能かどうか疑問に思っていますか?Grooveのようなプレイリストを作成するには
-2
A
答えて
1
これは、Visual状態マネージャでアニメーションを使用することにより可能である場合、私は疑問に思って?
ノー、それはListView
上をスライド可能なカバーのようなより多くのです怖い、私は何を行うことができますが、曲を演奏についての情報を表示するためのUserControl
を作成していると思います。
私の以前のcase hereを参照できます。そこではUserControl
を作成しましたが、これは上から下にスライドすることができますが、Groove
アプリとまったく同じではありませんが、似ていると思いますので参考にしてください。
0
@GraceFeng、あなたのソリューションは、仕事をした:)ここでは私のコードです:
XAML:
<ScrollViewer x:Name="scrollViewer" HorizontalAlignment="Stretch" ScrollViewer.VerticalScrollMode="Disabled" VerticalScrollBarVisibility="Hidden">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="VisualStateGroup">
<VisualState x:Name="SlidButtonTop">
<VisualState.Setters>
<Setter Target="SlidButtonText.Text" Value=""/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="SlidButtonBottom">
<VisualState.Setters>
<Setter Target="SlidButtonText.Text" Value=""/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border x:Name="Area1" Grid.Row="0" Height="{x:Bind childheight}" HorizontalAlignment="Stretch" Background="Transparent"
Child="{x:Bind TopContent, Mode=OneWay}"></Border>
<Grid x:Name="SlidButton" Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1"
ManipulationStarted="SlidButton_ManipulationStarted" ManipulationCompleted="SlidButton_ManipulationCompleted"
ManipulationMode="All" ManipulationDelta="SlidButton_ManipulationDelta">
<TextBlock x:Name="SlidButtonText" Text="" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontFamily="Segoe MDL2 Assets" FontSize="15" />
</Grid>
<Border x:Name="Area2" Grid.Row="2" Height="{x:Bind childheight}" HorizontalAlignment="Stretch" Background="Transparent"
Child="{x:Bind BottomContent, Mode=OneWay}"></Border>
</Grid>
</ScrollViewer>
コードの後ろに:
private double height;
private double childheight;
public SlidableControl()
{
this.InitializeComponent();
height = Window.Current.Bounds.Height * 2 - 20;
childheight = Window.Current.Bounds.Height - 20;
}
public static readonly DependencyProperty TopContentProperty = DependencyProperty.Register("TopContent", typeof(UIElement), typeof(SlidableControl), new PropertyMetadata(null));
public UIElement TopContent
{
get { return (UIElement)GetValue(TopContentProperty); }
set { SetValue(TopContentProperty, value); }
}
public static readonly DependencyProperty BottomContentProperty = DependencyProperty.Register("BottomContent", typeof(UIElement), typeof(SlidableControl), new PropertyMetadata(null));
public UIElement BottomContent
{
get { return (UIElement)GetValue(BottomContentProperty); }
set { SetValue(BottomContentProperty, value); }
}
public static readonly DependencyProperty MaxSlideHeightProperty = DependencyProperty.Register("MaxSlideHeight", typeof(double), typeof(SlidableControl), new PropertyMetadata(0.0));
public double MaxSlideHeight
{
get { return (double)GetValue(MaxSlideHeightProperty); }
set { SetValue(MaxSlideHeightProperty, value); }
}
private void SlidButton_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
{
scrollViewer.VerticalScrollMode = ScrollMode.Enabled;
}
private void SlidButton_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
{
scrollViewer.VerticalScrollMode = ScrollMode.Disabled;
}
private static double Y;
private void SlidButton_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var delta = Y + e.Delta.Translation.Y;
if (delta >= -(childheight - MaxSlideHeight))
{
Y = Y + e.Delta.Translation.Y;
}
else
{
Y = -(childheight - MaxSlideHeight);
}
if (delta < (-(childheight - MaxSlideHeight)/2))
{
VisualStateManager.GoToState(this, "SlidButtonTop", true);
}
else
{
VisualStateManager.GoToState(this, "SlidButtonBottom", true);
}
scrollViewer.ChangeView(null, -Y, null);
}
私はに2つの視覚的な状態をもを追加しましたSlidが上か下かにかかわらずSlidButtonアイコンを変更します。
ありがとうございます。
関連する問題
- 1. ListViewとGrooveのような速いリターンヘッダー
- 2. RealPlayerのプレイリストを作成するにはどうすればよいですか?
- 3. Spotifyプレイリストのカスタムビューを作成
- 4. iTunesのような(プレイリスト、ライブラリ)左側の(折りたたみ可能な)ナビゲーションバーを作成するには?
- 5. プレイリスト/異なる帯域幅のffmpegを作成するにはどうすればよいですか?
- 6. コードでプレイリストを作成する
- 7. Youtubeのプレイリストのような一意のIDを生成する - PHP
- 8. あなたのAndroidのアクティビティでyoutubeリンクのプレイリストを作成する方法は?
- 9. シェルスクリプトを使用してMPlayerプレイリストを作成するにはどうすればよいですか?
- 10. プレイリストの作成にscope = playlist-modify-privateは不要です
- 11. C#メディアプレーヤーでプレイリストを作成する方法は?
- 12. Tumblr Post内に埋め込みプレイリストを作成する
- 13. 1つのPHPファイルと複数のメディアファイルでプレイリストを作成するには?
- 14. iPhoneのようなAndroidのようなバックグラウンドサービスを作成するには?
- 15. ストレージからmp3ファイルのプレイリストを作成する方法
- 16. 自分のメディアライブラリからプレイリストを作成する
- 17. Web2py:データベース上にプレイリスト構造を作成して表示するには
- 18. どのようにviberのようなアプリケーションを作成するには?
- 19. クラスライブラリ内にウィンドウ(ダイアログのような)を作成するには?
- 20. どのような技術をリアルタイムアプリケーションを作成するには?
- 21. GWTのデスクトップアプリケーションのようなアプリケーションレイアウトを作成するには?
- 22. MotorolaのTaskManagerのようなカスタムチェックボックスを作成するには?
- 23. SwiftのInstagramのようなプロファイルページを作成するには
- 24. 地元のiTunesプレイリストと同じトラックで、クラウドベースのSpotifyプレイリストを作成するにはどうすればいいですか?
- 25. Jqueryを使用して簡単なHTMLプレイリストを作成する方法
- 26. BestBuy Appのようなカスタムナビゲーションバーを作成するには?
- 27. OpenFileDialogのようなコントロールを作成するには?
- 28. このようなビューを作成するには
- 29. Twitterのようなプロファイルレイアウトを作成するには?
- 30. Goで辞書のようなPythonを作成するには?
Thanks Grace。私はあなたのアプローチをチェックし、結果をここに示します。 –
@ArturLipski、楽しみにしています;) –