Skip to content

Commit

Permalink
新增 初始代码
Browse files Browse the repository at this point in the history
2024/6/10
19:26
  • Loading branch information
NoNameGMM committed Jun 10, 2024
1 parent 5464449 commit 15cb822
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 0 deletions.
13 changes: 13 additions & 0 deletions App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Application x:Class="NoNameDesktopPet.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:NoNameDesktopPet"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style x:Key="stlWindow" TargetType="Window">
<Setter Property = "Background" Value="Transparent"></Setter>
<Setter Property = "AllowsTransparency" Value="True"></Setter>
<Setter Property = "WindowStyle" Value="None"></Setter>
</Style>
</Application.Resources>
</Application>
14 changes: 14 additions & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Configuration;
using System.Data;
using System.Windows;

namespace NoNameDesktopPet
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

}
10 changes: 10 additions & 0 deletions AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
21 changes: 21 additions & 0 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Window x:Class="NoNameDesktopPet.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:NoNameDesktopPet"
mc:Ignorable="d"
xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"
Title="NoNameDesktopPet" Height="230" Width="400"
PreviewMouseLeftButtonDown="Window_PreviewMouseLeftButtonDown"
Style="{StaticResource stlWindow}">
<Grid>
<Image gif:AnimationBehavior.SourceUri="./gif/bochi.gif" />
<Image x:Name="Bochi" Visibility="Visible"
gif:AnimationBehavior.SourceUri="./gif/bochi.gif"
gif:AnimationBehavior.RepeatBehavior="1"
gif:AnimationBehavior.AutoStart="True"
gif:AnimationBehavior.AnimateInDesignMode="True"
/>
</Grid>
</Window>
29 changes: 29 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Text;
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 NoNameDesktopPet
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}

private void Window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
}
}
32 changes: 32 additions & 0 deletions NoNameDesktopPet.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<RootNamespace>NoNameDesktopPet</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<PublishSingleFile>true</PublishSingleFile>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<None Remove="gif\bochi.gif" />
</ItemGroup>

<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="XamlAnimatedGif" Version="2.3.0" />
</ItemGroup>

<ItemGroup>
<Resource Include="gif\bochi.gif">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
</ItemGroup>

</Project>
Binary file added gif/bochi.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon.ico
Binary file not shown.

0 comments on commit 15cb822

Please sign in to comment.