GetBindingExpression returns null when I have a binding

petko_stankoski

This is my ItemsControl code:

<ItemsControl Name="SearchItemsControl" ScrollViewer.CanContentScroll="True" ItemsSource="{Binding Path=SearchResult, IsAsync=True, UpdateSourceTrigger=Explicit}" Background="{StaticResource PopUpContentGradientBrush}" >

and yet this:

BindingExpression be = SearchItemsControl.GetBindingExpression(ItemsControl.ItemsSourceProperty);

returns null.

Why does it return null?

King King

There is a high chance that you check it when the element is not loaded. To be sure you should test the code such as in a Loaded event handler of the window:

//in the scope of your window class
Loaded += (s,e) => {
  var be = SearchItemsControl
            .GetBindingExpression(ItemsControl.ItemsSourceProperty);
  //be should not be null now.
};

Also be sure that your Binding is successful. Usually you can see the Output window, it will notify any Binding related error there.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

바인딩이 있으면 GetBindingExpression이 null을 반환합니다.

분류에서Dev

Why does NVL2 returns NULL when it's not expected?

분류에서Dev

Url.Content returns null when it has value

분류에서Dev

Angular Select List Binding an Object when I was expecting a Value

분류에서Dev

How can I have a WiX Property default to null?

분류에서Dev

FrameworkElement.GetBindingExpression이 데이터 바인딩 된 요소에 대해 null을 반환합니다.

분류에서Dev

When i run cron for a database function it returns me the same value

분류에서Dev

Why should I use IMemoryCache when we have IDistributedCache?

분류에서Dev

do I have to check login session when initiating PHP class?

분류에서Dev

How do I consolidate case when statements that have (SUM)?

분류에서Dev

How do I consolidate case when statements that have (SUM)?

분류에서Dev

Ubuntu Detects 2 monitors when I only have one

분류에서Dev

Django GraphQL returns null

분류에서Dev

Malloc returns null

분류에서Dev

Request .Form returns null

분류에서Dev

motd message, when I log in using ssh, tells me I have a mail, how I can check it?

분류에서Dev

Why does new $class; return null when class_exists($class) returns true?

분류에서Dev

ERROR TypeError : _co.userData is undefined In angular 7 when I try to use property binding for value

분류에서Dev

Why is my Workbook object null when I set it to activeworkbook?

분류에서Dev

should i set variable to null when user exits

분류에서Dev

What are my options when tackling a bug when I don't have the original project for web applications?

분류에서Dev

How can I avoid Firefox's "you have chosen to open" dialog when I try to download a file?

분류에서Dev

How do I get information from the logs on my computer when I only have access to the command line?

분류에서Dev

How can I color ocean with topojson in d3 when I have coordinate info for land?

분류에서Dev

Which flags do I have to use with du when I want a list with the sizes of the subdirectories?

분류에서Dev

JSON returns [null,null] in my app

분류에서Dev

CONCAT in stored procedure returns null

분류에서Dev

Why PrinterState always returns null?

분류에서Dev

Thread Timer returns NULL output

Related 관련 기사

  1. 1

    바인딩이 있으면 GetBindingExpression이 null을 반환합니다.

  2. 2

    Why does NVL2 returns NULL when it's not expected?

  3. 3

    Url.Content returns null when it has value

  4. 4

    Angular Select List Binding an Object when I was expecting a Value

  5. 5

    How can I have a WiX Property default to null?

  6. 6

    FrameworkElement.GetBindingExpression이 데이터 바인딩 된 요소에 대해 null을 반환합니다.

  7. 7

    When i run cron for a database function it returns me the same value

  8. 8

    Why should I use IMemoryCache when we have IDistributedCache?

  9. 9

    do I have to check login session when initiating PHP class?

  10. 10

    How do I consolidate case when statements that have (SUM)?

  11. 11

    How do I consolidate case when statements that have (SUM)?

  12. 12

    Ubuntu Detects 2 monitors when I only have one

  13. 13

    Django GraphQL returns null

  14. 14

    Malloc returns null

  15. 15

    Request .Form returns null

  16. 16

    motd message, when I log in using ssh, tells me I have a mail, how I can check it?

  17. 17

    Why does new $class; return null when class_exists($class) returns true?

  18. 18

    ERROR TypeError : _co.userData is undefined In angular 7 when I try to use property binding for value

  19. 19

    Why is my Workbook object null when I set it to activeworkbook?

  20. 20

    should i set variable to null when user exits

  21. 21

    What are my options when tackling a bug when I don't have the original project for web applications?

  22. 22

    How can I avoid Firefox's "you have chosen to open" dialog when I try to download a file?

  23. 23

    How do I get information from the logs on my computer when I only have access to the command line?

  24. 24

    How can I color ocean with topojson in d3 when I have coordinate info for land?

  25. 25

    Which flags do I have to use with du when I want a list with the sizes of the subdirectories?

  26. 26

    JSON returns [null,null] in my app

  27. 27

    CONCAT in stored procedure returns null

  28. 28

    Why PrinterState always returns null?

  29. 29

    Thread Timer returns NULL output

뜨겁다태그

보관