473,799 Members | 2,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="WpfApp lication6.Windo w1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:WpfAp plication6"
Title="Window1" Height="300" Width="300">
<Window.Resourc es>
<ObjectDataProv ider
x:Key="ObjData"
IsInitialLoadEn abled="True"
ObjectType="{x: Type app:DummyClass} "
IsAsynchronous= "True"
/>
</Window.Resource s>

<StackPanel>
<app:UserContro l1 Dummy="{Binding Source={StaticR esource ObjData},
Path=Data, BindsDirectlyTo Source=True}" />
</StackPanel>
</Window>

Add a UserControl named UserControl1:
<UserControl x:Class="WpfApp lication6.UserC ontrol1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:WpfAp plication6"
>
<x:Code>
<![CDATA[
public static readonly DependencyPrope rty DummyProperty =
DependencyPrope rty.Register( "Dummy", typeof( DummyClass ),
typeof( UserControl1 ) );

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

<TextBlock Text="{Binding RelativeSource= {RelativeSource
FindAncestor, AncestorType={x :Type app:UserControl 1}},
Path=Dummy.MyPr operty}" />

</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 1316

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

Similar topics

17
7065
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 platforms at the same time on ONE database (server), I want different package names - e.g. module1.sqc should produce packages AMOD1, LMOD1, and WMOD1. So I tried the following db2 call for preparing:
1
7941
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 version of the MS Graph type library. Up until now I have been walking them through the process of setting the references to include their version of MS Graph library. My problem is that I can not seem to get the syntax correct .. or perhaps...
0
1599
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 haywire and the best solution was to blow away everything on the build server related to this solution (both filebase and virtual directories hanging off the default website). I recreated the shell of our solution's web projects...
30
2839
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 integer The integers in these arrays are actually pointers to different columns of data in a text file.
0
961
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 that! <g>). The issue I have is that after I open the form, the first record is displayed. I click the "move to next item" arrow and move to record 2. Repeat that, move to record 3. Next click moves to record 2. From there, I toggle between records 2...
9
2003
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", 20}, _ {"First", "String", 20} _ }
6
2451
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 track down erroneous behaviour of your app if you can't see where the problem is... i mean it's realy hard to debug binding issues and it would be realy of help if i could somehow enable this during debug session.
2
3718
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 win32com.client xl = win32com.client.Dispatch("Excel.Application") xl.Visible = False xl.ScreenUpdating = False
6
2905
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='<%# Eval("Ready").ToString()=="True"?System.Drawing.Color.FromName("#FFFF80"):System.Drawing.Color.White %>' Enabled='<%# Eval("Ready") %>'
6
4608
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 works fine: Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'
0
9686
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10475
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.