Olyd.Wpf.Guide
1.0.0
dotnet add package Olyd.Wpf.Guide --version 1.0.0
NuGet\Install-Package Olyd.Wpf.Guide -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Olyd.Wpf.Guide" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Olyd.Wpf.Guide --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Olyd.Wpf.Guide, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Olyd.Wpf.Guide as a Cake Addin #addin nuget:?package=Olyd.Wpf.Guide&version=1.0.0 // Install Olyd.Wpf.Guide as a Cake Tool #tool nuget:?package=Olyd.Wpf.Guide&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Olyd.Wpf.Guide
WPF应用程序, 新手引导解决方案
使用步骤
- 实现继承 GuideContainer 的控件类
- 通过 StepName 属性,明白当前指引的步骤阶段
- 重载 OnNextShowGuide() 方法,可以在下一个指引之前进行窗体内部页面跳转等操作,记得要调用 ShowGuide 方法
- 记得在控件上使用附加属性 GuideHelper.Name 设定引导名称
- 如果控件太多,可以使用附加属性 GuideHelper.Ignore 设定忽略
- 实现 IGuideTarget 接口
- 一种直接添加到要显示新手指引的窗体类上
- 一种是没有窗体类,可以使用单独类显示
- 编写 新手引导列表
var guideList = new List<GuideGroup>();
{
GuideItem item = new GuideItem { ElementName = "ConnectBtn_Guid", Content = LocalizedStrings.Guide_device_view, Direction = Direction.Bottom };
GuideGroup vo = new GuideGroup { Items = new List<GuideItem>() };
vo.StepName = "Guid_Page1";
vo.Items.Add(item);
guideList.Add(vo);
}
{
GuideItem item1 = new GuideItem { ElementName = "GuideGrid", Content = LocalizedStrings.Guide_device_find, Direction = Direction.Top };
GuideGroup vo = new GuideGroup { Items = new List<GuideItem>() };
vo.StepName = "Guid_Page2";
vo.Items.Add(item1);
guideList.Add(vo);
}
{
GuideItem item1 = new GuideItem { ElementName = "GuideBtn", Content = LocalizedStrings.Guide_device_connect, Direction = Direction.Right };
GuideGroup vo = new GuideGroup { Items = new List<GuideItem>() };
vo.StepName = "Guid_Page3";
vo.Items.Add(item1);
vo.OnNextAction = (w) =>
{
WindowManager.Instance.GotoHomePage();
};
guideList.Add(vo);
}
GuideLists.Add(guideList); // GuideLists 存放所有的新手指引
- 调用 GuideWindow.ShowGuideWindow() 方法,传入继承 GuideContainer 的控件、实现 IGuideTarget 的类对象、本次新手引导的列表。
// GuideMainView 继承 GuideContainer
// _mainWindow 实现 IGuideTarget
// GuideConfig.GuideList 是 List<GuideGroup>
var guideWindow = GuideWindow.ShowGuideWindow(new GuideMainView(), _mainWindow, GuideConfig.GuideLists[0]);
guideWindow.ShowDialog();
- App.xaml 引入主题和样式
<ResourceDictionary Source="pack://application:,,,/Olyd.Wpf.Guide;component/Themes/Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/Olyd.Wpf.Guide;component/Themes/Generic.xaml" />
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0-windows7.0
- Olyd.Wpf.DpiAutoScale (>= 1.0.0)
- Olyd.Wpf.Helpers (>= 1.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 73 | 12/20/2024 |