コード例 #1
0
        private void OnConfirmClick(object sender, RoutedEventArgs e)
        {
            var productsIds = ViewModel.ExcludedProducts?.Select(p => p.Id).ToArray() ?? new string[0];

            var message = new ExcludedProductsMessage(productsIds);

            Messenger.Default.Send(message);

            this.Close();
        }
コード例 #2
0
        private void ManageExcludedProductsMessage(ExcludedProductsMessage message)
        {
            this.CurrentConfiguration.ExcludedProducts.Clear();

            if (message.ProductsIds.Length == 0)
            {
                return;
            }

            var excludedProducts = this.MainWorkerServices.GetProductsByIds(message.ProductsIds);

            foreach (var product in excludedProducts)
            {
                this.CurrentConfiguration.ExcludedProducts.Add(product);
            }
        }