protected virtual List <CommandMenuItem> CreateCommandMenuItems() { NewCommand = new DelegateCustomCommand(New); var miNew = new CommandMenuItem { Caption = StringResources.New, Command = NewCommand, ImageSmall = ImageResources.DCLAddNew16.GetBitmapImage(), ImageLarge = ImageResources.DCLAddNew32.GetBitmapImage(), HotKey = CanHandleHotKeys ? new KeyGesture(Key.F7) : null, GlyphAlignment = GlyphAlignmentType.Top, DisplayMode = DisplayModeType.Default, GlyphSize = GlyphSizeType.Small, Priority = 10 }; DeleteCommand = new DelegateCustomCommand(Delete, CanDelete); var miDelete = new CommandMenuItem { Caption = StringResources.Delete, Command = DeleteCommand, ImageSmall = ImageResources.DCLDelete16.GetBitmapImage(), ImageLarge = ImageResources.DCLDelete32.GetBitmapImage(), HotKey = CanHandleHotKeys ? new KeyGesture(Key.F9) : null, GlyphAlignment = GlyphAlignmentType.Top, DisplayMode = DisplayModeType.Default, GlyphSize = GlyphSizeType.Small, Priority = 20 }; return(new List <CommandMenuItem> { miNew, miDelete }); }
protected PanelViewModelBase() { Commands = new List <ICommand>(); try { _isInSetSettings = true; InitializeSettings(); } finally { _isInSetSettings = false; } InitializeRights(); //if (IsMenuEnable) //{ // if (IsCustomizeBarEnabled) // InitializeCustomizationBar(); //} //if (IsContextMenuEnable) // ContextMenu = new MenuItemCollection(); IEventAggregator ea; if (wmsMLC.General.IoC.Instance.TryResolve(out ea)) { EventAggregator = ea; EventAggregator.Subscribe(this); } NotClearInputDataCommand = new DelegateCustomCommand(OnNotClearInputDataCommand, CanNotClearInputDataCommand); }
public MainViewModel() { _criticalErrorMessages = new List <string>(); if (LicenseManager.UsageMode != LicenseUsageMode.Designtime) { _authenticationProvider = IoC.Instance.Resolve <IAuthenticationProvider>(); _authenticationProvider.AuthenticatedUserChanged += (sender, args) => { OnPropertyChanged(UserInfoPropertyName); UpdateSysEnvironmentInfo(GetSysDbInfo()); }; OnPropertyChanged(UserInfoPropertyName); // запускаем пинг // В дебаге пинг не нужен, а проблем из-за отладки с точками останова - огромное кол-во // INFO: ОТКЛЮЧАЕМ ПИНГ //#if !DEBUG // _pinger = new Timer(CheckStatus, null, 0, DefaultPingTime); //#endif } PingStateIndex = 0; _sysMsgState = 0; LoginCommand = new DelegateCustomCommand(Login, CanReAuthenticate); LogoffCommand = new DelegateCustomCommand(Logoff, () => true); ClearCacheCommand = new DelegateCustomCommand(ClearCache, () => true); MainMenuShowCommand = new DelegateCustomCommand(ShowMainMenu, () => true); SysDbInfoCommand = new DelegateCustomCommand(OnSysDbInfo, () => true); SystemMessageSubject = Resources.StringResources.StateRun; SystemMessage = string.Format(Resources.StringResources.EnjoyYourWork, Environment.NewLine); }
public CustomParamValueSubTreeView() { ShowTotalRow = false; ShowNodeImage = false; KeyPropertyName = new CustomParamValue().GetPrimaryKeyPropertyName(); ParentIdPropertyName = CustomParamValue.CPVParentPropertyName.ToUpper(); //DefaultSortingField = CustomParamValue.CustomParamCodePropertyName.ToUpper(); InitializeComponent(); AutoExpandAllNodes = true; Menu = new MenuViewModel(GetType().GetFullNameWithoutVersion()) { NotUseGlobalLayoutSettings = true }; NewCommand = new DelegateCustomCommand(OnNew, CanNew); EditCommand = new DelegateCustomCommand(OnEdit, CanEdit); DeleteCommand = new DelegateCustomCommand(OnDelete, CanDelete); InitializeBaseCommandsMenu(); LayoutRoot.DataContext = this; customTreeListControl.MaxHeight = CalcMaxHeight(); customTreeListControl.RestoredLayoutFromXml += CustomTreeListControlOnRestoredLayoutFromXml; PropertyChanged += OnPropertyChanged; }
public IWBPosInputWithPlaceListViewModel() { DialogResult = null; PrintCaption = "Печатать этикетки для ТЕ"; PlaceCaption = "Место приемки"; PositionCaption = "Выберите принимаемые позиции"; // фильтр по умолчанию // задается из вне через активити PlaceFilter = "STATUSCODE_R = 'PLC_FREE'"; BatchCommand = new DelegateCustomCommand(OnBatchCommand, CanBatchCommand); BeginWorkCommand = new DelegateCustomCommand <bool?>(BeginWork, CanBeginWork); EndWorkCommand = new DelegateCustomCommand(EndWork, CanEndWork); ChangeOvxSkuCommand = new DelegateCustomCommand(OnChangeOvxSkuCommand, CanChangeOvxSkuCommand); Commands.AddRange(new[] { BatchCommand, ChangeOvxSkuCommand }); SubFields = GetSublistViewFields(); _timer = new System.Timers.Timer(1000) { AutoReset = true }; _timer.Elapsed += delegate { TimeText = (DateTime.Now - _startTime).ToString(@"mm\:ss"); }; }
public WorkingManageViewModel() { PanelCaption = "Работы"; AllowClosePanel = true; ShowBorder = true; StartTime = DateTime.Today; Appointments = new ObservableCollection <AppointmentModel>(); Resources = new ObservableCollection <ResourceModel>(); Operations = new ObservableCollection <OperationModel>(); Labels = new ObservableCollection <LabelModel>(); SelectedOperations = new List <OperationModel>(); SelectedResources = new List <ResourceModel>(); RefreshCommand = new DelegateCustomCommand(Refresh); ExportCommand = new DelegateCustomCommand(ExportData); FilterCommand = new DelegateCustomCommand(Find, CanFind); SetDefaultFilterDates(); FillReferences(); Find(); }
protected override void SetupCustomizeMenu(BarItem bar, ListMenuItem listmenu) { base.SetupCustomizeMenu(bar, listmenu); if (AppearanceStyleCommand == null) { AppearanceStyleCommand = new DelegateCustomCommand(OnAppearanceStyle, CanAppearanceStyle); } // Добавляем функционал подсветки (в начало списка) var minPriority = listmenu.MenuItems.Min(i => i.Priority); listmenu.MenuItems.Add(new CommandMenuItem { Caption = StringResources.AppearanceStyle, Command = AppearanceStyleCommand, ImageSmall = ImageResources.DCLAppearanceStyle16.GetBitmapImage(), ImageLarge = ImageResources.DCLAppearanceStyle32.GetBitmapImage(), GlyphAlignment = GlyphAlignmentType.Top, DisplayMode = DisplayModeType.Default, Priority = minPriority - 100 }); // убираем функционал настройки самого layout-а var item = listmenu.MenuItems.FirstOrDefault(i => i.Caption == StringResources.CustomizeRegion); if (item != null) { listmenu.MenuItems.Remove(item); } }
public CustomSelectControlBase() { DefaultStyleKey = typeof(CustomSelectControlBase); PreviousPageCommand = new DelegateCustomCommand(this, OnPreviousPage, CanPreviousPage); NextPageCommand = new DelegateCustomCommand(this, OnNextPage, CanNextPage); ItemDoubleClickCommand = new DelegateCustomCommand(this, OnItemDoubleClick, CanItemDoubleClick); }
public ClearLayoutViewModel() { HasViewWindow = true; IsClearFormComponents = true; IsClearFormSize = true; IsClearFormPosition = true; DoActionCommand = new DelegateCustomCommand(this, () => { }, OnCanOkClick); }
public CustomParamValueTreeViewModel() { SaveCommand = new DelegateCustomCommand(OnSave, CanSave); Commands.AddRange(new[] { SaveCommand }); CpSource = string.Empty; CpTarget = string.Empty; }
protected BusinessProcessViewModelBase() { PrintCommand = new DelegateCustomCommand(PrintReport, CanPrintReport); ExecuteBPCommand = new DelegateCustomCommand <BusinessProcessCommandParameter>(OnBPExecute); //CreateProcessMenu(); }
public AuthenticationViewModel(IAuthenticationProvider authenticationProvider, IViewService viewService) { _authenticationProvider = authenticationProvider; _viewService = viewService; _authAttempts = 0; ResultDialog = false; OnCommand = new DelegateCustomCommand(Authenticate, CanAuthenticate); }
public IWBPosInputViewModel() { BatchProcessCommand = new DelegateCustomCommand(() => { }, CanBatchProcess); ShowBatchCommand = new DelegateCustomCommand(() => ProcessBatchCode(Source.IWBPosInputBatch, Source, true, ShowBatchComplete)); ApplyBatchCommand = new DelegateCustomCommand(() => ProcessBatchCode(Source.IWBPosInputBatch, Source, false, ApplyBatchComplete)); ChangeOvxSkuCommand = new DelegateCustomCommand(OnChangeOvxSkuCommand, CanChangeOvxSkuCommand); }
public DashboardViewModel() { RefreshCommand = new DelegateCustomCommand(RefreshData); ExportCommand = new DelegateCustomCommand(ExportData); AddMenu(); ListDataSource = new List <object>(); RefreshData(); }
private void InitializeCustomizationBarCommands() { CustomizationCommand = new DelegateCustomCommand(Customization, CanCustomization); SaveLayoutCommand = new DelegateCustomCommand(SaveLayout, CanSaveLayout); SaveDBLayoutCommand = new DelegateCustomCommand(SaveDBLayout, CanSaveDBLayout); SaveDBLayoutUpVersionCommand = new DelegateCustomCommand(SaveDBLayoutUpVersion, CanSaveDBUpVersionLayout); ClearLayoutCommand = new DelegateCustomCommand(OnClearLayout, OnCanClearLayout); Commands.AddRange(new[] { CustomizationCommand, SaveDBLayoutCommand, SaveDBLayoutUpVersionCommand, ClearLayoutCommand, SaveLayoutCommand }); }
public InputPlPosListViewModel() { IsReadOnly = true; SublistViewItemType = typeof(Working); Works = new Dictionary <decimal, Work>(); BeginWorkCommand = new DelegateCustomCommand(this, ObBeginWork, OnCanBeginWork); EndWorkCommand = new DelegateCustomCommand(this, OnEndWork, OnCanEndWork); DoActionCommand = new DelegateCustomCommand(this, OnOkClick, OnCanOkClick); OneTypeTeCommand = new DelegateCustomCommand <bool?>(this, OnOneTypeTe, CanOneTypeTe); }
private MenuViewModel CreateGridControlMenuViewModel() { var menu = new MenuViewModel(string.Format("{0}_GridControlMenu", MenuSuffix)) { NotUseGlobalLayoutSettings = true }; if (GridControlNewCommand == null) { GridControlNewCommand = new DelegateCustomCommand(this, OnGridControlNew, OnCanGridControlNew); } if (GridControlDeleteCommand == null) { GridControlDeleteCommand = new DelegateCustomCommand(this, OnGridControlDelete, OnCanGridControlDelete); } var bar = new BarItem { Name = "GridControlMenuBarItemCommands", Caption = StringResources.Commands, GlyphSize = GlyphSizeType.Small }; menu.Bars.Add(bar); bar.MenuItems.Add(new CommandMenuItem { Caption = StringResources.New, Command = GridControlNewCommand, ImageSmall = ImageResources.DCLAddNew16.GetBitmapImage(), ImageLarge = ImageResources.DCLAddNew32.GetBitmapImage(), HotKey = new KeyGesture(Key.F7), GlyphSize = GlyphSizeType.Small, GlyphAlignment = GlyphAlignmentType.Top, DisplayMode = DisplayModeType.Default, IsVisible = true, Priority = 1 }); bar.MenuItems.Add(new CommandMenuItem { Caption = StringResources.Delete, Command = GridControlDeleteCommand, ImageSmall = ImageResources.DCLDelete16.GetBitmapImage(), ImageLarge = ImageResources.DCLDelete32.GetBitmapImage(), HotKey = new KeyGesture(Key.F9), GlyphSize = GlyphSizeType.Small, GlyphAlignment = GlyphAlignmentType.Top, DisplayMode = DisplayModeType.Default, IsVisible = true, Priority = 3 }); return(menu); }
public ObjectViewModelBase() { AllowClosePanel = true; //PanelCaption = typeof(TModel).Name; PanelCaption = typeof(TModel).GetDisplayName(); RefreshCommand = new DelegateCustomCommand(this, RefreshData, CanRefreshData); SaveCommand = new DelegateCustomCommand(this, OnSave, CanSave); DeleteCommand = new DelegateCustomCommand(this, OnDelete, CanDelete); FormulaValues = new ExpandoObject(); }
private ErrorBox() { ErrorSound = SystemSoundEnum.Hand; InitializeComponent(); HelpServiceMail = Properties.Settings.Default.HelpServiceMail; SendMailCommand = new DelegateCustomCommand(this, OnSendMail, OnCanSendMail); CloseCommand = new DelegateCustomCommand(Close); LayoutRoot.DataContext = this; Loaded += OnLoaded; }
public PropertyViewModel() { SaveCommand = new DelegateCustomCommand(SaveProperty, CanSaveProperty); Source = new List <SysObjectConfig>(); SelectedItems = new ObservableCollection <SysObjectConfig>(); _wrapper = new SysObjectWrapper(); IsCustomizeBarEnabled = true; CreateMenu(); }
public FilterViewModel() { Fields = new ObservableCollection <DataField>(); Mandants = new MandantFilter(); IsFilterMode = true; ToDefaultCommand = new DelegateCustomCommand(ToDefault, () => true); CancelCommand = new DelegateCustomCommand(RejectChanges, () => true); LoadCommand = new DelegateCustomCommand(Load, () => true); SaveCommand = new DelegateCustomCommand(Save, () => true); }
public CustomObjectListViewModelBase() { ShowColumnHeaders = true; ShowDetail = false; SelectedItems = new ObservableCollection <TModel>(); NewCommand = new DelegateCustomCommand(New, CanNew); DeleteCommand = new DelegateCustomCommand(Delete, CanDelete); EditCommand = new DelegateCustomCommand(Edit, CanEdit); Commands.AddRange(new[] { NewCommand, DeleteCommand, EditCommand }); }
public ObjectListViewModelBase() { NewCommand = new DelegateCustomCommand(New, CanNew); DeleteCommand = new DelegateCustomCommand(Delete, CanDelete); ShowInNewWindowCommand = new DelegateCustomCommand(ShowInNewWindow); QuickLinkMenuCommand = new DelegateCustomCommand <QuickLinkCommandParameter>(OnQuickLinkMenu, OnCanQuickLinkMenu); PivotCommand = new DelegateCustomCommand(ShowPivot); ExportCommand = new DelegateCustomCommand(ShowExport); SelectCommand = new DelegateCustomCommand(OnSelect, CanSelect); Commands.AddRange(new[] { NewCommand, DeleteCommand, QuickLinkMenuCommand, SelectCommand }); }
private ErrorBox() { ErrorSound = SystemSoundEnum.Hand; InitializeComponent(); HelpServiceMail = Properties.Settings.Default.HelpServiceMail; IsBtnSandMailEnable = true; LayoutRoot.DataContext = this; SendMailCommand = new DelegateCustomCommand(this, OnSendMail, CanSendMail); CloseCommand = new DelegateCustomCommand(this, OnFormClose, CanFormClose); #if DEBUG Topmost = false; #endif Loaded += OnLoaded; }
public SubImageView() { _maxHeight = 0.45 * SystemParameters.PrimaryScreenHeight; InitializeComponent(); //ImageEditControl.MaxHeight = 0.45 * SystemParameters.PrimaryScreenHeight; //ImageEditControl.MaxWidth = 0.7 * SystemParameters.PrimaryScreenHeight; NewImageCommand = new DelegateCustomCommand(this, OnNewImage, CanNewImage); DeleteImageCommand = new DelegateCustomCommand(this, OnDeleteImage, CanDeleteImage); InitializeMenus(); LayoutRoot.DataContext = this; }
public CustomFilterMemoEditControl(IEnumerable <DataField> vmFields, string filterExp) { _fields = vmFields; _filter = filterExp; ShowIcon = false; AllowDefaultButton = false; EditValueChanged += CustomFilterMemoEditControl_EditValueChanged; ICustomCommand openFilterWindowCommand = new DelegateCustomCommand(OnShowFilterView); Buttons.Add(new ButtonInfo() { GlyphKind = GlyphKind.Regular, ButtonKind = ButtonKind.Simple, Command = openFilterWindowCommand }); }
public PmConfigViewModel() { PanelCaption = Properties.Resources.ConfiguratorPanelCaption; SelectedItems = new ObservableCollection <PmConfiguratorData>(); DataForDelete = new Dictionary <string, PmConfiguratorData>(); IsDeleted = new Dictionary <string, bool>(); RefreshCommand = new DelegateCustomCommand(OnRefresh, CanRefresh); NewCommand = new DelegateCustomCommand(OnNewCommand, CanNewCommand); DeleteCommand = new DelegateCustomCommand(OnDelete, CanDelete); SaveCommand = new DelegateCustomCommand(OnSave, CanSave); Commands.AddRange(new[] { RefreshCommand, NewCommand, DeleteCommand, SaveCommand }); CreateMainMenu(); PropertyChanged += OnPropertyChanged; }
public ObjectViewModelBase() { AllowClosePanel = true; PanelCaption = typeof(TModel).GetDisplayName(); PanelCaptionImage = GetPanelImage(); RefreshCommand = new DelegateCustomCommand(RefreshData, CanRefresh); SaveCommand = new DelegateCustomCommand(OnSave, CanSave); DeleteCommand = new DelegateCustomCommand(OnDelete, CanDelete); EditInNewWindowCommand = new DelegateCustomCommand(OpenInNewWindow, CanOpenInNewWindow); SaveAndCloseCommand = new DelegateCustomCommand(OnSaveAndClose, CanSaveAndClose); FormulaValues = new ExpandoObject(); //InitializeBaseCommandsMenu(); Commands.AddRange(new[] { RefreshCommand, SaveCommand, DeleteCommand, EditInNewWindowCommand, SaveAndCloseCommand }); }
public GCListView() { InitializeComponent(); Menu = new MenuViewModel(GetType().GetFullNameWithoutVersion()) { NotUseGlobalLayoutSettings = true }; SelectCommand = new DelegateCustomCommand(OnSelect, CanCud); DeleteCommand = new DelegateCustomCommand(OnDelete, CanDelete); CpvCommand = new DelegateCustomCommand(OnCPV, CanCPV); InitializeBaseCommandsMenu(); ChildSource = new ObservableCollection <object>(); // выставляем себя в качестве источника LayoutRoot.DataContext = this; gridControl.MaxHeight = CalcMaxHeight(); gridControl.RestoredLayoutFromXml += GridControlOnRestoredLayoutFromXml; }
public CustomSelectView() { ShowMenu = true; AllowAutoShowAutoFilterRow = true; ShowTotalRow = true; InitializeComponent(); DisplaySetting = SettingDisplay.List; SelectCommand = new DelegateCustomCommand <ValueDataField>(this, OnSelect, CanSelect); FindCommand = new DelegateCustomCommand(this, OnFind, CanFind); AutoFilterCommand = new DelegateCustomCommand(this, OnAutoFilter, CanAutoFilter); ClearFilterCommand = new DelegateCustomCommand(this, OnClearFilter, CanClearFilter); Loaded += Onloaded; Unloaded += OnUnloaded; DataContextChanged += OnDataContextChanged; LayoutRoot.DataContext = this; }