会员" AddNewDevice"无法识别或无法访问

时间:2015-06-12 22:22:24

标签: c# wpf

我有一个使用Fluent.Ribbon功能区控件的窗口(WPF)。 在所述功能区中,我有执行不同任务的按钮。 对于这些命令,我​​创建了一个静态类,其中包含返回命令的只读属性。

对于第一个按钮,此方法运行良好,但是,似乎找不到第二个命令。 我使用了与第一个命令完全相同的语法,但我一直收到上述错误。

我尝试过清理解决方案/构建,构建解决方案并进行调试。一切都没有用。

这是我的代码:

<Fluent:RibbonGroupBox Header="Device Operations">
    <Fluent:Button Command="cmd:MainWindowCommands.SearchForNewDevices" Header="Search for Devices" Icon="{DynamicResource searchForDevices}" LargeIcon="{DynamicResource searchForDevicesLarge}" />
    <Fluent:Button Command="cmd:MainWindowCommands.AddNewDevice" Header="Add Device" Icon="{DynamicResource addDevice}" LargeIcon="{DynamicResource addDeviceLarge}" /> <!-- This is where the error occurs -->
</Fluent:RibbonGroupBox>

这是包含命令的类:

using System;

namespace Beatsleigher.eMMCDumper.Commands {

    using Beatsleigher.eMMCDumper.ViewModels;
    using GalaSoft.MvvmLight.CommandWpf;

    public static class MainWindowCommands {

        private static RelayCommand searchForNewDevicesCommand;
        /// <summary>
        /// Gets the search for new devices command.
        /// Created by: Beatsleigher
        /// At:               12.06.2015, 11:18
        /// On:              BEATSLEIGHER-PC
        /// </summary>
        /// <value>
        /// The search for new devices command.
        /// </value>
        public static RelayCommand SearchForNewDevices {
            get {
                return searchForNewDevicesCommand == null ? searchForNewDevicesCommand = new RelayCommand(MainWindowVM.Instance.SearchForDevicesExecute) : searchForNewDevicesCommand;
            }
        }

        private static RelayCommand addNewDeviceCommand;
        /// <summary>
        /// Gets the add new device command.
        /// Created by: Beatsleigher
        /// At:               12.06.2015, 22:35
        /// On:              BEATSLEIGHER-PC
        /// </summary>
        /// <value>
        /// The add new device.
        /// </value>
        public static RelayCommand AddNewDevice {
            get {
                return addNewDeviceCommand == null ? addNewDeviceCommand = new RelayCommand(MainWindowVM.Instance.AddNewDevice) : addNewDeviceCommand;
            }
        }

    }

}

提前感谢您提供的任何帮助!

0 个答案:

没有答案