Example #1
0
        public void ProcessItemsTrigger(object sender, Csla.Xaml.ExecuteEventArgs e)
        {
            // copy selected items into known list type
            var selection = new List <Data>();

            foreach (Data item in (System.Collections.IEnumerable)e.MethodParameter)
            {
                selection.Add(item);
            }

            // display detail form
            var form = new DetailPage();
            var vm   = form.Resources["ViewModel"] as DetailModel;

            if (vm != null)
            {
                vm.SelectedItems = selection;
            }
            MainPageModel.ShowForm(form);
        }
Example #2
0
        public void ProcessItemsExecute(object sender, Csla.Xaml.ExecuteEventArgs e)
        {
            // copy selected items into known list type
            var listBox   = ((System.Windows.Controls.Control)e.TriggerSource).Tag as System.Windows.Controls.ListBox;
            var selection = new List <Data>();

            foreach (var item in listBox.SelectedItems)
            {
                selection.Add((Data)item);
            }

            // process selection
            var form = new DetailPage();
            var vm   = form.Resources["ViewModel"] as DetailModel;

            if (vm != null)
            {
                vm.SelectedItems = selection;
            }
            MainPageModel.ShowForm(form);
        }