代码拉取完成,页面将自动刷新
<Window
x:Class="Dotnet9WPFControls.Demo.Views.GuideControlView"
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:dotnet9="https://dotnet9.com"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/"
Title="Dotnet9 WPF自定义控件"
Width="800"
Height="600"
prism:ViewModelLocator.AutoWireViewModel="True"
AllowsTransparency="True"
Background="Transparent"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<dotnet9:BindControlToGuideConverter x:Key="BindControlToGuideConverter" />
<Style
x:Key="Styles.ButtonDemo"
BasedOn="{StaticResource MainButtonStyle}"
TargetType="{x:Type Button}">
<Setter Property="Width" Value="100" />
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="5" />
</Style>
</Window.Resources>
<Border
Background="White"
BorderBrush="#ccc"
BorderThickness="1"
MouseLeftButtonDown="Border_MouseDown">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Content="左上引导"
Style="{StaticResource Styles.ButtonDemo}">
<dotnet9:GuideHelper.GuideInfo>
<MultiBinding Converter="{StaticResource BindControlToGuideConverter}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding Path="BtnLeftTopGuide" />
</MultiBinding>
</dotnet9:GuideHelper.GuideInfo>
</Button>
<ListBox
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Top">
<Button Content="ListBox中的按钮" Style="{StaticResource Styles.ButtonDemo}">
<dotnet9:GuideHelper.GuideInfo>
<MultiBinding Converter="{StaticResource BindControlToGuideConverter}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding Path="DataContext.ListBoxItemGuide"
RelativeSource="{RelativeSource AncestorType={x:Type Window}}" />
</MultiBinding>
</dotnet9:GuideHelper.GuideInfo>
</Button>
</ListBox>
<Button
Grid.Row="0"
Grid.Column="2"
Margin="5"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Click="Close_Click"
FontSize="32"
IsCancel="True"
Style="{StaticResource CloseButtonStyle}">
<dotnet9:GuideHelper.GuideInfo>
<MultiBinding Converter="{StaticResource BindControlToGuideConverter}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding Path="BtnCloseGuide" />
</MultiBinding>
</dotnet9:GuideHelper.GuideInfo>
<materialDesign:PackIcon Kind="Close" />
</Button>
<Button
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="显示新手引导"
Style="{StaticResource Styles.ButtonDemo}">
<dotnet9:GuideHelper.GuideInfo>
<MultiBinding Converter="{StaticResource BindControlToGuideConverter}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding Path="BtnShowGuide" />
</MultiBinding>
</dotnet9:GuideHelper.GuideInfo>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:ChangePropertyAction
PropertyName="Display"
TargetName="GuideControl"
Value="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Grid.Row="2"
Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="左下引导"
Style="{StaticResource Styles.ButtonDemo}">
<dotnet9:GuideHelper.GuideInfo>
<MultiBinding Converter="{StaticResource BindControlToGuideConverter}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding Path="BtnLeftBottomGuide" />
</MultiBinding>
</dotnet9:GuideHelper.GuideInfo>
</Button>
<Button
Grid.Row="2"
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Content="右下引导"
Style="{StaticResource Styles.ButtonDemo}">
<dotnet9:GuideHelper.GuideInfo>
<MultiBinding Converter="{StaticResource BindControlToGuideConverter}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding Path="BtnRightBottomGuide" />
</MultiBinding>
</dotnet9:GuideHelper.GuideInfo>
</Button>
<dotnet9:GuideControl
x:Name="GuideControl"
Grid.Row="0"
Grid.RowSpan="3"
Grid.Column="0"
Grid.ColumnSpan="3"
Guides="{Binding GuideLists}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:ChangePropertyAction PropertyName="Display" Value="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</dotnet9:GuideControl>
</Grid>
</Border>
</Window>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。