System windows data error 40

Ошибка - System.Windows.Data Error: 40 : BindingExpression path error: 'name' property not found on 'object' ' C# WPF Решение и ответ на вопрос 1569995

Igorian

1 / 1 / 0

Регистрация: 22.11.2013

Сообщений: 19

1

03.11.2015, 12:21. Показов 7233. Ответов 8

Метки wpf (Все метки)


Здравствуйте, у меня есть Главное окно, есть 2 контрола. В 1-ом контроле у меня listBox, во втором label, соединяю я их в MainWindow. Так вот, мне нужно, чтобы в главном окне я нажимал на listBox и у меня имя, выбранное в ListBox-е отображалось в Label.

Список выводит, но при нажатии ничего не происходит, а пишется ошибка
System.Windows.Data Error: 40 : BindingExpression path error: ‘name’ property not found on ‘object’ »UserControl1ViewModel’ (HashCode=48860040)’. BindingExpression:Path=name; DataItem=’UserControl1ViewModel’ (HashCode=48860040); target element is ‘UserControl1′ (Name=’me’); target property is ‘SelectedName’ (type ‘String’)

Кто-нибудь помогите, плз!

1.Главное окно —

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
 
            this.DataContext = new MainWindowViewModel();
        }
    }
 
    class MainWindowViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
 
        public string m_name;
 
        public string name
        {
            get { return m_name; }
            set
            {
                m_name = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("name"));
            }
        }
    }

xaml к MainWindow

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<Window x:Class="MyTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"
        
        xmlns:uc="clr-MyTest"
        >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="5*"/>
            <RowDefinition Height="6*"/>
        </Grid.RowDefinitions>
        <uc:UserControl1 Grid.Row="0" SelectedName="{Binding name, Mode=OneWayToSource}"/>
        <!--<Label Content="{Binding name}" Grid.Row="1"/>-->
        <uc:UserControl2 Grid.Row="1" DisplayName="{Binding name}"/>
    </Grid>
</Window>

,
есть 2 контрола — 1 Контрол ->

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
 
            this.DataContext = new UserControl1ViewModel();
            //lb.ItemsSource = new List<string>() { "Misha", "Masha", "Kosta" };
            //lb.ItemsSource = new ObservableCollection<string>(new List<string>() { "Misha", "Masha", "Kosta" });
        }
 
        public static DependencyProperty SelectedNameProperty = DependencyProperty.Register(
            "SelectedName",
            typeof(string),
            typeof(UserControl1),
            new UIPropertyMetadata(null)
            );
 
        public string SelectedName
        {
            get { return this.GetValue(SelectedNameProperty) as string; }
            set { SetValue(SelectedNameProperty, value); }
        }
    }
 
    public class UserControl1ViewModel : INotifyPropertyChanged// DependencyObject
    {
        public event PropertyChangedEventHandler PropertyChanged;
 
        public UserControl1ViewModel()
        {
            getSetToListBox = new ObservableCollection<string>(new List<string>() { "Misha", "Masha", "Kosta" });
            
            if(PropertyChanged!=null)
                PropertyChanged(this, new PropertyChangedEventArgs("getSetToListBox"));
        }
 
        public ObservableCollection<string> getSetToListBox { get; private set; }
 
        //public string name
        //{
        //    get;
        //    set;
        //}
    }

,
xaml 1 контрола ->

XML
1
2
3
4
5
6
7
8
9
10
11
12
<UserControl x:Class="MyTest.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             x:Name="me">
    <Grid>
        <ListBox ItemsSource="{Binding getSetToListBox}" SelectedItem="{Binding SelectedName, ElementName=me, Mode=OneWayToSource}"/>
    </Grid>
</UserControl>

,
2-ой контрол ->

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public partial class UserControl2 : UserControl
    {
        public UserControl2()
        {
            InitializeComponent();
        }
 
        public static DependencyProperty DisplayNameProperty = DependencyProperty.Register(
            "DisplayName",
            typeof(string),
            typeof(UserControl2)
            );
 
        public string DisplayName
        {
            get { return this.GetValue(DisplayNameProperty) as string; }
            set { SetValue(DisplayNameProperty, value); }
        }
    }

,
xaml 2контрола ->

XML
1
2
3
4
5
6
7
8
9
10
11
12
<UserControl x:Class="MyTest.UserControl2"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             x:Name="me"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Label Content="{Binding DisplayName, ElementName=me, Mode=OneWay}"/>    
    </Grid>
</UserControl>

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



amarf

Жуткая тВарЬ

389 / 325 / 134

Регистрация: 06.02.2015

Сообщений: 960

Записей в блоге: 1

03.11.2015, 14:19

2

XML
1
<uc:UserControl1 Grid.Row="0" SelectedName="{Binding name, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>



1



1 / 1 / 0

Регистрация: 22.11.2013

Сообщений: 19

03.11.2015, 23:09

 [ТС]

3

Неа, не помогает, теперь вылетает ошибка ->

System.Windows.Data Error: 40 : BindingExpression path error: ‘name’ property not found on ‘object’ »MainWindow’ (Name=»)’. BindingExpression:Path=name; DataItem=’MainWindow’ (Name=»); target element is ‘UserControl1′ (Name=’me’); target property is ‘SelectedName’ (type ‘String’)



0



Жуткая тВарЬ

389 / 325 / 134

Регистрация: 06.02.2015

Сообщений: 960

Записей в блоге: 1

04.11.2015, 20:56

4

Так перенесите свойство в клпасс окна… Вы вообще про привязку читали?

Добавлено через 6 минут
Так по ходу я дурак))} перечитал первый пост внимательно…. Вы когда создаёте ваш контрол сразу задаете ему вьюмодель в датаконтексте вот в ней привязка и пытается найти свойство, а надо искать в датаконтексте окна… Т.е. Либо убирайте из контрола датаконтекст, либо делаете привязку как в моем посте выше но только вместо nane пишем datacontext.name



1



Igorian

1 / 1 / 0

Регистрация: 22.11.2013

Сообщений: 19

05.11.2015, 18:57

 [ТС]

5

Извиняюсь, но я новичок в этом деле и пытаюсь понять, как это работает.

Вот написал ->

C#
1
<uc:UserControl1 Grid.Row="0" SelectedName="{Binding DataContext.name, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>

Ошибка исчезла, но проблема с передачей данных осталась. Т.е. если нажимаешь на строку таблицы 1Контрола, ничего не происходит во 2ом Контроле.

А как тогда должна инфа передаваться в этот 2ой контрол ->

C#
1
<uc:UserControl2 Grid.Row="1" DisplayName="{Binding name}"/>

Изначально я передавал данные из SelectedName(1Контрол) в name (Главного окна), затем из name(Главного окна) передавалось в DisplayName(2го Контрола). А теперь чего делать?

Сейчас из SelectedName(1Контрол) в DataContext.name (Главного окна), затем из … что куда должно передаться, чтоб отобразилось во 2омКонтроле?



0



Жуткая тВарЬ

389 / 325 / 134

Регистрация: 06.02.2015

Сообщений: 960

Записей в блоге: 1

05.11.2015, 20:20

6

Igorian, Вам быпочитать про mvvm, принципы построения слобосвязанных приложений и много чего еще, но это кучу времени потратите, но оно тогг стоит. Так, что если есть время то начните чтение с внедрения зависимостей ибо на этом принципе и паттерне стратегия уйма всего устроено… Ну естественно по wpf тоже надо читать, но не так много…

Я могу Вам накидать пример под Вашу задачу, только опишите что хотите получить от работы программы, применение юзерконтролов у вас не обоснованно и не нужно



1



1 / 1 / 0

Регистрация: 22.11.2013

Сообщений: 19

05.11.2015, 21:30

 [ТС]

7

Спасибо за инфу о том, что нужно почитать. Это я обязательно сделаю.

Насчет необоснованных контролов — да, я согласен, в этом примере они не нужны, но у меня есть приложение, в котором я использую avalonDock. Там нужны контролы, которые будут подгружаться в качестве отдельных окон и которые будут использоваться в разных местах.

А этот пример я взял для того, чтобы понять, как это дело работает.

Я делал все это дело без viewModel, все получилось, а вот когда я использую viewModel, вот ничего и не получается.

Задача у меня такая — Есть 2 Контрола: — 1Контрол — Таблица listBox/ListView(В ней выбирается строка для отображения во втором контроле), 2Контрол — Label, в который записывается просто имя , выбранное из первого контрола. И все это связано через MainWindow. Потом я вместо имени буду данные из базы закидывать и подружать
их в другие таблицы, а вот сейчас хотябы на самом простом примере понять.



0



Жуткая тВарЬ

389 / 325 / 134

Регистрация: 06.02.2015

Сообщений: 960

Записей в блоге: 1

06.11.2015, 10:17

8

В общем накидал пример, единственное, что я решил сделать с использованием аггрегатора событий из библиотеки призм (короче надо устанавливать через Nuget пакет Prism.PubSubEvents) — зато он убирает кучу всякой хрени в которой можно запутаться (в частности излишнюю управляющую вьюмодель и колбэки с подписками)

Так же прощу обратить внимание, что есть специальный класс Boot в котором назначаются вьюмодели для наших контролов — ТАК ДЕЛАТЬ НЕЛЬЗЯ — но поскольку я не стал нагружать проект еще и контейнером внедрения зависимости, мне показалось, что такой подход будет понятнее…

AggregateMVVM.zip

П.С. На самом деле «по настоящему» все делается немножко сложнее (и в тоже время легче если знаешь материал), но для этого надо знать хотя бы про Внедрение зависимостей в .Net и несколько паттернов



1



1 / 1 / 0

Регистрация: 22.11.2013

Сообщений: 19

07.11.2015, 10:04

 [ТС]

9

amarf, Спасибо огромное за написанный вами пример!
Буду разбираться…



0



Greetings;

I’m having difficulty using WPF’s support for Data Binding a generic List<> instance to a Read-Only DataGrid inside a Window.  To setup the Data Binding, I have the following in place in the code:

1.) I set the Window’s DataContext to a reference type of FormattedStackTrace exposed as a public property named StackTrace.  The DataContext is set in the Window’s class constructor in C# as follows:

        public CallStackDialog(Window owner,
               FormattedStackTrace stackTrace)
        {
            InitializeComponent();
            this.Owner = owner;

            StackTrace = stackTrace;
            DataContext = StackTrace;

            return;
        }

The instance of StackTrace is non-null, and I can access and view all of its property members through the StackTrace property as expected.  Likewise, the Window’s DataContext is a non-null value.

2.) The StackTrace property is implemented in the same window class as follows:

        private FormattedStackTrace formattedStackTrace;

        public FormattedStackTrace StackTrace
        {
            get
            {
                return formattedStackTrace;
            }

            set
            {
                formattedStackTrace = value;
                NotifyPropertyChanged("StackTrace");
            }
        }

3.) The FormattedStackTrace class contains an instance of List<OrderedCall> as an auto property named OrderedStackTrace.  I am trying to bind this collection as the ItemsSource for the DataGrid in the window. The relative members of the FormattedStackTrace,
which is the backing reference type for the Window’s DataContext, is as follows:

    public class FormattedStackTrace
    {
#region FormattedStackTrace Class Data Members & Auto-Properties

        private StackFrame[] sourceStackFrame;
        public MethodBase CallingMethod { get; private set; }
        public List<OrderedCall> OrderedStackTrace { get; private set; }

#endregion
    }

OrderedStackTrace is a List<OrderedCall>, where each List member is an instance of the following structure:

    public struct OrderedCall
    {
        public int Call;
        public string Method;
    }; 

At the point where the DataContext is set inside the parent Window’s class constructor, the OrderedStackTrace property is correct, in that it contains the expected number of OrderedCall instance values, and they can be viewed without issue inside any of the
Debugging tabs inside Visual Studio 2010, or inside the IDE’s Immediate Window:

    ? StackTrace.OrderedStackTrace == null
    false
    ? StackTrace.OrderedStackTrace.Count
    40
    ? StackTrace.OrderedStackTrace[39]
    {WPFEventHandling.OrderedCall}
        Call: 40
        Method: «WPFEventHandling.MainWindow.OnMousePointerEnteredButton(Object sender, MouseEventArgs e)»

4.) The DataGrid inside the Window I’m trying to bind to, StackTraceDataGrid, which is read only, is implemented in XAML as follows:

<DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" 
          Name="StackTraceDataGrid" IsReadOnly="True"
          AutoGenerateColumns="False" Margin="10" 
          ItemsSource="StackTrace.OrderedStackTrace">
    <DataGrid.Columns>
        <DataGridTextColumn Header="Offest" 
         Binding="{Binding Call}" Width="60">
        </DataGridTextColumn>
        <DataGridTextColumn Header="Method" 
         Binding="{Binding Method}" Width="*">
        </DataGridTextColumn>
    </DataGrid.Columns>
</DataGrid>

When I build the solution containing this Window and  the child StackTraceDataGrid control, there are no errors nor compiler warnings. When I bring up the parent window that contains StakTraceDataGrid, the DataGrid and the two Text Columns, Offset and
Method, are rendered and formatted as expected, but each row in the DataGrid is empty.  When the Window is brought up, the following set of runtime messages appear for each pair of OrderedCall member values in each column for each row:

System.Windows.Data Error: 40 : BindingExpression path error: ‘Call’ property not found on ‘object’ »Char’ (HashCode=7471218)’. BindingExpression:Path=Call; DataItem=’Char’ (HashCode=7471218); target element is ‘TextBlock’ (Name=»); target property is ‘Text’
(type ‘String’)
System.Windows.Data Error: 40 : BindingExpression path error: ‘Method’ property not found on ‘object’ »Char’ (HashCode=7471218)’. BindingExpression:Path=Method; DataItem=’Char’ (HashCode=7471218); target element is ‘TextBlock’ (Name=»); target property is
‘Text’ (type ‘String’)

As far as I can tell, I think that my problem may lie in how I’ve defined the ItemsSource property for the DataGrid, and the Binding Path for each column for each instance of OrderedCall as I would like to have displayed in each row of the Grid.

I would really appreciate any corrections on how to resolve the BindingExpression path errors I’m seeing at runtime, as well as any background informatio on what each DataGrid Column is expecting for a Binding Path for each item in each row of the DataGrid.

Thank you in advance for your time and help, and I look forward to hearing from you soon.

Содержание

  1. System windows data error 40 bindingexpression path error
  2. Answered by:
  3. Question

System windows data error 40 bindingexpression path error

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I’m having difficulty using WPF’s support for Data Binding a generic List<> instance to a Read-Only DataGrid inside a Window. To setup the Data Binding, I have the following in place in the code:

1.) I set the Window’s DataContext to a reference type of FormattedStackTrace exposed as a public property named StackTrace. The DataContext is set in the Window’s class constructor in C# as follows:

The instance of StackTrace is non-null, and I can access and view all of its property members through the StackTrace property as expected. Likewise, the Window’s DataContext is a non-null value.

2.) The StackTrace property is implemented in the same window class as follows:

3.) The FormattedStackTrace class contains an instance of List as an auto property named OrderedStackTrace. I am trying to bind this collection as the ItemsSource for the DataGrid in the window. The relative members of the FormattedStackTrace, which is the backing reference type for the Window’s DataContext, is as follows:
OrderedStackTrace is a List , where each List member is an instance of the following structure:
At the point where the DataContext is set inside the parent Window’s class constructor, the OrderedStackTrace property is correct, in that it contains the expected number of OrderedCall instance values, and they can be viewed without issue inside any of the Debugging tabs inside Visual Studio 2010, or inside the IDE’s Immediate Window:

? StackTrace.OrderedStackTrace == null
false
? StackTrace.OrderedStackTrace.Count
40
? StackTrace.OrderedStackTrace[39]

Call: 40
Method: «WPFEventHandling.MainWindow.OnMousePointerEnteredButton(Object sender, MouseEventArgs e)»

4.) The DataGrid inside the Window I’m trying to bind to, StackTraceDataGrid, which is read only, is implemented in XAML as follows:

When I build the solution containing this Window and the child StackTraceDataGrid control, there are no errors nor compiler warnings. When I bring up the parent window that contains StakTraceDataGrid, the DataGrid and the two Text Columns, Offset and Method, are rendered and formatted as expected, but each row in the DataGrid is empty. When the Window is brought up, the following set of runtime messages appear for each pair of OrderedCall member values in each column for each row:

System.Windows.Data Error: 40 : BindingExpression path error: ‘Call’ property not found on ‘object’ »Char’ (HashCode=7471218)’. BindingExpression:Path=Call; DataItem=’Char’ (HashCode=7471218); target element is ‘TextBlock’ (Name=»); target property is ‘Text’ (type ‘String’)
System.Windows.Data Error: 40 : BindingExpression path error: ‘Method’ property not found on ‘object’ »Char’ (HashCode=7471218)’. BindingExpression:Path=Method; DataItem=’Char’ (HashCode=7471218); target element is ‘TextBlock’ (Name=»); target property is ‘Text’ (type ‘String’)

As far as I can tell, I think that my problem may lie in how I’ve defined the ItemsSource property for the DataGrid, and the Binding Path for each column for each instance of OrderedCall as I would like to have displayed in each row of the Grid.

I would really appreciate any corrections on how to resolve the BindingExpression path errors I’m seeing at runtime, as well as any background informatio on what each DataGrid Column is expecting for a Binding Path for each item in each row of the DataGrid.

Thank you in advance for your time and help, and I look forward to hearing from you soon.

Источник

Hello,

I have changed the title of my question because I don’t understand this error in the binding with the view.I know how to read it,but i don’t understand it’s cause or how should I change the syntax for it in a proper solution.This is my method for storing values:

View-Model:

public void SaveTeacher(object param)
        {

            using (DatabaseStudentsEntitiesLastStand db = new DatabaseStudentsEntitiesLastStand())
            {
              
                RegisterTeacher t = new RegisterTeacher();

                if (isChecked == true || t.CourseName != null)
                {
                    t.CourseName = courseName;

                }
                t.SNTeacher = SNTeacher;
                t.UserName = _UserName;
                t.pwd = pwd;
                t.fullName = fullName;
                t.education = education;

                db.RegisterTeachers.Attach(t);
               
                try
                {
                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                   
                            MessageBox.Show(ex.Message);
                       
                }
            }
        }

This is the isChecked property:

private bool isChecked;
        public bool IsChecked
        {
            get
            {
                return IsChecked;
            }
            set
            {
                if (isChecked != value)
                {
                    isChecked = value;
                    NotifyOnPropertyChange("IsChecked");
                }
            }
        }
        private DelegateCommand checkCommand;
        public DelegateCommand CheckCommand
        {
            get
            {
                if (checkCommand == null)
                    checkCommand = new DelegateCommand(SaveTeacher, null);
                return checkCommand;
            }
            set
            {
                checkCommand = value;
                NotifyOnPropertyChange("CheckCommand");
            }
        }

This is the binding with the view:

<Button Content="Submit" Command="{Binding SaveCommand}"  HorizontalAlignment="Left" Margin="517,98.4,0,0" Grid.Row="2" VerticalAlignment="Top" Width="110" Height="40"/>
        <Button Content="Cancel"  HorizontalAlignment="Left" Margin="361,98.4,0,0" Grid.Row="2" VerticalAlignment="Top" Width="111" Height="40"/>
        <ListBox  HorizontalAlignment="Left" Name="coursesList" Height="240"   Margin="418,13.2,0,0" Grid.Row="1" VerticalAlignment="Top" Width="225" Grid.RowSpan="2"  ItemsSource="{Binding Courses}" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox x:Name="CheckBoxCourses" Click="CheckBoxCourses_Click"
                              IsChecked="{Binding Path=IsChecked,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
                           Command="{Binding CheckCommand,Mode=TwoWay}"

                            Content="{Binding Path=courseName,Mode=TwoWay}" Margin="0"/>


                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

This is the Checked event:

private void CheckBoxCourses_Checked(object sender, RoutedEventArgs e)
        {
            var checkbox = sender as CheckBox;
            if(checkbox!=null)
            {
                checkbox.IsChecked =true;
            }


          
        }

What I have tried:

This is the entire error:

System.Windows.Data Error: 40 : BindingExpression path error: 'IsSelected' property not found on 'object' ''Cours' (HashCode=44335814)'. BindingExpression:Path=IsSelected; DataItem='Cours' (HashCode=44335814); target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1')

I have tried multiple solutions with delegatecommand,selecteditem in the listbox and IsSelected property,read-only properties,nothing is working.Since I have tried many approaches,I have moved the property IsChecked from the view-model to the model class named «Cours» along with NotifyPropertyChanged(so it basically looks like the one I have in my example,only that it is in the model,not vm).Can someone please tell me what would be the problem based on this error?Please notify me if you need certain lines of code.

I guess it is the error message that seems having nothing to do with Win Form makes people hesitate to response to your question. The error message looks like somehow related to WPF UI. Also, when you say «… show this in debug», what does «debug» mean? where exactly do you see the error message? A pop-up window in AutoCAD, where you can click either «Detail» to see more error message, or «Continue», which would either let AutoCAD continue. if the error is not that fatal, or let AutoCAD die?

Anyway, if your Form1 is a true win form, regardless the strange error, your code in the CommandMethod is very wrong, in 2 ways:

1. You DO NOT show dialog form (modal view) with Form.ShowDialog() in AutoCAD .NET API add-in. You must use AutoCAD .NET API method

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog[Window]()

2. You DO NOT sandwich all the code (showing the dialog box, and then user may do something to AutoCAD by interacting with the form) with a Transaction and only not commit it (which means whatever user does to AutoCAD would be aborted when you close the dialog form. That is why the line drawn by the button clicking action is not there: it is lost after you close the form. because the outer-most transaction is not commited (thus, aborted automatically).

While letting UI’s event handler (button clicking, in your case) directly interact with AutoCAD isn’t a very good code practice, I think you can live with that for now (as beginner?), thus, the simple fix to your code is to modify the CommandMethed as following:

       [CommandMethod("ACADPipe")]
        public static void pipe()
        {
            using (Form1 form1 = new Form1())
            {
                Application.ShowModalDialog(form1);
            }
        }

And, in your drawTestLine_Click() method, you might want to add

ed.UpdateScreen()

at the end of the Transaction, if you want the newly created line to be seen without dismissing the dialog box.

Понравилась статья? Поделить с друзьями:
  • System web mvc error
  • System web httpapplication error
  • System voltage not optimized как исправить
  • System thread exception not handled windows 10 как исправить ошибку
  • System thread exception not handled win 10 ошибка