Wpf 在.Net Core 3.1的2.0版中找不到MahApps ToggleSwitch属性
我创建了一个新的.NETCore3.1WPF应用程序。 我为MahApps.Metro v 2.0.0-alpha0748添加了nuget软件包 我在xaml中添加了一个切换开关Wpf 在.Net Core 3.1的2.0版中找不到MahApps ToggleSwitch属性,wpf,.net-core,mahapps.metro,Wpf,.net Core,Mahapps.metro,我创建了一个新的.NETCore3.1WPF应用程序。 我为MahApps.Metro v 2.0.0-alpha0748添加了nuget软件包 我在xaml中添加了一个切换开关 <Window x:Class="WpfTestSandbox.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
<Window x:Class="WpfTestSandbox.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:WpfTestSandbox"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<mah:ToggleSwitch Header="WiFi rest state"
Ischecked="True" />
</Grid>
</Window>
这是我的App.xaml
<Application x:Class="WpfTestSandbox.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfTestSandbox"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/dark.green.xaml" />
<ResourceDictionary>
<SolidColorBrush x:Key="{x:Static SystemColors.WindowTextBrushKey}" Color="White"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
IsChecked被标记为在类型ToggleSwitch中找不到
也找不到其他属性。。。标签外,标签上,正在检查更改
我是否缺少一个依赖关系
TIA该属性在2.0.0-alpha0748中称为IsOn
OffLabel和OnLabel分别为OffContent和OnContent,IsCheckedChanged被切换。该属性在2.0.0-alpha0748中称为IsOn
OffLabel和OnLabel分别为OffContent和OnContent,IsCheckedChanged处于切换状态。您是否在app.xaml中添加了样式引用?请参见上面刚刚添加的内容-是,Ihave@Jeff:我相信该属性在2.0.0-alpha0748中称为IsOn。我刚刚看到-我正在查看对象浏览器。大多数属性和事件都已更改-您是否在app.xaml中添加了样式引用?请参见上文刚刚添加的-是的,我have@Jeff:我相信该属性在2.0.0-alpha0748中称为IsOn。我刚刚看到-我正在查看对象浏览器。大多数属性和事件都已更改-叹气