完成事件
This commit is contained in:
parent
9a646dbb3c
commit
fb1707bff7
@ -15,6 +15,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using Wpf_AiSportsMicrospace.Common;
|
using Wpf_AiSportsMicrospace.Common;
|
||||||
using Wpf_AiSportsMicrospace.MyUserControl;
|
using Wpf_AiSportsMicrospace.MyUserControl;
|
||||||
|
using Yunzhi.Database;
|
||||||
using Yztob.AiSports.Inferences.Abstractions;
|
using Yztob.AiSports.Inferences.Abstractions;
|
||||||
using Yztob.AiSports.Postures;
|
using Yztob.AiSports.Postures;
|
||||||
using Yztob.AiSports.Postures.Abstractions;
|
using Yztob.AiSports.Postures.Abstractions;
|
||||||
@ -66,11 +67,12 @@ namespace Wpf_AiSportsMicrospace
|
|||||||
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "1.jpg")) });
|
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "1.jpg")) });
|
||||||
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "2.jpg")) });
|
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "2.jpg")) });
|
||||||
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "3.jpg")) });
|
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "3.jpg")) });
|
||||||
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "4.jpg")) });
|
|
||||||
coverFlow.Images.Add(new CoverFlowItem { ImageUri = new Uri(Path.Combine(albumPath, "5.jpg")) });
|
|
||||||
|
|
||||||
// 默认选中第3张
|
// 默认选中第3张
|
||||||
coverFlow.SelectedIndex = 2;
|
coverFlow.SelectedIndex = 2;
|
||||||
|
|
||||||
|
// 监听进度条完成事件
|
||||||
|
coverFlow.ProgressCompleted += CoverFlow_ProgressCompleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
@ -88,6 +90,26 @@ namespace Wpf_AiSportsMicrospace
|
|||||||
StartFrameProcessing();
|
StartFrameProcessing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CoverFlow_ProgressCompleted(CoverFlowItem item)
|
||||||
|
{
|
||||||
|
// 根据不同图片跳转不同页面
|
||||||
|
if (item.ImageUri.ToString().EndsWith("1.jpg"))
|
||||||
|
{
|
||||||
|
// 跳转到页面1
|
||||||
|
MessageBox.Show("1.jpg");
|
||||||
|
}
|
||||||
|
else if (item.ImageUri.ToString().EndsWith("2.jpg"))
|
||||||
|
{
|
||||||
|
// 跳转到页面2
|
||||||
|
MessageBox.Show("2.jpg");
|
||||||
|
}
|
||||||
|
else if (item.ImageUri.ToString().EndsWith("3.jpg"))
|
||||||
|
{
|
||||||
|
// 跳转到页面3
|
||||||
|
MessageBox.Show("3.jpg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void StartFrameProcessing()
|
private void StartFrameProcessing()
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
|
|||||||
@ -26,6 +26,8 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class CoverFlowControl1 : UserControl
|
public partial class CoverFlowControl1 : UserControl
|
||||||
{
|
{
|
||||||
|
// 新增事件:进度条完成
|
||||||
|
public event Action<CoverFlowItem> ProgressCompleted;
|
||||||
public ObservableCollection<CoverFlowItem> Images { get; set; } = new ObservableCollection<CoverFlowItem>();
|
public ObservableCollection<CoverFlowItem> Images { get; set; } = new ObservableCollection<CoverFlowItem>();
|
||||||
private int _selectedIndex = 0;
|
private int _selectedIndex = 0;
|
||||||
|
|
||||||
@ -113,6 +115,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ProgressCompleted?.Invoke(_currentItem);
|
||||||
// 停止动画
|
// 停止动画
|
||||||
StopProgress();
|
StopProgress();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user