Example #1
0
        public SellViewModel(IOwnedItemsStore ownedItemsStore, IPriceService priceService)
        {
            _ownedItemsStore = ownedItemsStore;
            _priceService    = priceService;

            CalculatePriceCommand = new CallbackCommand(CalculatePrice, () => CanCalculatePrice);
            SellCommand           = new CallbackCommand(Sell, () => IsValidSell);

            _ownedItemsStore.OwnedItemsChanged += OwnedItemsStore_OwnedItemsChanged;
        }
Example #2
0
        public ResDictDocControl(object context, string id)
        {
            _Context    = context;
            _DocumentId = id;

            AddDrawingCommand = new CallbackCommand(AddDrawing_Execute);

            // make sure resources where instanciated for sure
            var dummy = ResDictDocResources.Instance;

            InitializeComponent();
        }
Example #3
0
 internal void InvokeCallbacks(InteractionMessage message)
 {
     if (CallbackCommand != null)
     {
         if (CallbackCommand.CanExecute(message))
         {
             CallbackCommand.Execute(message);
         }
     }
     if (CallbackMethodTarget != null && CallbackMethodName != null)
     {
         _callbackMethod.Invoke(CallbackMethodTarget, CallbackMethodName, message);
     }
 }
Example #4
0
    /// <inheritdoc />
    public EditAppViewModel(ApplicationConfigService appConfigService, ApplicationViewModel model)
    {
        Application              = model.ApplicationTuple;
        AppConfigService         = appConfigService;
        DeleteApplicationCommand = new CallbackCommand(new DeleteApplicationCommand(Application), AfterDeleteApplication);
        PropertyChanged         += OnApplicationChanged;

        // Build Package Provider Configurations
        foreach (var provider in PackageProviderFactory.All)
        {
            var result = ProviderFactoryConfiguration.TryCreate(provider, Application);
            if (result != null)
            {
                PackageProviders.Add(result);
            }
        }

        RefreshCommands();
    }
Example #5
0
        internal void InvokeCallbacks([NotNull] InteractionMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            if (CallbackCommand != null)
            {
                if (CallbackCommand.CanExecute(message))
                {
                    CallbackCommand.Execute(message);
                }
            }

            if (CallbackMethodTarget != null && CallbackMethodName != null)
            {
                _callbackMethod.Invoke(CallbackMethodTarget, CallbackMethodName, message);
            }
        }
Example #6
0
        private static Int32 formatCallBack(CallbackCommand callBackCommand, int subActionCommand, IntPtr action)
        {
            switch (callBackCommand)
            {
            case CallbackCommand.DISKLOCKEDFORACCESS:
                break;

            case CallbackCommand.PROGRESS:
                string percent = Convert.ToString(action);
                break;

            case CallbackCommand.OUTPUT:
                string output = Convert.ToString(action);
                break;

            case CallbackCommand.DONE:
                string status = Convert.ToString(action);
                break;
            }
            return(1);
        }