This is a migrated thread and some comments may be shown as answers.

[Solved] Binding to ElementName in WP7

5 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kamil
Top achievements
Rank 1
Kamil asked on 25 Feb 2012, 04:22 PM

I have a problem with dynamic xaml loading in WP7 application.

Dashboard content = XamlReader.Load(PathToXamlFile) as Dashboard;

Xaml file code:

<g:Dashboard xmlns:g="http://schemas.xxx.com/mobile"
 
<g:Dashboard.ObserverDefinitions>       
    <g:DoubleObserver x:Name="DoubleName" EntityName="entName" UpdateRate="1000" Value="12.3"/>
</g:Dashboard.ObserverDefinitions>
 
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>
 
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=DoubleName,   Path=Value}"/>
</Grid>
 
</g:Dashboard>

Double observer implements INotifyPropertyChanged. While using WPF for desktop application, after dynamic loading, PropertyChangedEvent is set properly. However on WP7 it is null.

Have You got any idea, if there is an workaround for this problem?

5 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 28 Feb 2012, 03:41 PM
Hi Kamil,

I tested a simple scenario with an object that implements INotifyPropertyChanged and the binding to a property of that object works as expected.

Please send a sample application that demonstrates the issue so that I may assist you.

Regards,
Victor
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Kamil
Top achievements
Rank 1
answered on 28 Feb 2012, 06:09 PM
Hi!
I've made a Sample app, but where can I send it? 

Kamil
0
Victor
Telerik team
answered on 29 Feb 2012, 08:47 AM
Hi Kamil,

You need to open a support ticket and attach the app. You can't attach files in a forum post.
Please open a support ticket so that I may assist you.

Kind regards,
Victor
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Kamil
Top achievements
Rank 1
answered on 29 Feb 2012, 04:47 PM
Hi!
I've just make a ticket: I hope, that You will find what is wrong with my code - "Your ticket ID is: 517625"


Small update:
After set binding in codebehind:
Grid g = content.Content as Grid;
TextBox t = g.Children[0] as TextBox;
Binding binding = new Binding();
binding.Source = content.ObserverDefinitions[0];
binding.Path = new PropertyPath("Value");
t.SetBinding(TextBox.TextProperty, binding);

everything is done properly. So dynamic binding is not working in wp7 (this is my final thought, but I still wait for You answer about my SampleApp)

Have a nice day!
Kamil
0
Eugeniy
Top achievements
Rank 2
answered on 25 Jul 2012, 08:40 AM
Is double name  null?
Tags
General Discussions
Asked by
Kamil
Top achievements
Rank 1
Answers by
Victor
Telerik team
Kamil
Top achievements
Rank 1
Eugeniy
Top achievements
Rank 2
Share this question
or