1 Star 0 Fork 158

源动力/Chess

forked from cygsd/Chess 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
QiPanPage.xaml 15.02 KB
一键复制 编辑 原始数据 按行查看 历史
<Page x:Class="Chess.QiPanPage"
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:Chess" xmlns:customclass="clr-namespace:Chess.CustomClass"
mc:Ignorable="d"
Title="QiPanPage" Loaded="MainFormLoaded" SnapsToDevicePixels="True" UseLayoutRounding="True">
<Page.Resources>
<local:GlobalValue x:Key="Glbv"/>
<Storyboard x:Key="turnLight" Storyboard.TargetProperty="Fill.(SolidColorBrush.Color)" AutoReverse="False" FillBehavior="HoldEnd">
<ColorAnimation From="#333333" To="LightYellow" Duration="0:0:0.2"/>
</Storyboard>
<Storyboard x:Key="turnBlack" Storyboard.TargetProperty="Fill.(SolidColorBrush.Color)" AutoReverse="False" FillBehavior="HoldEnd">
<ColorAnimation From="LightYellow" To="#333333" Duration="0:0:0.2"/>
</Storyboard>
</Page.Resources>
<Grid>
<Viewbox StretchDirection="DownOnly">
<Grid x:Name="mainGrid" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinWidth="1100" MaxWidth="1100">
<Grid.DataContext>
<local:Settings/>
</Grid.DataContext>
<!--#region 走棋指示灯 -->
<Ellipse x:Name="redSideRect" Width="30" Height="30" Fill="Gray" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,20,0,0" Stroke="Black" StrokeThickness="2">
<Ellipse.Style>
<Style TargetType="{x:Type Ellipse}">
<Style.Triggers>
<DataTrigger Value="True" Binding="{Binding Default.CurrentSide}">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ResourceKey=turnLight}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource ResourceKey=turnBlack}"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
<Ellipse x:Name="blackSideRect" Width="30" Height="30" Fill="Gray" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,60,0,0" Stroke="Black" StrokeThickness="2">
<Ellipse.Style>
<Style TargetType="{x:Type Ellipse}">
<Style.Triggers>
<DataTrigger Value="True" Binding="{Binding Default.CurrentSide, Mode=OneWay}">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ResourceKey=turnBlack}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource ResourceKey=turnLight}"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
<!--#endregion-->
<Border BorderThickness="3" CornerRadius="5,5,5,5" Style="{DynamicResource borderStyle}"/>
<Grid Width="{Binding Width, ElementName=qipan_topBlack}" HorizontalAlignment="Left" Height="{Binding Height, ElementName=qipan_topBlack}" VerticalAlignment="Top">
<Image x:Name="qipan_topBlack" Stretch="None" Source="/picture/棋盘(黑上).png" StretchDirection="Both" HorizontalAlignment="Left" VerticalAlignment="Center" Visibility="Visible">
<Image.Effect>
<DropShadowEffect Color="#FF7B7A7A" Opacity="1" BlurRadius="10"/>
</Image.Effect>
</Image>
<Image x:Name="qipan_topRed" Source="/picture/棋盘(红上).png" Stretch="None" HorizontalAlignment="Left" VerticalAlignment="Center" Visibility="Hidden">
<Image.Effect>
<DropShadowEffect Color="#FF7B7A7A" Opacity="1" BlurRadius="10"/>
</Image.Effect>
</Image>
<Grid x:Name="QiPanOver" HorizontalAlignment="Left" VerticalAlignment="Top" Width="629" Height="695" Margin="67,53,0,0" Background="#4CA7ED17" Visibility="Hidden"/>
<Canvas x:Name="qiziCanvas" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Disabled" Cursor="Arrow"/>
<Grid x:Name="DrawGrid" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<Grid x:Name="JueshaGrid" HorizontalAlignment="Left" VerticalAlignment="Top" Width="629" Height="695" Margin="67,53,0,0"/>
</Grid>
<StackPanel x:Name="Infomation_board" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,55,60,18" MinWidth="321" MinHeight="321" Height="695">
<StackPanel.Background>
<ImageBrush ImageSource="/picture/Resource/information_board_321_321.png"/>
</StackPanel.Background>
<TextBlock x:Name="CanJuComment" HorizontalAlignment="Stretch" Margin="10,20,10,0" VerticalAlignment="Top" Foreground="Black" FontSize="14" TextWrapping="Wrap" FontFamily="Microsoft YaHei" Width="300" Background="#33FFFFE0" Padding="5,5,5,5"/>
</StackPanel>
<!--#region 按钮面板 -->
<Border x:Name="PersonVsPC" VerticalAlignment="Bottom" Height="75" Margin="10,0,10,10" CornerRadius="3,3,3,3" Visibility="Hidden">
<WrapPanel Height="30" VerticalAlignment="Center" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<Button Content="开局" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="77,0,0,0" VerticalAlignment="Center" Width="70" Click="ResetBtnClick"/>
<Button Content="翻转棋盘" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="OnFanZhuanQiPan"/>
<Button Content="悔棋" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="HuiQiButton"/>
<CheckBox Content="显示提示箭头" Background="#FFF9F08D" Foreground="LightYellow" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="50,0,0,0" IsChecked="{Binding Default.ArrowVisable}" />
</WrapPanel>
</Border>
<Border x:Name="PCVsPc" VerticalAlignment="Bottom" Height="75" Margin="10,0,10,10" CornerRadius="3,3,3,3" Visibility="Hidden">
<WrapPanel Height="30" VerticalAlignment="Center" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<Button x:Name="PCVsPcAutoMoveCanJuQiZi" Content="自动走棋" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="77,0,0,0" VerticalAlignment="Center" Width="70" Click="AutoMoveCanJu"/>
<Button x:Name="PCVsPcStopAutoMove" Content="停止走棋" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="StopAutoMoveCanJu" IsEnabled="False"/>
<Slider x:Name="MoveDelayTime" HorizontalAlignment="Left" VerticalAlignment="Center" Width="300" AutoToolTipPlacement="TopLeft" Maximum="2000" SmallChange="100" LargeChange="100" TickFrequency="100" TickPlacement="TopLeft" Value="{Binding Default.MoveDelayTime}" Foreground="#FFFFFFFC" ToolTip="调整走棋间隔时间(毫秒)。" Margin="100,0,0,0" IsSnapToTickEnabled="True" Minimum="100" BorderBrush="{x:Null}" Background="{x:Null}" />
</WrapPanel>
</Border>
<Border x:Name="FreeDaPu" VerticalAlignment="Bottom" Height="75" Margin="10,0,10,10" CornerRadius="3,3,3,3" Visibility="Hidden">
<WrapPanel Height="30" VerticalAlignment="Center" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<Button Content="重新开始" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="ResetBtnClick"/>
<Button Content="上一步" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="HuiQiButton"/>
<Button Content="下一步" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="NextStep"/>
<Button Content="翻转棋盘" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="OnFanZhuanQiPan"/>
<Button Content="记谱窗口" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Click="OpenJiPuWindow" Width="70"/>
<Button Content="棋盘监控" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="OpenSpyWindow"/>
<Button Content="注释说明" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Click="AddRemark" Width="70"/>
<Button Content="保存棋谱" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Click="UpdateQiPu" Width="70"/>
</WrapPanel>
</Border>
<Border x:Name="CanJuLianXi" VerticalAlignment="Bottom" Height="75" Margin="10,0,10,10" CornerRadius="3,3,3,3">
<StackPanel Visibility="Visible" Orientation="Vertical">
<WrapPanel Height="30" VerticalAlignment="Center" ScrollViewer.VerticalScrollBarVisibility="Disabled" Margin="0,6,0,0" SnapsToDevicePixels="True">
<Button Content="重来" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="70,0,0,0" VerticalAlignment="Center" Width="70" Click="ReStartCanJu"/>
<Button Content="上一局" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="PerCanJu"/>
<Button Content="下一局" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="NextCanJu"/>
<Button Content="悔棋" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="HuiQiButton"/>
<Button Content="视频教程" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="VideoUrl"/>
<Button x:Name="AutoMoveCanJuQiZi" Content="自动走棋" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="AutoMoveCanJu"/>
<Button x:Name="StopAutoMove" Content="停止走棋" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="StopAutoMoveCanJu" IsEnabled="False"/>
</WrapPanel>
</StackPanel>
</Border>
<Border x:Name="FuPan" VerticalAlignment="Bottom" Height="75" Margin="10,0,10,10" CornerRadius="3,3,3,3" Visibility="Hidden">
<StackPanel Visibility="Visible">
<WrapPanel VerticalAlignment="Top" Height="30" Visibility="Visible" Margin="0,5,0,0">
<Button Content="打开棋谱" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="77,0,0,0" VerticalAlignment="Center" Click="OpenFuPanWindow" Width="70"/>
<Button Content="上一步" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="HuiQiButton"/>
<Button Content="下一步" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="NextStep"/>
<Button Content="重新开始" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="ResetBtnClick"/>
<Button Content="翻转棋盘" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Width="70" Click="OnFanZhuanQiPan"/>
<CheckBox Content="显示提示箭头" Background="#FFF9F08D" Foreground="LightYellow" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="50,0,0,0" IsChecked="{Binding Default.ArrowVisable}" />
</WrapPanel>
<WrapPanel Height="30" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Disabled" Margin="0,5,0,0">
<Button Content="注释说明" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="77,0,0,0" VerticalAlignment="Center" Click="AddRemark" Width="70"/>
<Button Content="保存棋谱" Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Click="UpdateQiPu" Width="70"/>
<Button Content="另存为..." Style="{DynamicResource button}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" Click="SaveQiPu" Width="70"/>
</WrapPanel>
</StackPanel>
</Border>
<!--#endregion-->
<Grid x:Name="remarkGrid" VerticalAlignment="Bottom" Height="65" Margin="0,0,0,9" ToolTip="备注信息" Visibility="Hidden">
<TextBox x:Name="remarkTextBox" Margin="20,5,100,5" />
<Button Width="70" Height="26" Content="保 存" HorizontalAlignment="Right" Margin="0,0,20,0" Click="SaveRemark" />
</Grid>
<Grid x:Name="childSelectGrid" VerticalAlignment="Bottom" Height="100" HorizontalAlignment="Center" Width="600" Visibility="Hidden">
</Grid>
</Grid>
</Viewbox>
</Grid>
</Page>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/lixiaoliyubo/Chess.git
git@gitee.com:lixiaoliyubo/Chess.git
lixiaoliyubo
Chess
Chess
Chess

搜索帮助