Commit f8f09504 by liulongfei

版子制作

parent 31a82455
...@@ -16,11 +16,6 @@ namespace VIZ.TVP.Golf.Domain ...@@ -16,11 +16,6 @@ namespace VIZ.TVP.Golf.Domain
// ==================================================================================== // ====================================================================================
/// <summary> /// <summary>
/// 赛事信息视图
/// </summary>
public const string TournamentInfoView = "TournamentInfoView";
/// <summary>
/// 洞列表视图 /// 洞列表视图
/// </summary> /// </summary>
public const string HoleListView = "HoleListView"; public const string HoleListView = "HoleListView";
...@@ -40,9 +35,30 @@ namespace VIZ.TVP.Golf.Domain ...@@ -40,9 +35,30 @@ namespace VIZ.TVP.Golf.Domain
// ==================================================================================== // ====================================================================================
/// <summary> /// <summary>
/// 队伍信息
/// </summary>
public const string TeamInfoView = "TeamInfoView";
/// <summary>
/// 组信息
/// </summary>
public const string GroupInfoView = "GroupInfoView";
/// <summary>
/// 冠军版
/// </summary>
public const string ChampionView = "ChampionView";
/// <summary>
/// 人名条 /// 人名条
/// </summary> /// </summary>
public const string NameBar = "NameBar"; public const string NameBarView = "NameBarView";
/// <summary>
/// 底部人名条
/// </summary>
public const string NameBarBottomView = "NameBarBottomView";
/// <summary> /// <summary>
/// 底部洞信息版 /// 底部洞信息版
...@@ -50,6 +66,11 @@ namespace VIZ.TVP.Golf.Domain ...@@ -50,6 +66,11 @@ namespace VIZ.TVP.Golf.Domain
public const string BottomHoleInfoView = "BottomHoleInfoView"; public const string BottomHoleInfoView = "BottomHoleInfoView";
/// <summary> /// <summary>
/// 底部队伍信息
/// </summary>
public const string BottomTeamInfoView = "BottomTeamInfoView";
/// <summary>
/// 底部信息版 /// 底部信息版
/// </summary> /// </summary>
public const string BottomInformationView = "BottomInformationView"; public const string BottomInformationView = "BottomInformationView";
......
...@@ -67,5 +67,16 @@ namespace VIZ.TVP.Golf.Domain ...@@ -67,5 +67,16 @@ namespace VIZ.TVP.Golf.Domain
} }
#endregion #endregion
/// <summary>
/// 从球员信息模型中获取数据
/// </summary>
/// <param name="model">球员信息模型</param>
public void FromTeamInfo(PlayerInfoModel model)
{
this.PlayerID = model.PlayerID;
this.Name = model.Name;
this.HalfPicture = model.HalfPicture;
}
} }
} }
...@@ -32,6 +32,11 @@ namespace VIZ.TVP.Golf.Domain ...@@ -32,6 +32,11 @@ namespace VIZ.TVP.Golf.Domain
/// 分组集合 /// 分组集合
/// </summary> /// </summary>
public static ObservableCollection<string> Groups { get; set; } = new ObservableCollection<string>(); public static ObservableCollection<string> Groups { get; set; } = new ObservableCollection<string>();
/// <summary>
/// 描述信息结合
/// </summary>
public static ObservableCollection<string> Details { get; set; } = new ObservableCollection<string>();
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 赛事信息控制器
/// </summary>
public class TournamentInfoController
{
/// <summary>
/// 赛事信息控制器
/// </summary>
/// <param name="support">支持</param>
public TournamentInfoController(ITournamentInfoSupport support)
{
this.Support = support;
}
/// <summary>
/// 支持
/// </summary>
public ITournamentInfoSupport Support { get; private set; }
/// <summary>
/// 将数据保存值数据库
/// </summary>
public void SaveToDB()
{
lock (ApplicationDomainEx.TournamentInfo)
{
ApplicationDomainEx.LiteDBContext.TournamentInfos.Upsert(ApplicationDomainEx.TournamentInfo.Entity);
}
}
/// <summary>
/// 从数据库中加载数据
/// </summary>
public void LoadFromDB()
{
TournamentInfo entity = ApplicationDomainEx.LiteDBContext.TournamentInfos.FindAll().FirstOrDefault();
if (ApplicationDomainEx.TournamentInfo == null)
{
ApplicationDomainEx.TournamentInfo = new TournamentInfoModel();
ApplicationDomainEx.TournamentInfo.Entity = entity;
}
ApplicationDomainEx.TournamentInfo.UpdatePropertyFromEntity();
}
}
}
\ No newline at end of file
<UserControl x:Class="VIZ.TVP.Golf.Module.TournamentInfoView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
d:DataContext="{d:DesignInstance Type=local:TournamentInfoViewModel}"
mc:Ignorable="d"
d:Background="White"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 操作项 -->
<Border BorderBrush="#44000000" BorderThickness="1" Background="#66b6f2e3" Margin="5" Padding="5">
<StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/save_16x16.png"
Content="保存"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 内容 -->
<Border Grid.Row="1" BorderBrush="#44000000" BorderThickness="1" Margin="5" Padding="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="120"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="400"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 赛事ID -->
<TextBlock Text="赛事ID:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"></TextBlock>
<toolkit:IntegerUpDown Grid.Column="1" Height="30"></toolkit:IntegerUpDown>
<!-- 赛事名称 -->
<TextBlock Text="赛事名称:" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0"
Grid.Row="1"></TextBlock>
<TextBox Grid.Row="1" Grid.Column="1" Height="120" Padding="3" AcceptsReturn="True"></TextBox>
</Grid>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 赛事信息视图模型
/// </summary>
public class TournamentInfoViewModel : ViewModelBase
{
#region TournamentID -- 赛事ID
private int tournamentID;
/// <summary>
/// 赛事ID
/// </summary>
public int TournamentID
{
get { return tournamentID; }
set { tournamentID = value; this.RaisePropertyChanged(nameof(TournamentID)); }
}
#endregion
#region TournamentName -- 赛事名称
private string tournamentName;
/// <summary>
/// 赛事名称
/// </summary>
public string TournamentName
{
get { return tournamentName; }
set { tournamentName = value; this.RaisePropertyChanged(nameof(TournamentName)); }
}
#endregion
}
}
...@@ -42,8 +42,6 @@ ...@@ -42,8 +42,6 @@
<Border Background="#ff4d449f" Height="40"> <Border Background="#ff4d449f" Height="40">
<TextBlock Text="数据准备" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white"></TextBlock> <TextBlock Text="数据准备" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white"></TextBlock>
</Border> </Border>
<RadioButton x:Name="rb_TournamentInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="赛事信息" IsChecked="True"></RadioButton>
<RadioButton x:Name="rb_HoleListView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_HoleListView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="洞信息"></RadioButton> Content="洞信息"></RadioButton>
<RadioButton x:Name="rb_TeamListView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_TeamListView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
...@@ -56,8 +54,17 @@ ...@@ -56,8 +54,17 @@
<Border Background="#ff4d449f" Height="40"> <Border Background="#ff4d449f" Height="40">
<TextBlock Text="包装" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"></TextBlock> <TextBlock Text="包装" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"></TextBlock>
</Border> </Border>
<RadioButton x:Name="rb_TeamInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="队伍信息"></RadioButton>
<RadioButton x:Name="rb_GroupInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="小组信息"></RadioButton>
<RadioButton x:Name="rb_ChampionView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="冠军版"></RadioButton>
<RadioButton x:Name="rb_NameBarView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_NameBarView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="人名条"></RadioButton> Content="人名条"></RadioButton>
<RadioButton x:Name="rb_NameBarBottomView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部人名条"></RadioButton>
<RadioButton x:Name="rb_BottomHoleInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_BottomHoleInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部洞信息版"></RadioButton> Content="底部洞信息版"></RadioButton>
<RadioButton x:Name="rb_BottomInformationView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_BottomInformationView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
...@@ -73,17 +80,25 @@ ...@@ -73,17 +80,25 @@
<Border Padding="5" Margin="5" BorderBrush="#44000000" BorderThickness="1" Grid.Column="1"> <Border Padding="5" Margin="5" BorderBrush="#44000000" BorderThickness="1" Grid.Column="1">
<fcommon:NavigationControl> <fcommon:NavigationControl>
<!-- 数据准备 --> <!-- 数据准备 -->
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.TournamentInfoView}" ViewType="{x:Type local:TournamentInfoView}"
IsSelected="{Binding ElementName=rb_TournamentInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.HoleListView}" ViewType="{x:Type local:HoleListView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.HoleListView}" ViewType="{x:Type local:HoleListView}"
IsSelected="{Binding ElementName=rb_HoleListView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_HoleListView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.TeamListView}" ViewType="{x:Type local:TeamListView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.TeamListView}" ViewType="{x:Type local:TeamListView}"
IsSelected="{Binding ElementName=rb_TeamListView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_TeamListView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.TournamentInfoView}" ViewType="{x:Type local:PlayerListView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.PlayerListView}" ViewType="{x:Type local:PlayerListView}"
IsSelected="{Binding ElementName=rb_PlayerListView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_PlayerListView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<!-- 包装 --> <!-- 包装 -->
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBar}" ViewType="{x:Type local:NameBarView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.TeamInfoView}" ViewType="{x:Type local:TeamInfoView}"
IsSelected="{Binding ElementName=rb_TeamInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.GroupInfoView}" ViewType="{x:Type local:GroupInfoView}"
IsSelected="{Binding ElementName=rb_GroupInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.ChampionView}" ViewType="{x:Type local:ChampionView}"
IsSelected="{Binding ElementName=rb_ChampionView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBarView}" ViewType="{x:Type local:NameBarView}"
IsSelected="{Binding ElementName=rb_NameBarView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_NameBarView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBarBottomView}" ViewType="{x:Type local:NameBarBottomView}"
IsSelected="{Binding ElementName=rb_NameBarBottomView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomHoleInfoView}" ViewType="{x:Type local:BottomHoleInfoView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomHoleInfoView}" ViewType="{x:Type local:BottomHoleInfoView}"
IsSelected="{Binding ElementName=rb_BottomHoleInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_BottomHoleInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomInformationView}" ViewType="{x:Type local:BottomInformationView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomInformationView}" ViewType="{x:Type local:BottomInformationView}"
......
...@@ -46,26 +46,26 @@ ...@@ -46,26 +46,26 @@
<ScrollViewer VerticalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="200"></RowDefinition> <RowDefinition Height="220"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 洞信息 --> <!-- 洞信息 -->
<GroupBox> <GroupBox Padding="10">
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="洞信息" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="洞信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:HolePickerPanel DataContext="{Binding Path=HolePickerPanelModel}"></local:HolePickerPanel> <local:HolePickerPanel DataContext="{Binding Path=HolePickerPanelModel}"></local:HolePickerPanel>
</GroupBox> </GroupBox>
<!-- 分组 1 --> <!-- 分组 1 -->
<GroupBox Grid.Row="1"> <GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:GroupPickerPanel DataContext="{Binding GroupPickerPanelModel_1}"></local:GroupPickerPanel> <local:GroupPickerPanel DataContext="{Binding GroupPickerPanelModel_1}"></local:GroupPickerPanel>
</GroupBox> </GroupBox>
<!-- 分组 2 --> <!-- 分组 2 -->
<GroupBox Grid.Row="2"> <GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
......
<UserControl x:Class="VIZ.TVP.Golf.Module.ChampionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:ChampionViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="600"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 版子操作 -->
<Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="#44000000" Background="#66b6f2e3" BorderThickness="1" Margin="5" Padding="5">
<StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/db_16x16.png"
Content="加载本地数据" Command="{Binding Path=LoadLocalDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}" Margin="5,0,0,0"
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="170"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 队伍 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="队伍" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:TeamPickerPanel DataContext="{Binding Path=TeamPickerPanelModel}"></local:TeamPickerPanel>
</GroupBox>
</Grid>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/Champion.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"></fcommon:IconButton>
</StackPanel>
</Grid>
</Border>
</Grid>
</UserControl>
...@@ -17,15 +17,15 @@ using VIZ.Framework.Core; ...@@ -17,15 +17,15 @@ using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module namespace VIZ.TVP.Golf.Module
{ {
/// <summary> /// <summary>
/// TournamentInfoView.xaml 的交互逻辑 /// ChampionView.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class TournamentInfoView : UserControl public partial class ChampionView : UserControl
{ {
public TournamentInfoView() public ChampionView()
{ {
InitializeComponent(); InitializeComponent();
WPFHelper.BindingViewModel(this, new TournamentInfoViewModel()); WPFHelper.BindingViewModel(this, new ChampionViewModel());
} }
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 冠军面板视图模型
/// </summary>
public class ChampionViewModel : PackageViewModelBase
{
public ChampionViewModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
#region TeamPickerPanelModel -- 队伍选择面板模型
private TeamPickerPanelModel teamPickerPanelModel = new TeamPickerPanelModel();
/// <summary>
/// 队伍选择面板模型
/// </summary>
public TeamPickerPanelModel TeamPickerPanelModel
{
get { return teamPickerPanelModel; }
set { teamPickerPanelModel = value; this.RaisePropertyChanged(nameof(TeamPickerPanelModel)); }
}
#endregion
#region SelectedPlayerTempModel -- 选中的球员临时模型
private PlayerTempModel selectedPlayerTempModel;
/// <summary>
/// 选中的球员临时模型
/// </summary>
public PlayerTempModel SelectedPlayerTempModel
{
get { return selectedPlayerTempModel; }
set { selectedPlayerTempModel = value; this.RaisePropertyChanged(nameof(SelectedPlayerTempModel)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
#region SendCommand -- 发送命令
/// <summary>
/// 执行发送命令
/// </summary>
protected override void Send()
{
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据
/// </summary>
protected override void LoadLocalData()
{
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据
/// </summary>
protected override void LoadRemoteData()
{
}
#endregion
}
}
<UserControl x:Class="VIZ.TVP.Golf.Module.GroupInfoView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:GroupInfoViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="600"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 版子操作 -->
<Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="#44000000" Background="#66b6f2e3" BorderThickness="1" Margin="5" Padding="5">
<StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/db_16x16.png"
Content="加载本地数据" Command="{Binding Path=LoadLocalDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}" Margin="5,0,0,0"
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="220"></RowDefinition>
<RowDefinition Height="220"></RowDefinition>
</Grid.RowDefinitions>
<!-- 队伍1 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="预设" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 预设 -->
<TextBlock Text="预设:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center" Width="240"
SelectedValue="{Binding Group,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.Groups}}">
</ComboBox>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="预设队伍" Grid.Column="1" Width="80" Height="30" Margin="5,0,0,0"
Command="{Binding PresetGroupCommand}"></fcommon:IconButton>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPaneNoPlayerModel1}"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPaneNoPlayerModel2}"></local:GroupPickerPanelNoPlayer>
</GroupBox>
</Grid>
</ScrollViewer>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/GroupInfo.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"></fcommon:IconButton>
</StackPanel>
</Grid>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// GroupInfoView.xaml 的交互逻辑
/// </summary>
public partial class GroupInfoView : UserControl
{
public GroupInfoView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new GroupInfoViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 小组信息
/// </summary>
public class GroupInfoViewModel : PackageViewModelBase
{
public GroupInfoViewModel()
{
// 初始化命令
this.InitCommnad();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommnad()
{
this.PresetGroupCommand = new VCommand(this.PresetGroup);
}
// ===================================================================================
// Property
// ===================================================================================
#region Group -- 分组
private string group;
/// <summary>
/// 分组
/// </summary>
public string Group
{
get { return group; }
set { group = value; this.RaisePropertyChanged(nameof(Group)); }
}
#endregion
#region GroupPickerPaneNoPlayerModel1 -- 分组选择面板模型1
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel1 = new GroupPickerPaneNoPlayerModel();
/// <summary>
/// 分组选择面板模型1
/// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel1
{
get { return groupPickerPaneNoPlayerModel1; }
set { groupPickerPaneNoPlayerModel1 = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel1)); }
}
#endregion
#region GroupPickerPaneNoPlayerModel2 -- 分组选择面板模型2
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel2 = new GroupPickerPaneNoPlayerModel();
/// <summary>
/// 分组选择面板模型2
/// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel2
{
get { return groupPickerPaneNoPlayerModel2; }
set { groupPickerPaneNoPlayerModel2 = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel2)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
#region SendCommand -- 发送命令
/// <summary>
/// 执行发送命令
/// </summary>
protected override void Send()
{
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据
/// </summary>
protected override void LoadLocalData()
{
RealDataWindow window = new RealDataWindow();
window.ShowDialog();
RealDataViewModel vm = window.realDataView.DataContext as RealDataViewModel;
if (vm == null)
return;
if (!vm.IsEnter)
return;
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player2, list);
this.GroupPickerPaneNoPlayerModel1.UpdatePlayersStrokes();
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player2, list);
this.GroupPickerPaneNoPlayerModel2.UpdatePlayersStrokes();
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据
/// </summary>
protected override void LoadRemoteData()
{
Task.Run(() =>
{
string fileName = this.realDataService.DownLoadData(INTERFACE_TOURNAMENT);
if (string.IsNullOrWhiteSpace(fileName))
{
MessageBox.Show("加载远程数据失败!");
return;
}
WPFHelper.BeginInvoke(() =>
{
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player2, list);
this.GroupPickerPaneNoPlayerModel1.UpdatePlayersStrokes();
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player2, list);
this.GroupPickerPaneNoPlayerModel2.UpdatePlayersStrokes();
});
});
}
#endregion
#region PresetGroupCommand -- 预设分组命令
/// <summary>
/// 预设分组命令
/// </summary>
public VCommand PresetGroupCommand { get; set; }
/// <summary>
/// 预设分组命令
/// </summary>
private void PresetGroup()
{
if (string.IsNullOrWhiteSpace(this.Group))
return;
// 根据学校进行分组
var teams = ApplicationDomainEx.PlayerInfos.Where(p => p.Group == this.Group).GroupBy(p => p.TeamID).ToList();
if (teams.Count > 0)
{
var team = teams[0];
GroupTempModel model = new GroupTempModel();
model.TeamInfo = ApplicationDomainEx.TeamInfos.FirstOrDefault(p => p.TeamID == team.Key);
foreach (var player in team)
{
model.Players.Add(player);
}
this.GroupPickerPaneNoPlayerModel1.UpdateByGroupTempModel(model);
this.GroupPickerPaneNoPlayerModel1.UpdatePlayersStrokes();
}
else
{
this.GroupPickerPaneNoPlayerModel1.ClearProperty();
this.GroupPickerPaneNoPlayerModel1.ClearPlayersStrokes();
}
if (teams.Count > 1)
{
var team = teams[1];
GroupTempModel model = new GroupTempModel();
model.TeamInfo = ApplicationDomainEx.TeamInfos.FirstOrDefault(p => p.TeamID == team.Key);
foreach (var player in team)
{
model.Players.Add(player);
}
this.GroupPickerPaneNoPlayerModel2.UpdateByGroupTempModel(model);
this.GroupPickerPaneNoPlayerModel2.UpdatePlayersStrokes();
}
else
{
this.GroupPickerPaneNoPlayerModel2.ClearProperty();
this.GroupPickerPaneNoPlayerModel2.ClearPlayersStrokes();
}
}
#endregion
}
}
<UserControl x:Class="VIZ.TVP.Golf.Module.NameBarBottomView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:NameBarBottomViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_player" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="600"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 版子操作 -->
<Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="#44000000" Background="#66b6f2e3" BorderThickness="1" Margin="5" Padding="5">
<StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/db_16x16.png"
Content="加载本地数据" Command="{Binding Path=LoadLocalDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}" Margin="5,0,0,0"
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="220"></RowDefinition>
</Grid.RowDefinitions>
<!-- 组信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPaneNoPlayerModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox>
</Grid>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/NameBarBottom.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"></fcommon:IconButton>
</StackPanel>
</Grid>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// NameBarBottomView.xaml 的交互逻辑
/// </summary>
public partial class NameBarBottomView : UserControl
{
public NameBarBottomView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new NameBarBottomViewModel());
}
}
}
...@@ -6,15 +6,19 @@ ...@@ -6,15 +6,19 @@
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module" xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common" xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:NameBarViewModel}" d:DataContext="{d:DesignInstance Type=local:NameBarViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1500"> d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary> <ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_player" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
...@@ -41,7 +45,34 @@ ...@@ -41,7 +45,34 @@
</Border> </Border>
<!-- 版子信息 --> <!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5"> <Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<local:GroupPickerPanel DataContext="{Binding GroupPickerPanelModel}" VerticalAlignment="Top"></local:GroupPickerPanel> <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="220"></RowDefinition>
<RowDefinition Height="170"></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
</Grid.RowDefinitions>
<!-- 组信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPaneNoPlayerModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<!-- 洞信息 -->
<GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header>
<TextBlock Text="洞信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:HolePickerPanelNoPicture DataContext="{Binding Path=HolePickerPanelNoPictureModel}" Grid.Row="1"></local:HolePickerPanelNoPicture>
</GroupBox>
<!-- 其他信息 -->
<GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header>
<TextBlock Text="其他信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:DetailPanel DataContext="{Binding DetailPanelModel}"></local:DetailPanel>
</GroupBox>
</Grid>
</Border> </Border>
<!-- 示意图 --> <!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5"> <Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 底部名条视图模型
/// </summary>
public class NameBarBottomViewModel : PackageViewModelBase
{
// ===================================================================================
// Property
// ===================================================================================
#region GroupPickerPaneNoPlayerModel -- 分组选择模型
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel = new GroupPickerPaneNoPlayerModel();
/// <summary>
/// 分组选择模型
/// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel
{
get { return groupPickerPaneNoPlayerModel; }
set { groupPickerPaneNoPlayerModel = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
#region SendCommand -- 发送命令
/// <summary>
/// 执行发送命令
/// </summary>
protected override void Send()
{
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据
/// </summary>
protected override void LoadLocalData()
{
RealDataWindow window = new RealDataWindow();
window.ShowDialog();
RealDataViewModel vm = window.realDataView.DataContext as RealDataViewModel;
if (vm == null)
return;
if (!vm.IsEnter)
return;
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据
/// </summary>
protected override void LoadRemoteData()
{
Task.Run(() =>
{
string fileName = this.realDataService.DownLoadData(INTERFACE_TOURNAMENT);
if (string.IsNullOrWhiteSpace(fileName))
{
MessageBox.Show("加载远程数据失败!");
return;
}
WPFHelper.BeginInvoke(() =>
{
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
});
});
}
#endregion
}
}
\ No newline at end of file
...@@ -24,16 +24,44 @@ namespace VIZ.TVP.Golf.Module ...@@ -24,16 +24,44 @@ namespace VIZ.TVP.Golf.Module
// Property // Property
// =================================================================================== // ===================================================================================
#region GroupPickerPanelModel -- 组选择面板视图模型 #region GroupPickerPaneNoPlayerModel -- 分组选择模型
private GroupPickerPanelModel groupPickerPanelModel = new GroupPickerPanelModel(); private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel = new GroupPickerPaneNoPlayerModel();
/// <summary> /// <summary>
/// 组选择面板视图模型 /// 分组选择模型
/// </summary> /// </summary>
public GroupPickerPanelModel GroupPickerPanelModel public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel
{ {
get { return groupPickerPanelModel; } get { return groupPickerPaneNoPlayerModel; }
set { groupPickerPanelModel = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); } set { groupPickerPaneNoPlayerModel = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel)); }
}
#endregion
#region HolePickerPanelNoPictureModel -- 洞选择模型
private HolePickerPanelNoPictureModel holePickerPanelNoPictureModel = new HolePickerPanelNoPictureModel();
/// <summary>
/// 洞选择模型
/// </summary>
public HolePickerPanelNoPictureModel HolePickerPanelNoPictureModel
{
get { return holePickerPanelNoPictureModel; }
set { holePickerPanelNoPictureModel = value; this.RaisePropertyChanged(nameof(HolePickerPanelNoPictureModel)); }
}
#endregion
#region DetailPanelModel -- 描述面板模型
private DetailPanelModel detailPanelModel = new DetailPanelModel();
/// <summary>
/// 描述面板模型
/// </summary>
public DetailPanelModel DetailPanelModel
{
get { return detailPanelModel; }
set { detailPanelModel = value; this.RaisePropertyChanged(nameof(DetailPanelModel)); }
} }
#endregion #endregion
...@@ -73,8 +101,10 @@ namespace VIZ.TVP.Golf.Module ...@@ -73,8 +101,10 @@ namespace VIZ.TVP.Golf.Module
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
} }
#endregion #endregion
...@@ -101,8 +131,10 @@ namespace VIZ.TVP.Golf.Module ...@@ -101,8 +131,10 @@ namespace VIZ.TVP.Golf.Module
{ {
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
}); });
}); });
} }
......
<UserControl x:Class="VIZ.TVP.Golf.Module.TeamInfoView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:TeamInfoViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="600"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 版子操作 -->
<Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="#44000000" Background="#66b6f2e3" BorderThickness="1" Margin="5" Padding="5">
<StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/add_16x16.png"
Content="添加队员" Command="{Binding AddPlayerCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}" Margin="5,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/delete_16x16.png"
Content="删除队员" Command="{Binding Path=RemovePlayerCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="170"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 队伍 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="队伍" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:TeamPickerPanel DataContext="{Binding Path=TeamPickerPanelModel}"></local:TeamPickerPanel>
</GroupBox>
<GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header>
<TextBlock Text="队员" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 队员信息列表 -->
<DataGrid AutoGenerateColumns="False" Margin="0,0,5,0" CanUserAddRows="False" CanUserDeleteRows="False"
Grid.Row="1" CanUserSortColumns="False"
ItemsSource="{Binding Path=TeamPickerPanelModel.PlayerTempModels,Mode=OneWay}" FontSize="14"
SelectedValue="{Binding Path=SelectedPlayerTempModel,Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn Header="姓名" Width="200" Binding="{Binding Path=Name,Mode=TwoWay}"></DataGridTextColumn>
<DataGridComboBoxColumn Header="照片" Width="200"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.PlayerPictures}}"
SelectedValueBinding="{Binding Path=HalfPicture}"></DataGridComboBoxColumn>
</DataGrid.Columns>
</DataGrid>
<!-- 照片 -->
<Grid Grid.Column="1" Grid.Row="1" Margin="5,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
</Grid.RowDefinitions>
<Border BorderBrush="#44000000" BorderThickness="1">
<Image Source="{Binding SelectedPlayerTempModel.HalfPicture,Converter={StaticResource String2ImageSourceConverter}}"></Image>
</Border>
</Grid>
</Grid>
</GroupBox>
</Grid>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/TeamInfo.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"></fcommon:IconButton>
</StackPanel>
</Grid>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// TeamInfoView.xaml 的交互逻辑
/// </summary>
public partial class TeamInfoView : UserControl
{
public TeamInfoView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new TeamInfoViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 队伍信息
/// </summary>
public class TeamInfoViewModel : PackageViewModelBase
{
public TeamInfoViewModel()
{
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.AddPlayerCommand = new VCommand(this.AddPlayer);
this.RemovePlayerCommand = new VCommand(this.RemovePlayer);
}
// ===================================================================================
// Property
// ===================================================================================
#region TeamPickerPanelModel -- 队伍选择面板模型
private TeamPickerPanelModel teamPickerPanelModel = new TeamPickerPanelModel();
/// <summary>
/// 队伍选择面板模型
/// </summary>
public TeamPickerPanelModel TeamPickerPanelModel
{
get { return teamPickerPanelModel; }
set { teamPickerPanelModel = value; this.RaisePropertyChanged(nameof(TeamPickerPanelModel)); }
}
#endregion
#region SelectedPlayerTempModel -- 选中的球员临时模型
private PlayerTempModel selectedPlayerTempModel;
/// <summary>
/// 选中的球员临时模型
/// </summary>
public PlayerTempModel SelectedPlayerTempModel
{
get { return selectedPlayerTempModel; }
set { selectedPlayerTempModel = value; this.RaisePropertyChanged(nameof(SelectedPlayerTempModel)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
#region SendCommand -- 发送命令
/// <summary>
/// 执行发送命令
/// </summary>
protected override void Send()
{
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据
/// </summary>
protected override void LoadLocalData()
{
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据
/// </summary>
protected override void LoadRemoteData()
{
}
#endregion
#region AddPlayerCommand -- 添加队员命令
/// <summary>
/// 添加队员命令
/// </summary>
public VCommand AddPlayerCommand { get; set; }
/// <summary>
/// 添加队员
/// </summary>
private void AddPlayer()
{
PlayerTempModel model = new PlayerTempModel();
this.TeamPickerPanelModel.PlayerTempModels.Add(model);
}
#endregion
#region RemovePlayerCommand -- 移除队员命令
/// <summary>
/// 移除队员命令
/// </summary>
public VCommand RemovePlayerCommand { get; set; }
/// <summary>
/// 移除队员
/// </summary>
private void RemovePlayer()
{
if (this.SelectedPlayerTempModel == null)
return;
this.TeamPickerPanelModel.PlayerTempModels.Remove(this.SelectedPlayerTempModel);
}
#endregion
}
}
...@@ -47,6 +47,9 @@ namespace VIZ.TVP.Golf.Module ...@@ -47,6 +47,9 @@ namespace VIZ.TVP.Golf.Module
// 初始化分组信息 // 初始化分组信息
this.InitGroups(); this.InitGroups();
// 初始化描述信息
this.InitDetails();
return true; return true;
} }
...@@ -116,12 +119,26 @@ namespace VIZ.TVP.Golf.Module ...@@ -116,12 +119,26 @@ namespace VIZ.TVP.Golf.Module
private void InitGroups() private void InitGroups()
{ {
ObservableCollection<string> groups = new ObservableCollection<string>(); ObservableCollection<string> groups = new ObservableCollection<string>();
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 18; i++)
{ {
groups.Add(i.ToString()); groups.Add(i.ToString());
} }
TvpStaticResource.Groups = groups; TvpStaticResource.Groups = groups;
} }
/// <summary>
/// 初始化秒速信息
/// </summary>
private void InitDetails()
{
ObservableCollection<string> details = new ObservableCollection<string>();
for (int i = 1; i <= 10; i++)
{
details.Add($"Detail {i}");
}
TvpStaticResource.Details = details;
}
} }
} }
\ No newline at end of file
...@@ -93,10 +93,38 @@ ...@@ -93,10 +93,38 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Package\Champion\View\ChampionView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Package\GroupInfo\View\GroupInfoView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Package\TeamInfo\View\TeamInfoView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Package\NameBar\View\NameBarBottomView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Widgets\Detail\DetailPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Package\NameBar\View\NameBarView.xaml"> <Page Include="Package\NameBar\View\NameBarView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Widgets\Hole\HolePickerPanelNoPicture.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Widgets\RealData\RealDataWindow.xaml"> <Page Include="Widgets\RealData\RealDataWindow.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -153,21 +181,53 @@ ...@@ -153,21 +181,53 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Information\Tournament\View\TournamentInfoView.xaml"> <Page Include="Widgets\Group\GroupPickerWindow.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Widgets\Group\GroupPickerWindow.xaml"> <Page Include="Widgets\Team\TeamPickerPanelNoLogo.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page>
<Page Include="Widgets\Team\TeamPickerPanel.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Package\Champion\ViewModel\ChampionViewModel.cs" />
<Compile Include="Package\Champion\View\ChampionView.xaml.cs">
<DependentUpon>ChampionView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\GroupInfo\ViewModel\GroupInfoViewModel.cs" />
<Compile Include="Package\GroupInfo\View\GroupInfoView.xaml.cs">
<DependentUpon>GroupInfoView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\TeamInfo\ViewModel\TeamInfoViewModel.cs" />
<Compile Include="Package\TeamInfo\View\TeamInfoView.xaml.cs">
<DependentUpon>TeamInfoView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\NameBar\ViewModel\NameBarBottomViewModel.cs" />
<Compile Include="Package\NameBar\View\NameBarBottomView.xaml.cs">
<DependentUpon>NameBarBottomView.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Detail\DetailPanel.xaml.cs">
<DependentUpon>DetailPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Package\NameBar\ViewModel\NameBarViewModel.cs" /> <Compile Include="Package\NameBar\ViewModel\NameBarViewModel.cs" />
<Compile Include="Package\NameBar\View\NameBarView.xaml.cs"> <Compile Include="Package\NameBar\View\NameBarView.xaml.cs">
<DependentUpon>NameBarView.xaml</DependentUpon> <DependentUpon>NameBarView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Setup\Provider\Setup\AppSetup_ClearLocalData.cs" /> <Compile Include="Setup\Provider\Setup\AppSetup_ClearLocalData.cs" />
<Compile Include="Widgets\Detail\DetailPanelModel.cs" />
<Compile Include="Widgets\Group\GroupPickerPaneNoPlayerModel.cs" />
<Compile Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml.cs">
<DependentUpon>GroupPickerPanelNoPlayer.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Hole\HolePickerPanelNoPicture.xaml.cs">
<DependentUpon>HolePickerPanelNoPicture.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Hole\HolePickerPanelNoPictureModel.cs" />
<Compile Include="Widgets\RealData\RealDataWindow.xaml.cs"> <Compile Include="Widgets\RealData\RealDataWindow.xaml.cs">
<DependentUpon>RealDataWindow.xaml</DependentUpon> <DependentUpon>RealDataWindow.xaml</DependentUpon>
</Compile> </Compile>
...@@ -198,9 +258,6 @@ ...@@ -198,9 +258,6 @@
<Compile Include="Information\Hole\View\HoleListView.xaml.cs"> <Compile Include="Information\Hole\View\HoleListView.xaml.cs">
<DependentUpon>HoleListView.xaml</DependentUpon> <DependentUpon>HoleListView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Information\Tournament\Controller\ITournamentInfoSupport.cs" />
<Compile Include="Information\Tournament\Controller\TournamentInfoController.cs" />
<Compile Include="Information\Tournament\ViewModel\TournamentInfoViewModel.cs" />
<Compile Include="Main\ViewModel\MainViewModel.cs" /> <Compile Include="Main\ViewModel\MainViewModel.cs" />
<Compile Include="Main\View\MainView.xaml.cs"> <Compile Include="Main\View\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon> <DependentUpon>MainView.xaml</DependentUpon>
...@@ -241,15 +298,20 @@ ...@@ -241,15 +298,20 @@
<Compile Include="Information\Team\View\TeamListView.xaml.cs"> <Compile Include="Information\Team\View\TeamListView.xaml.cs">
<DependentUpon>TeamListView.xaml</DependentUpon> <DependentUpon>TeamListView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Information\Tournament\View\TournamentInfoView.xaml.cs">
<DependentUpon>TournamentInfoView.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Group\GroupPickerViewModel.cs" /> <Compile Include="Widgets\Group\GroupPickerViewModel.cs" />
<Compile Include="Widgets\Group\GroupPickerWindow.xaml.cs"> <Compile Include="Widgets\Group\GroupPickerWindow.xaml.cs">
<DependentUpon>GroupPickerWindow.xaml</DependentUpon> <DependentUpon>GroupPickerWindow.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Widgets\Hole\HolePickerPanelModel.cs" /> <Compile Include="Widgets\Hole\HolePickerPanelModel.cs" />
<Compile Include="Widgets\RealData\RealDataViewModel.cs" /> <Compile Include="Widgets\RealData\RealDataViewModel.cs" />
<Compile Include="Widgets\Team\TeamPickerPanelNoLogoModel.cs" />
<Compile Include="Widgets\Team\TeamPickerPanelNoLogo.xaml.cs">
<DependentUpon>TeamPickerPanelNoLogo.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Team\TeamPickerPanel.xaml.cs">
<DependentUpon>TeamPickerPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Team\TeamPickerPanelModel.cs" />
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
......
<UserControl x:Class="VIZ.TVP.Golf.Module.DetailPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:DetailPanelModel}"
mc:Ignorable="d"
d:DesignHeight="40" d:DesignWidth="1000">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="描述:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="0"
Margin="0,0,5,0"></TextBlock>
<TextBox Grid.Row="0" Grid.Column="1" Height="30" AcceptsReturn="False" TextWrapping="NoWrap" Padding="3"
Text="{Binding Detail,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
<StackPanel Grid.Column="2" Orientation="Horizontal">
<ComboBox Grid.Column="2" Height="30" VerticalContentAlignment="Center" Margin="5,0,0,0" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.Details}}"
SelectedValue="{Binding Path=SelectedDetail,Mode=TwoWay}"></ComboBox>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="设置描述" Grid.Column="3" Width="80" Height="30" Margin="5,0,0,0"
Command="{Binding PresetDetailCommand}"></fcommon:IconButton>
</StackPanel>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// DetailPanel.xaml 的交互逻辑
/// </summary>
public partial class DetailPanel : UserControl
{
public DetailPanel()
{
InitializeComponent();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 描述面板模型
/// </summary>
public class DetailPanelModel : ModelBase
{
public DetailPanelModel()
{
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.PresetDetailCommand = new VCommand(this.PresetDetail);
}
// ===================================================================================
// Property
// ===================================================================================
#region Detail -- 描述
private string detail;
/// <summary>
/// 描述
/// </summary>
public string Detail
{
get { return detail; }
set { detail = value; this.RaisePropertyChanged(nameof(Detail)); }
}
#endregion
#region SelectedDetail -- 选中的描述
private string selectedDetail;
/// <summary>
/// 选中的描述
/// </summary>
public string SelectedDetail
{
get { return selectedDetail; }
set { selectedDetail = value; this.RaisePropertyChanged(nameof(SelectedDetail)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
#region PresetDetailCommand -- 预设描述
/// <summary>
/// 预设描述命令
/// </summary>
public VCommand PresetDetailCommand { get; set; }
/// <summary>
/// 预设描述
/// </summary>
private void PresetDetail()
{
this.Detail = this.SelectedDetail;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.HtmlControls;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 组选择面板视图模型
/// </summary>
public class GroupPickerPaneNoPlayerModel : GroupPickerPanelModel
{
/// <summary>
/// 组选择面板视图模型
/// </summary>
public GroupPickerPaneNoPlayerModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
#region PlayersDisplayName -- 组成员显示名称
private string playersDisplayName;
/// <summary>
/// 组成员显示名称
/// </summary>
public string PlayersDisplayName
{
get { return playersDisplayName; }
set { playersDisplayName = value; this.RaisePropertyChanged(nameof(PlayersDisplayName)); }
}
#endregion
#region PlayersStrokes -- 组成员杆数
private string playersStrokes;
/// <summary>
/// 组成员杆数
/// </summary>
public string PlayersStrokes
{
get { return playersStrokes; }
set { playersStrokes = value; this.RaisePropertyChanged(nameof(PlayersStrokes)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
#region SelectGroupCommand -- 选择分组命令
/// <summary>
/// 选择分组
/// </summary>
protected override void SelectGroup()
{
base.SelectGroup();
this.UpdatePlayersStrokes();
}
#endregion
// ===================================================================================
// Action
// ===================================================================================
/// <summary>
/// 更新球员总杆数
/// </summary>
public void UpdatePlayersStrokes()
{
// 组成员
StringBuilder sb = new StringBuilder();
if (this.Player1 != null)
{
sb.Append(this.Player1.Name);
}
if (this.Player2 != null)
{
sb.Append(" / ");
sb.Append(this.Player2.Name);
}
this.PlayersDisplayName = sb.ToString();
// 总杆数
int strokes = this.Player1?.Strokes ?? 0 + this.Player2?.Strokes ?? 0;
this.PlayersStrokes = strokes == 0 ? "E" : strokes > 0 ? $"+{strokes}" : $"-{strokes}";
}
/// <summary>
/// 清理球员总杆数
/// </summary>
public void ClearPlayersStrokes()
{
this.PlayersDisplayName = null;
this.PlayersStrokes = null;
}
}
}
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</Border> </Border>
</Grid> </Grid>
<!-- 球员1 --> <!-- 球员1 -->
<GroupBox Header="球员1" Margin="5" Grid.Row="2"> <GroupBox Header="球员1" Margin="5" Grid.Row="1">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition> <RowDefinition Height="40"></RowDefinition>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</Grid> </Grid>
</GroupBox> </GroupBox>
<!-- 球员2 --> <!-- 球员2 -->
<GroupBox Header="球员2" Margin="5" Grid.Row="2" Grid.Column="1"> <GroupBox Header="球员2" Margin="5" Grid.Row="1" Grid.Column="1">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition> <RowDefinition Height="40"></RowDefinition>
......
...@@ -105,30 +105,48 @@ namespace VIZ.TVP.Golf.Module ...@@ -105,30 +105,48 @@ namespace VIZ.TVP.Golf.Module
/// <summary> /// <summary>
/// 选择分组1 /// 选择分组1
/// </summary> /// </summary>
private void SelectGroup() protected virtual void SelectGroup()
{ {
GroupPickerWindow window = new GroupPickerWindow(); GroupPickerWindow window = new GroupPickerWindow();
window.ShowDialog(); window.ShowDialog();
GroupPickerViewModel vm = window.groupPickerView.DataContext as GroupPickerViewModel; GroupPickerViewModel vm = window.groupPickerView.DataContext as GroupPickerViewModel;
if (vm == null || !vm.IsEnter || vm.SelectedGroupInfo == null) if (vm == null || !vm.IsEnter)
return; return;
this.Name = vm.SelectedGroupInfo.TeamInfo.Name; this.UpdateByGroupTempModel(vm.SelectedGroupInfo);
this.Logo = vm.SelectedGroupInfo.TeamInfo.Logo; }
#endregion
if (vm.SelectedGroupInfo.Players.Count > 0) // ===================================================================================
// Action
// ===================================================================================
/// <summary>
/// 根据分组更新
/// </summary>
/// <param name="groupTempModel">分组临时模型</param>
public virtual void UpdateByGroupTempModel(GroupTempModel groupTempModel)
{
if (groupTempModel == null)
return;
this.Name = groupTempModel.TeamInfo.Name;
this.Logo = groupTempModel.TeamInfo.Logo;
if (groupTempModel.Players.Count > 0)
{ {
PlayerInfoModel player = vm.SelectedGroupInfo.Players[0]; PlayerInfoModel player = groupTempModel.Players[0];
this.Player1.PlayerID = player.PlayerID; this.Player1.PlayerID = player.PlayerID;
this.Player1.Name = player.Name; this.Player1.Name = player.Name;
this.Player1.HalfPicture = player.HalfPicture; this.Player1.HalfPicture = player.HalfPicture;
} }
if (vm.SelectedGroupInfo.Players.Count > 1) if (groupTempModel.Players.Count > 1)
{ {
PlayerInfoModel player = vm.SelectedGroupInfo.Players[1]; PlayerInfoModel player = groupTempModel.Players[1];
this.player2.PlayerID = player.PlayerID; this.player2.PlayerID = player.PlayerID;
this.Player2.Name = player.Name; this.Player2.Name = player.Name;
...@@ -136,6 +154,23 @@ namespace VIZ.TVP.Golf.Module ...@@ -136,6 +154,23 @@ namespace VIZ.TVP.Golf.Module
} }
} }
#endregion /// <summary>
/// 清理属性
/// </summary>
public virtual void ClearProperty()
{
this.Name = null;
this.Logo = null;
this.Player1.PlayerID = 0;
this.Player1.Name = null;
this.Player1.HalfPicture = null;
this.Player1.Strokes = 0;
this.Player2.PlayerID = 0;
this.Player2.Name = null;
this.Player2.HalfPicture = null;
this.Player2.Strokes = 0;
}
} }
} }
<UserControl x:Class="VIZ.TVP.Golf.Module.GroupPickerPanelNoPlayer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:GroupPickerPaneNoPlayerModel}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="700">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<!-- 预设 -->
<TextBlock Text="预设:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="选择分组" Grid.Column="1" Width="80" Height="30" Margin="5,0,0,0"
Command="{Binding SelectGroupCommand}"></fcommon:IconButton>
<!-- 成员 -->
<TextBlock Text="成员:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Grid.Row="1"></TextBlock>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=PlayersDisplayName,Mode=TwoWay}" Padding="3"></TextBox>
<!-- 杆数 -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="0" Margin="0,0,5,0" Orientation="Horizontal">
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png" Margin="0,0,5,0"></Image>
<TextBlock Text="杆数:" ></TextBlock>
</StackPanel>
<TextBox Grid.Row="2" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=PlayersStrokes,Mode=TwoWay}" Padding="3"></TextBox>
<!-- 球队Logo -->
<TextBlock Text="球队Logo:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="3"></TextBlock>
<ComboBox Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center" Grid.Row="3" Grid.Column="1"
SelectedValue="{Binding Logo,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"></ComboBox>
<Border BorderBrush="#44000000" BorderThickness="1" Grid.Column="2" Grid.RowSpan="4" Margin="5">
<Image Source="{Binding Path=Logo,Converter={StaticResource String2ImageSourceConverter_team}}"></Image>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// GroupPickerPanelNoPlayer.xaml 的交互逻辑
/// </summary>
public partial class GroupPickerPanelNoPlayer : UserControl
{
public GroupPickerPanelNoPlayer()
{
InitializeComponent();
}
}
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 球队 --> <!-- 球队 -->
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" SelectionMode="Single"
ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.TeamInfos}}" ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.TeamInfos}}"
SelectedValue="{Binding Path=SelectedTeamInfo,Mode=TwoWay}"> SelectedValue="{Binding Path=SelectedTeamInfo,Mode=TwoWay}">
<DataGrid.Columns> <DataGrid.Columns>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</DataGrid> </DataGrid>
<!-- 分组 --> <!-- 分组 -->
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" Grid.Column="1" <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" Grid.Column="1"
ItemsSource="{Binding Path=GroupInfos}" ItemsSource="{Binding Path=GroupInfos}" SelectionMode="Single"
SelectedValue="{Binding Path=SelectedGroupInfo,Mode=TwoWay}"> SelectedValue="{Binding Path=SelectedGroupInfo,Mode=TwoWay}">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="分组" Width="80" Binding="{Binding Path=TeamInfo.Name,Mode=OneWay}" IsReadOnly="True"></DataGridTextColumn> <DataGridTextColumn Header="分组" Width="80" Binding="{Binding Path=TeamInfo.Name,Mode=OneWay}" IsReadOnly="True"></DataGridTextColumn>
......
...@@ -27,18 +27,21 @@ ...@@ -27,18 +27,21 @@
<RowDefinition Height="40"></RowDefinition> <RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition> <ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 预设洞信息 --> <!-- 洞信息 -->
<TextBlock Text="预设洞信息:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock> <TextBlock Text="洞信息:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<ComboBox Grid.Column="1" Margin="5,0,0,0" Height="30" ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.HoleInfos}}" VerticalContentAlignment="Center" <StackPanel Grid.Column="1" Orientation="Horizontal">
SelectedValue="{Binding Path=SelectedHoleInfo,Mode=TwoWay}" DisplayMemberPath="HoleID"></ComboBox> <ComboBox Grid.Column="1" Margin="5,0,0,0" Height="30" Width="120"
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.HoleInfos}}" VerticalContentAlignment="Center"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png" SelectedValue="{Binding Path=SelectedHoleInfo,Mode=TwoWay}" DisplayMemberPath="HoleID"></ComboBox>
Content="采用预设" Grid.Column="2" Width="120" Height="30" <fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"
Command="{Binding PresetHoleCommand}"></fcommon:IconButton> Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="采用预设" Width="120" Height="30"
Command="{Binding PresetHoleCommand}"></fcommon:IconButton>
</StackPanel>
<!-- 洞编号 --> <!-- 洞编号 -->
<TextBlock Text="洞编号:" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock> <TextBlock Text="洞编号:" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<TextBox Text="{Binding Path=HoleID,Mode=TwoWay}" AcceptsReturn="False" VerticalContentAlignment="Center" <TextBox Text="{Binding Path=HoleID,Mode=TwoWay}" AcceptsReturn="False" VerticalContentAlignment="Center"
......
...@@ -11,7 +11,7 @@ namespace VIZ.TVP.Golf.Module ...@@ -11,7 +11,7 @@ namespace VIZ.TVP.Golf.Module
/// <summary> /// <summary>
/// 洞选择面板视图模型 /// 洞选择面板视图模型
/// </summary> /// </summary>
public class HolePickerPanelModel : ViewModelBase public class HolePickerPanelModel : ModelBase
{ {
public HolePickerPanelModel() public HolePickerPanelModel()
{ {
...@@ -83,7 +83,6 @@ namespace VIZ.TVP.Golf.Module ...@@ -83,7 +83,6 @@ namespace VIZ.TVP.Golf.Module
#endregion #endregion
#region PresetHoleCommand -- 预设洞命令 #region PresetHoleCommand -- 预设洞命令
/// <summary> /// <summary>
......
<UserControl x:Class="VIZ.TVP.Golf.Module.HolePickerPanelNoPicture"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
mc:Ignorable="d" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:HolePickerPanelNoPictureModel}"
d:DesignHeight="120" d:DesignWidth="600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter" Type="Relative" WorkPath="picture/hole"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 洞信息 -->
<TextBlock Text="洞信息:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox Grid.Column="1" Margin="5,0,0,0" Height="30" Width="120"
ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.HoleInfos}}" VerticalContentAlignment="Center"
SelectedValue="{Binding Path=SelectedHoleInfo,Mode=TwoWay}" DisplayMemberPath="HoleID"></ComboBox>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="采用预设" Width="120" Height="30"
Command="{Binding PresetHoleCommand}"></fcommon:IconButton>
</StackPanel>
<!-- 洞编号 -->
<TextBlock Text="洞编号:" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<TextBox Text="{Binding Path=HoleID,Mode=TwoWay}" AcceptsReturn="False" VerticalContentAlignment="Center"
Padding="3,0,3,0" Margin="5,0,0,0" Grid.Row="1" Grid.Column="1" Height="30"></TextBox>
<!-- 标准杆 -->
<TextBlock Text="标准杆:" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<TextBox Grid.Row="2" Grid.Column="1" Height="30" AcceptsReturn="False" VerticalContentAlignment="Center"
Text="{Binding Path=Par,Mode=TwoWay}" Padding="3,0,3,0" Margin="5,0,0,0"></TextBox>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// HolePickerPanelNoPicture.xaml 的交互逻辑
/// </summary>
public partial class HolePickerPanelNoPicture : UserControl
{
public HolePickerPanelNoPicture()
{
InitializeComponent();
}
}
}
...@@ -7,9 +7,10 @@ using System.Threading.Tasks; ...@@ -7,9 +7,10 @@ using System.Threading.Tasks;
namespace VIZ.TVP.Golf.Module namespace VIZ.TVP.Golf.Module
{ {
/// <summary> /// <summary>
/// 赛事信息支持 /// 洞选择面板 -- 无洞照片
/// </summary> /// </summary>
public interface ITournamentInfoSupport public class HolePickerPanelNoPictureModel : HolePickerPanelModel
{ {
} }
} }
<UserControl x:Class="VIZ.TVP.Golf.Module.TeamPickerPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:TeamPickerPanelModel}"
mc:Ignorable="d"
d:DesignHeight="140" d:DesignWidth="1000">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<!-- 预设 -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<!-- 预设 -->
<TextBlock Text="预设:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center" Width="240"
SelectedValue="{Binding SelectedTeamInfo,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.TeamInfos}}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent">
<TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="预设队伍" Grid.Column="1" Width="80" Height="30" Margin="5,0,0,0"
Command="{Binding PresetTeamCommand}"></fcommon:IconButton>
</StackPanel>
<!-- 名称 -->
<TextBlock Text="名称:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Grid.Row="1"></TextBlock>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=Name,Mode=TwoWay}" Padding="3"></TextBox>
<!-- 球队Logo -->
<TextBlock Text="球队Logo:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="2"></TextBlock>
<ComboBox Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center" Grid.Row="2" Grid.Column="1"
SelectedValue="{Binding Logo,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"></ComboBox>
<Border BorderBrush="#44000000" BorderThickness="1" Grid.Column="2" Grid.RowSpan="3" Margin="5">
<Image Source="{Binding Path=Logo,Converter={StaticResource String2ImageSourceConverter_team}}"></Image>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// TeamPickerPanel.xaml 的交互逻辑
/// </summary>
public partial class TeamPickerPanel : UserControl
{
public TeamPickerPanel()
{
InitializeComponent();
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.HtmlControls;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 队伍选择面板视图模型
/// </summary>
public class TeamPickerPanelModel : ModelBase
{
/// <summary>
/// 组选择面板视图模型
/// </summary>
public TeamPickerPanelModel()
{
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.PresetTeamCommand = new VCommand(this.PresetTeam);
}
// ===================================================================================
// Property
// ===================================================================================
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Logo -- Logo
private string logo;
/// <summary>
/// 分组1 Logo
/// </summary>
public string Logo
{
get { return logo; }
set { logo = value; this.RaisePropertyChanged(nameof(Logo)); }
}
#endregion
#region SelectedTeamInfo -- 选中的队伍信息
private TeamInfoModel selectedTeamInfo;
/// <summary>
/// 选中的队伍信息
/// </summary>
public TeamInfoModel SelectedTeamInfo
{
get { return selectedTeamInfo; }
set { selectedTeamInfo = value; this.RaisePropertyChanged(nameof(SelectedTeamInfo)); }
}
#endregion
#region PlayerTempModels -- 队员临时信息集合
private ObservableCollection<PlayerTempModel> playerTempModels;
/// <summary>
/// 队员临时信息集合
/// </summary>
public ObservableCollection<PlayerTempModel> PlayerTempModels
{
get { return playerTempModels; }
set { playerTempModels = value; this.RaisePropertyChanged(nameof(PlayerTempModels)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
#region PresetTeamCommand -- 预设队伍命令
/// <summary>
/// 预设队伍命令
/// </summary>
public VCommand PresetTeamCommand { get; set; }
/// <summary>
/// 预设队伍
/// </summary>
private void PresetTeam()
{
if (this.SelectedTeamInfo == null || ApplicationDomainEx.PlayerInfos == null)
return;
this.Name = this.SelectedTeamInfo.Name;
this.Logo = this.SelectedTeamInfo.Logo;
var query = ApplicationDomainEx.PlayerInfos.Where(p => p.TeamID == this.SelectedTeamInfo.TeamID);
ObservableCollection<PlayerTempModel> models = new ObservableCollection<PlayerTempModel>();
foreach (PlayerInfoModel item in query)
{
PlayerTempModel model = new PlayerTempModel();
model.FromTeamInfo(item);
models.Add(model);
}
this.PlayerTempModels = models;
}
#endregion
}
}
<UserControl x:Class="VIZ.TVP.Golf.Module.TeamPickerPanelNoLogo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:TeamPickerPanelNoLogoModel}"
mc:Ignorable="d"
d:DesignHeight="140" d:DesignWidth="1000">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<!-- 预设 -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<!-- 预设 -->
<TextBlock Text="预设:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center" Width="240"
SelectedValue="{Binding SelectedTeamInfo,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.TeamInfos}}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent">
<TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="预设队伍" Grid.Column="1" Width="80" Height="30" Margin="5,0,0,0"
Command="{Binding PresetTeamCommand}"></fcommon:IconButton>
</StackPanel>
<!-- 名称 -->
<TextBlock Text="名称:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Grid.Row="1"></TextBlock>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=Name,Mode=TwoWay}" Padding="3"></TextBox>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// TeamPickerPanelNoLogo.xaml 的交互逻辑
/// </summary>
public partial class TeamPickerPanelNoLogo : UserControl
{
public TeamPickerPanelNoLogo()
{
InitializeComponent();
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.HtmlControls;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 队伍选择面板视图模型 不包含Logo
/// </summary>
public class TeamPickerPanelNoLogoModel : TeamPickerPanelModel
{
/// <summary>
/// 队伍选择面板视图模型 不包含Logo
/// </summary>
public TeamPickerPanelNoLogoModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
}
}
...@@ -324,5 +324,25 @@ ...@@ -324,5 +324,25 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="images\NameBarBottom.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\TeamInfo.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\GroupInfo.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\Champion.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment