Ai
2 Star 8 Fork 6

CookCSharp/CookPopularInstaller

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainWindow.xaml 3.52 KB
一键复制 编辑 原始数据 按行查看 历史
写代码的厨子 提交于 2025-05-30 17:59 +08:00 . 完成命令行工具与Patch包
<Window x:Class="CookPopularInstaller.CustomUI.Patch.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CookPopularInstaller.CustomUI.Patch"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DataContext="{Binding RelativeSource={RelativeSource Self}}"
Title="{Binding Title}"
Width="580"
Height="150"
BorderThickness="0"
Background="White"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<local:StateToVisibilityConverter x:Key="StateToVisibilityConverter" />
<Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Width" Value="60" />
<Setter Property="Height" Value="26" />
<Setter Property="Foreground" Value="#1C1C1C" />
<Setter Property="Background" Value="LightGray" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" CornerRadius="2">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#C6C6C6" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<StackPanel VerticalAlignment="Center" Visibility="{Binding State, Converter={StaticResource StateToVisibilityConverter}, ConverterParameter={x:Static local:State.Prepare}}">
<Button Content="安装" Click="Install_Click" Style="{StaticResource ButtonStyle}" />
<TextBlock Text="{Binding Explain}"
FontWeight="Medium"
Margin="20,10,20,0"
TextAlignment="Center" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Margin="50,0" VerticalAlignment="Center" Visibility="{Binding State, Converter={StaticResource StateToVisibilityConverter}, ConverterParameter={x:Static local:State.Installing}}">
<TextBlock Text="{Binding Message}" TextWrapping="Wrap" />
<ProgressBar Height="22"
Foreground="ForestGreen"
Value="{Binding Progress}"
Margin="0,10,0,0" />
</StackPanel>
<StackPanel Margin="50,0" VerticalAlignment="Center" Visibility="{Binding State, Converter={StaticResource StateToVisibilityConverter}, ConverterParameter={x:Static local:State.Finish}}">
<Path Width="30" Height="30"
Data="{Binding Geometry}"
Fill="{Binding Brush}"
Stretch="Uniform" />
<TextBlock Text="{Binding Result}"
Foreground="{Binding Brush}"
Margin="0,10,0,0"
TextAlignment="Center" TextWrapping="Wrap" />
</StackPanel>
</Grid>
</Window>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/CookCSharp/CookPopularInstaller.git
git@gitee.com:CookCSharp/CookPopularInstaller.git
CookCSharp
CookPopularInstaller
CookPopularInstaller
master

搜索帮助