Author Topic: .NET SELECTION Routines  (Read 18960 times)

0 Members and 1 Guest are viewing this topic.

HOSNEYALAA

  • Newt
  • Posts: 103
Re: .NET SELECTION Routines
« Reply #15 on: May 15, 2023, 02:51:37 AM »
HI gile
@gile
please
I want to work create Table of ListView contains
on the same data as picture cad table

I tried and it didn't work

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ObservableSelectionSample
{
    public partial class SelectionView : UserControl
    {
       
        public SelectionView()
        {
            InitializeComponent();
            DataContext = new SelectionViewModel();
        }     
        private void Button_Click(object sender, RoutedEventArgs e)
        {
           
            foreach (var item in tbbt.Items)
            {
                var ITT0 = item.Type;
                var ITT1 = item.Qty;
                var ITT2 = item.Length;
            }



        }





    }
}


HOSNEYALAA

  • Newt
  • Posts: 103
Re: .NET SELECTION Routines
« Reply #16 on: May 15, 2023, 02:56:20 AM »
this a project

thank you

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: .NET SELECTION Routines
« Reply #17 on: May 16, 2023, 12:37:25 AM »
@HOSNEYALAA
If the goal is to create an AutoCAD Table with the contents of the current selection, you do not need all this Palette WPF MVVM Bindings stuff.
But if you want to keep on the WPF MVVM Bindings route, you should bind your button to a property of the ViewModel which type implements ICommand instead of handling the Button_Click event (as shown in this example) and you would not relay on the View (the ListView items) to fill the table but simply use the Selection property of the ViewModel which contains the data you need.

Note: as said in the first message of this thread: "Please post questions in a regular thread".
« Last Edit: May 16, 2023, 12:44:08 AM by gile »
Speaking English as a French Frog

HOSNEYALAA

  • Newt
  • Posts: 103
Re: .NET SELECTION Routines
« Reply #18 on: May 16, 2023, 01:46:58 AM »
thank you
This is a very advanced stage For me

I thought it was easy for information  to create an AutoCAD Table

thanks for the Notes