• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Common.RelayCommand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Infrastructure.Common.RelayCommand的典型用法代码示例。如果您正苦于以下问题:C# RelayCommand类的具体用法?C# RelayCommand怎么用?C# RelayCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RelayCommand类属于Infrastructure.Common命名空间,在下文中一共展示了RelayCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ZoneDevicesViewModel

		public ZoneDevicesViewModel()
		{
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			Devices = new ObservableCollection<ZoneDeviceViewModel>();
			AvailableDevices = new ObservableCollection<ZoneDeviceViewModel>();
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:7,代码来源:ZoneDevicesViewModel.cs


示例2: PlanDesignerView

		public PlanDesignerView()
		{
			InitializeComponent();

			_scrollViewer.PreviewMouseDown += OnMouseMiddleDown;
			_scrollViewer.PreviewMouseUp += OnMouseMiddleUp;
			_scrollViewer.PreviewMouseMove += OnMiddleMouseMove;
			_scrollViewer.MouseLeave += OnMiddleMouseLeave;

			_scrollViewer.PreviewMouseWheel += OnPreviewMouseWheel;
			_scrollViewer.ScrollChanged += OnScrollViewerScrollChanged;

			slider.ValueChanged += OnSliderValueChanged;
			deviceSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(deviceSlider_ValueChanged);

			Loaded += new RoutedEventHandler(OnLoaded);
			_scrollViewer.SizeChanged += new SizeChangedEventHandler(OnSizeChanged);
			_scrollViewer.LayoutUpdated += new EventHandler(OnLayoutUpdated);
			_timer = new DispatcherTimer()
			{
				Interval = TimeSpan.FromMilliseconds(100),
				IsEnabled = false,
			};
			_timer.Tick += (s, e) => _locked = false;
			_requreRefresh = true;
			_locked = true;
			Dispatcher.ShutdownStarted += (s, e) => RegistrySettingsHelper.SetDouble(DeviceZoomSetting, deviceSlider.Value);
			ZoomInCommand = new RelayCommand(OnZoomIn, CanZoomIn);
			ZoomOutCommand = new RelayCommand(OnZoomOut, CanZoomOut);
			DeviceZoomInCommand = new RelayCommand(OnDeviceZoomIn, CanDeviceZoomIn);
			DeviceZoomOutCommand = new RelayCommand(OnDeviceZoomOut, CanDeviceZoomOut);
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:32,代码来源:PlanDesignerView.xaml.cs


示例3: UsersViewModel

 public UsersViewModel()
 {
     Menu = new UsersMenuViewModel(this);
     DeleteCommand = new RelayCommand(OnDelete, CanDelete);
     EditCommand = new RelayCommand(OnEdit, CanEdit);
     AddCommand = new RelayCommand(OnAdd);
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:7,代码来源:UsersViewModel.cs


示例4: DescriptorViewModel

		public DescriptorViewModel(BaseDescriptor descriptor)
		{
			GKBaseDescriptor = descriptor;
			GKDescriptorNo = descriptor.GKBase.GKDescriptorNo;
			KauDescriptorNo = descriptor.GKBase.KAUDescriptorNo;

			SetAutomaticRegimeCommand = new RelayCommand(OnSetAutomaticRegime);
			SetManualRegimeCommand = new RelayCommand(OnSetManualRegime);
			SetIgnoreRegimeCommand = new RelayCommand(OnSetIgnoreRegime);
			ShowParametersCommand = new RelayCommand(OnShowParameters);
			ShowMeasureCommand = new RelayCommand(OnShowMeasure);
			ShowCardReaderCommand = new RelayCommand(OnShowCardReader);

			InitializeTest();
			InitializeDustiness();
			InitializeController();
			InitializeTypeNo();
			InitializeFire();
			InitializeTurning();
			InitializeLogic();
			InitializeDelays();
			InitializeAll();

			AdditionalShortParameters = new List<ushort>();
			for (int i = 0; i < 10; i++)
			{
				AdditionalShortParameters.Add(0);
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:29,代码来源:DescriptorViewModel.cs


示例5: CameraDetailsViewModel

		public CameraDetailsViewModel(Camera camera)
		{
			ShowCommand = new RelayCommand(OnShow);
			SetPtzPresetCommand = new RelayCommand(OnSetPtzPreset, CanSetPtzPreset);
			AlarmSetChannelCommand = new RelayCommand(OnAlarmSetChannel, CanAlarmSetChannel);
			AlarmDisableChannelCommand = new RelayCommand(OnAlarmDisableChannel, CanAlarmDisableChannel);
			Camera = camera;
			Title = Camera.PresentationName;
			Camera.StatusChanged += OnCameraStatusChanged;

			Presets = new ObservableCollection<int>();
			for (int i = 0; i < camera.CountPresets; i++)
			{
				Presets.Add(i + 1);
			}
			SelectedPreset = Presets.FirstOrDefault();

			if (Camera != null)
			{
				Width = Camera.ShowDetailsWidth;
				Height = Camera.ShowDetailsHeight;
				MarginLeft = Camera.ShowDetailsMarginLeft;
				MarginTop = Camera.ShowDetailsMarginTop;
				IsRecordOnline = Camera.IsRecordOnline;
				IsOnGuard = Camera.IsOnGuard;
				Status = Camera.Status;
				PlanLinks = new PlanLinksViewModel(Camera);
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:29,代码来源:CameraDetailsViewModel.cs


示例6: DoorViewModel

		public DoorViewModel(GKDoor door)
		{
			Door = door;
			DoorDetailsViewModel = new DoorDetailsViewModel(door);
			State.StateChanged -= OnStateChanged;
			State.StateChanged += OnStateChanged;
			OnStateChanged();

			EnterDevice = GKManager.Devices.FirstOrDefault(x => x.UID == Door.EnterDeviceUID);
			ExitDevice = GKManager.Devices.FirstOrDefault(x => x.UID == Door.ExitDeviceUID);
			EnterButton = GKManager.Devices.FirstOrDefault(x => x.UID == Door.EnterButtonUID);
			ExitButton = GKManager.Devices.FirstOrDefault(x => x.UID == Door.ExitButtonUID);
			LockDevice = GKManager.Devices.FirstOrDefault(x => x.UID == Door.LockDeviceUID);
			LockDeviceExit = GKManager.Devices.FirstOrDefault(x => x.UID == Door.LockDeviceExitUID);
			LockControlDevice = GKManager.Devices.FirstOrDefault(x => x.UID == Door.LockControlDeviceUID);
			LockControlDeviceExit = GKManager.Devices.FirstOrDefault(x => x.UID == Door.LockControlDeviceExitUID);
			EnterZone = GKManager.SKDZones.FirstOrDefault(x => x.UID == Door.EnterZoneUID);
			ExitZone = GKManager.SKDZones.FirstOrDefault(x => x.UID == Door.ExitZoneUID);

			ShowOnPlanCommand = new RelayCommand(OnShowOnPlan, CanShowOnPlan);
			ShowJournalCommand = new RelayCommand(OnShowJournal);
			ShowPropertiesCommand = new RelayCommand(OnShowProperties);
			ShowOnPlanOrPropertiesCommand = new RelayCommand(OnShowOnPlanOrProperties);
			ShowDeviceCommand = new RelayCommand<GKDevice>(OnShowDevice);
			ShowZoneCommand = new RelayCommand<GKSKDZone>(OnShowZone);
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:26,代码来源:DoorViewModel.cs


示例7: DeviceDetailsViewModel

		public DeviceDetailsViewModel(Device device)
		{
			ExecuteCommand = new RelayCommand(OnExecute);
			DeviceCommands = new List<DeviceCommandViewModel>();
			Device = device;
			DeviceState = Device.DeviceState;
			DeviceState.StateChanged += new Action(OnStateChanged);
			DeviceState.ParametersChanged += new Action(OnParametersChanged);
			OnStateChanged();

			Title = Device.DottedPresentationAddressAndName;
			TopMost = true;

			var tableNo = MetadataHelper.GetDeviceTableNo(device);
			var metadataDeviceCommands = MetadataHelper.Metadata.devicePropInfos.Where(x => x.tableType == tableNo);
			foreach (var metadataDeviceCommand in metadataDeviceCommands)
			{
				var deviceCommandViewModel = new DeviceCommandViewModel()
				{
					Name = metadataDeviceCommand.name,
					Caption = metadataDeviceCommand.caption,
				};
				DeviceCommands.Add(deviceCommandViewModel);
			}
			SelectedDeviceCommand = DeviceCommands.FirstOrDefault();
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:26,代码来源:DeviceDetailsViewModel.cs


示例8: TariffDetailsViewModel

		public TariffDetailsViewModel(Tariff tariff = null)
		{
			EditDevicesCommand = new RelayCommand(OnEditDevicesCommand);
			TariffTypes = new ObservableCollection<TariffType>(Enum.GetValues(typeof(TariffType)).Cast<TariffType>());
			TariffParts = new ObservableCollection<TariffPartViewModel>();
			if (tariff == null)
			{
				IsNew = true;
				Tariff = new Tariff
					{
						Description = "",
						Devices = new List<Device>(),
						Name = "Новый тариф",
						TariffParts = new List<TariffPart>(),
					};
				Title = "Создание нового тарифа";
				SelectedTariffPartsNumber = 1;
			}
			else
			{
				IsNew = false;
				Tariff = tariff;
				Title = "Редактирование тарифа: " + tariff.TariffType.ToDescription();
				SelectedTariffPartsNumber = tariff.TariffParts.Count;
				SelectedTariffType = tariff.TariffType;
			}
			GetMaxTariffParts();
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:28,代码来源:TariffDetailsViewModel.cs


示例9: LayoutPartDescriptionViewModel

		public LayoutPartDescriptionViewModel(ILayoutPartDescription layoutPartDescription)
		{
			LayoutPartDescription = layoutPartDescription;
			VisualizationState = VisualizationState.Prohibit;
			AddCommand = new RelayCommand(OnAddCommand, CanAddCommand);
			DragCommand = new RelayCommand(OnDragCommand, CanAddCommand);
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:LayoutPartDescriptionViewModel.cs


示例10: MainViewModel

		public MainViewModel()
		{
			Current = this;
			Title = "Сервер ОПС FS2";
			ExitCommand = new RelayCommand(OnExit);
			ShowLogCommand = new RelayCommand(OnShowLog);
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:7,代码来源:MainViewModel.cs


示例11: MPTDeviceViewModel

		public MPTDeviceViewModel(GKMPTDevice mptDevice)
		{
			MPTDevice = mptDevice;
			Device = mptDevice.Device;
			MPTDevicePropertiesViewModel = new MPTDevicePropertiesViewModel(Device, false);
			ShowPropertiesCommand = new RelayCommand(OnShowProperties, CanShowProperties);
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:MPTDeviceViewModel.cs


示例12: DesignerItemBase

		public DesignerItemBase(ElementBase element)
			: base(element)
		{
			_contextMenu = null;
			ShowPropertiesCommand = new RelayCommand(OnShowProperties);
			DeleteCommand = new RelayCommand(OnDelete);
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:7,代码来源:DesignerItemBase.cs


示例13: MainViewModel

 public MainViewModel()
 {
     Current = this;
     ShowImitatorCommand = new RelayCommand(OnShowImitator);
     Clients = new ObservableCollection<ClientViewModel>();
     Title = "Сервер ОПС FireSec-2";
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:7,代码来源:MainViewModel.cs


示例14: CameraDetailsViewModel

		public CameraDetailsViewModel(Camera camera = null)
		{
			ShowZonesCommand = new RelayCommand(OnShowZones);
			TestCommand = new RelayCommand(OnTest);
			StateClasses = new List<XStateClass>();
			StateClasses.Add(XStateClass.Fire1);
			StateClasses.Add(XStateClass.Fire2);
			StateClasses.Add(XStateClass.Attention);
			StateClasses.Add(XStateClass.Ignore);

			if (camera != null)
			{
				Title = "Редактировать камеру";
				Camera = camera;
			}
			else
			{
				Title = "Создать камеру";
				Camera = new Camera()
				{
					Name = "Новая камера",
					Address = "192.168.0.1"
				};
			}

			CopyProperties();
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:27,代码来源:CameraDetailsViewModel.cs


示例15: ValidationErrorsViewModel

		public ValidationErrorsViewModel()
		{
			ClickCommand = new RelayCommand(OnClick);
			EditValidationCommand = new RelayCommand(OnEditValidation);
			CloseValidationCommand = new RelayCommand(OnCloseValidation);
			Validate();
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:ValidationErrorsViewModel.cs


示例16: InitializeController

		public void InitializeController()
		{
			GoToTechnoligicalRegimeCommand = new RelayCommand(OnGoToTechnoligicalRegime);
			GoToWorkingRegimeCommand = new RelayCommand(OnGoToWorkingRegime);
			EnterUserCommand = new RelayCommand(OnEnterUser);
			ExitUserCommand = new RelayCommand(OnExitUser);
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:DescriptorViewModel.Controller.cs


示例17: InitializeZIndexCommands

		void InitializeZIndexCommands()
		{
			MoveToFrontCommand = new RelayCommand(OnMoveToFront, CanMoveExecute);
			SendToBackCommand = new RelayCommand(OnSendToBack, CanMoveExecute);
			MoveForwardCommand = new RelayCommand(OnMoveForward, CanMoveExecute);
			MoveBackwardCommand = new RelayCommand(OnMoveBackward, CanMoveExecute);
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:7,代码来源:PlanDesignerViewModel.ZIndex.cs


示例18: ElementZoneViewModel

        public ElementZoneViewModel(ElementPolygonZone elementPolygonZone)
        {
            ShowInTreeCommand = new RelayCommand(OnShowInTree);
            DisableAllCommand = new RelayCommand(OnDisableAll, CanDisableAll);
            EnableAllCommand = new RelayCommand(OnEnableAll, CanEnableAll);
            SetGuardCommand = new RelayCommand(OnSetGuard, CanSetGuard);
            UnSetGuardCommand = new RelayCommand(OnUnSetGuard, CanUnSetGuard);

            ZoneNo = elementPolygonZone.ZoneNo;
            Zone = FiresecManager.Zones.FirstOrDefault(x => x.No == ZoneNo);
            if (Zone != null)
            {
                ZoneState = FiresecManager.DeviceStates.ZoneStates.FirstOrDefault(x => x.No == ZoneNo);
                if (ZoneState != null)
                {
                    ZoneState.StateChanged += new Action(ZoneState_StateChanged);
                }
            }

            ElementZoneView = new ElementZoneView();
            if (elementPolygonZone.Points == null)
                elementPolygonZone.Points = new System.Windows.Media.PointCollection();
            ElementZoneView._polygon.Points = PainterHelper.GetPoints(elementPolygonZone);
            InitializeDevices();
        }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:25,代码来源:ElementZoneViewModel.cs


示例19: RolesViewModel

 public RolesViewModel()
 {
     Menu = new RolesMenuViewModel(this);
     DeleteCommand = new RelayCommand(OnDelete, CanEditDelete);
     EditCommand = new RelayCommand(OnEdit, CanEditDelete);
     AddCommand = new RelayCommand(OnAdd);
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:7,代码来源:RolesViewModel.cs


示例20: DeviceExecutableCommandViewModel

		public DeviceExecutableCommandViewModel(GKDevice device, GKStateBit stateType)
		{
			ExecuteControlCommand = new RelayCommand(OnExecuteControl);
			Device = device;
			StateBit = stateType;
			Name = ((GKStateBit)stateType).ToDescription();
			if (Device.DriverType == GKDriverType.RSR2_Valve_DU || Device.DriverType == GKDriverType.RSR2_Valve_KV || Device.DriverType == GKDriverType.RSR2_Valve_KVMV)
			{
				switch (stateType)
				{
					case GKStateBit.TurnOn_InManual:
						Name = "Открыть";
						break;
					case GKStateBit.TurnOnNow_InManual:
						Name = "Открыть немедленно";
						break;
					case GKStateBit.TurnOff_InManual:
						Name = "Закрыть";
						break;
					case GKStateBit.Stop_InManual:
						Name = "Остановить";
						break;
				}
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:25,代码来源:DeviceExecutableCommandViewModel.cs



注:本文中的Infrastructure.Common.RelayCommand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IniParser.FileIniDataParser类代码示例发布时间:2022-05-26
下一篇:
C# DataModels.InfoManageDataContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap