473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

WPF Binding issue

Hi,

I'm trying to understand why something does work. If you create a new
WPF Applicatin project, WpfApplication6, and set the following:

MainWindow.xaml:
<Window x:Class="WpfApplication6.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:WpfApplication6"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ObjectDataProvider
x:Key="ObjData"
IsInitialLoadEnabled="True"
ObjectType="{x:Type app:DummyClass}"
IsAsynchronous="True"
/>
</Window.Resources>

<StackPanel>
<app:UserControl1 Dummy="{Binding Source={StaticResource ObjData},
Path=Data, BindsDirectlyToSource=True}" />
</StackPanel>
</Window>

Add a UserControl named UserControl1:
<UserControl x:Class="WpfApplication6.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:WpfApplication6"
>
<x:Code>
<![CDATA[
public static readonly DependencyProperty DummyProperty =
DependencyProperty.Register( "Dummy", typeof( DummyClass ),
typeof( UserControl1 ) );

public DummyClass Dummy {
get { return (DummyClass)GetValue( DummyProperty ); }
set { SetValue( DummyProperty, value ); }
}
]]>
</x:Code>

<TextBlock Text="{Binding RelativeSource={RelativeSource
FindAncestor, AncestorType={x:Type app:UserControl1}},
Path=Dummy.MyProperty}" />

</UserControl>

And a class, DummyClass:
public class DummyClass {
public string MyProperty { get { return "My Text!"; } }
}
And run the program... the text is never displayed. If the
DataProvider is set not to be asyncronous, it works... but shouldn't
the property Data being changed when IsAsync = true cause the binding
to refresh?

Thanks
Andy
Oct 16 '08 #1
0 1296

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Jochen Luebbers | last post by:
Hi, I've a problem: I compile modules of embedded SQL (for a dynamic lib) on multiple platforms (AIX,Linux,Windows). They are compiled from the same source code. To be able to provide all...
1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
0
by: AC [MVP MCMS] | last post by:
I have a full blown VS.NET 2003 solution with a handful of library assemblies, two web projects, and a few web service projects. The entire solution is in VSS. Recently our build server went...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
0
by: Mike | last post by:
I wasn't real sure which was the best group for this post - please feel free to redirect to the appropriate group(s). My form uses a binding navigator to move through my data source (imagine...
9
by: Miro | last post by:
VB 2003 and Im still new to vb, so i hope i can explain this as best I can. I have a variable defined as such: ( simple example ) Dim AVariableOfSorts(,) As Object = _ { _ {"Last", "String",...
6
by: Mikus Sleiners | last post by:
Is there any way to enable exception throws in VS 2005, that occur during binding operations? I am upset that i can't see exceptions that are thrown during binding operations. It's very hard to...
2
by: kogrover | last post by:
ISSUE: COM Excel Sort works with Early Binding, but not Late Binding, but py2exe only does Late Binding I have code similar to this (type from notes, so there may be a typo...) import...
6
by: Dmitry Duginov | last post by:
Hi, I have the following label markup (label is inside FormView): <asp:Label ID="lblIndicatorReady" runat="server" Text="RE" ToolTip="Ready" BackColor='<%#...
6
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.