WPF reference project

//xaml
<Window x:Class="WpfApp1.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:WpfApp1"
        mc:Ignorable="d" WindowState="Maximized"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Button HorizontalAlignment="Center" Margin="4" Padding="6">
            <StackPanel Orientation="Horizontal">
                <Image Source="/LibraryResource;component/Images/324.jpg" Width="1000" Height="500"/>
                <TextBlock VerticalAlignment="Center" FontSize="20"
                           Text="Click me!" Margin="10,0,0,0"/>
            </StackPanel>
        </Button>
    </Grid>
</Window>

 

Add reference,choose project

 

 

posted @ 2024-07-01 21:29  FredGrit  阅读(16)  评论(0)    收藏  举报