<igTiles:XamTilesControl.ItemTemplateMaximized><DataTemplate>.....<igEditors:XamTextEditor Name="txtNavn2" Height="25" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="5,2" Text="{Binding Navn}"></igEditors:XamTextEditor>....</DataTemplate></igTiles:XamTilesControl.ItemTemplateMaximized>
This does not work -- no bindingbut if I use a TextBox it works
UpdateIf I put the XamTilesControl in a window it worksbut if I put the control in an usercontrol I have no databinding on XamTextEditoronly on TextBox
Hi Christian,
Would you be able to reproduce this odd behavior in a small sample? If so, please submit it here and I can determine if you've discovered a possible bug.
Thanks!
<UserControl.Resources>
<DataTemplate x:Key="normalTemplate">
<TextBlock Text="{Binding Navn}" />
</DataTemplate>
<DataTemplate x:Key="maximizedTemplate">
<StackPanel>
<igEditors:XamTextEditor Name="txtNavn" Text="{Binding Path=Navn}"/>
<TextBox Name="txtNavn2" Text="{Binding Path=Navn}" ></TextBox>
</StackPanel>
<DataTemplate x:Key="minimizedTemplate">
</UserControl.Resources>
<Grid>
<igTiles:XamTilesControl
Name="xamTilesControl1"
HeaderPath="Navn"
ItemTemplate="{StaticResource normalTemplate}"
ItemTemplateMaximized="{StaticResource maximizedTemplate}"
ItemTemplateMinimized="{StaticResource minimizedTemplate}" >
<igTiles:XamTilesControl.MaximizedModeSettings>
<igTiles:MaximizedModeSettings>
<igTiles:MaximizedModeSettings.MinimizedExpandedTileConstraints>
<igTiles:TileConstraints MinWidth="150" />
</igTiles:MaximizedModeSettings.MinimizedExpandedTileConstraints>
</igTiles:MaximizedModeSettings>
</igTiles:XamTilesControl.MaximizedModeSettings>
</igTiles:XamTilesControl>
</Grid>
txtNavn dont get databinding but txtNavn2 does
The problem is that there is 2 text boxes but only one get databinding
<igEditors:XamTextEditor
Name="txtNavn"
Text="{Binding Path=Navn}" />
<TextBox
Name="txtNavn2"
Text="{Binding Path=Navn}"></TextBox>
So is the second TextBox showing up blank when you run the project on your machine? Is it always blank for every tile that you mazimize or move around?
In the screenshot for my last post, you can see that the second TextBox contains the same text as the first. This seems to indicate that it is working for me. Am I perhaps missing a step to reproduce the problem on my machine? If not, do you have a secondary machine you can run this on to test (just in case there is a problem with your current installation)?
Thank you!
As I can in you screenshot you get the same error
the XamTextEditor is always blank, no databinding
TextBox And TextBlock controls always get databinding
OK. I finally understand what is going on. I missed that the XamTextEditor in your sample was not displaying the text.
When the editor goes into edit mode, the editor recalculates the text property by reconverting the value to a string. This causes the binding expression to not work. The solution is to bind to the 'Value' property, instead of 'Text'.
<igEditors:XamTextEditor Name="txtNavn" Value="{Binding Path=Navn}" />
If you prefer to use Text instead of Value, another solution is to set the property IsAlwaysInEditMode to true. Then the control will not enter or leave edit mode.
Sorry, I didn't spot this earlier in your XAML. Fortunately, your persistence has paid off!
Thanks for the replay
that works