Свойства MahApps ToggleSwitch не найдены в версии 2.0 в. Net Core 3.1 - PullRequest
0 голосов
/ 24 марта 2020

Я создаю новое. Net Core 3.1 WPF приложение. Я добавляю пакет nuget для MahApps.Metro v 2.0.0-alpha0748

Я добавляю тумблер к xaml

<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.

Другие свойства также не найдены ... OffLabel, OnLabel, IsCheckedChanged, ...

Я пропустил зависимость?

TIA

1 Ответ

0 голосов
/ 24 марта 2020

Свойство называется IsOn в 2.0.0-alpha0748.

OffLabel и OnLabel равно OffContent и OnContent соответственно, а IsCheckedChanged равно Toggled.

...