Hi,
I'm using a telerik combo box to show the possible cultures. To get this effect I'm using an image with the culture flag and a text box with the culture code (US, EN, FR, PT, etc)
The list of available cultures depends on the several things, so, I load this either at startup or by request.
The problem is when the collection is empty or I reset it (clear all items).
If this occurs, the error appears on the left bottom corner of the browser with the error " ag_e_network_error #4001" - from what I could see it has something to do with images.
Item object code:
XAML combo box definition:
Object "binded" to the combo box:
Could you please help me?
Thanks,
L. Pinho
I'm using a telerik combo box to show the possible cultures. To get this effect I'm using an image with the culture flag and a text box with the culture code (US, EN, FR, PT, etc)
The list of available cultures depends on the several things, so, I load this either at startup or by request.
The problem is when the collection is empty or I reset it (clear all items).
If this occurs, the error appears on the left bottom corner of the browser with the error " ag_e_network_error #4001" - from what I could see it has something to do with images.
Item object code:
/// <summary> |
/// Class used to match the items used to identify the culture information |
/// </summary> |
public class CultureInfoItem : INotifyPropertyChanged, IEquatable<CultureInfoItem> |
{ |
private string cultureInfoID; |
public string CultureInfoID |
{ |
get { return cultureInfoID; } |
set |
{ |
cultureInfoID = value; |
if (PropertyChanged != null) |
PropertyChanged(this, new PropertyChangedEventArgs("CultureInfoID")); |
} |
} |
private string cultureInfoFlag; |
public string CultureInfoFlag |
{ |
get { return cultureInfoFlag; } |
set |
{ |
cultureInfoFlag = value; |
if (PropertyChanged != null) |
PropertyChanged(this, new PropertyChangedEventArgs("CultureInfoFlag")); |
} |
} |
public CultureInfoItem(string cultureID) |
{ |
CultureInfoID = cultureID; |
CultureInfoFlag = string.Format("/Ngp.Presentation.Framework.GUI;component/Images/Flags/{0}.png", cultureID!=string.Empty?cultureID:"emptyFlag"); |
} |
#region INotifyPropertyChanged Members |
public event PropertyChangedEventHandler PropertyChanged; |
#endregion |
#region IEquatable<CultureInfoItem> Members |
public bool Equals(CultureInfoItem other) |
{ |
return (this.CultureInfoID == other.CultureInfoID); |
} |
#endregion |
} |
XAML combo box definition:
<telerikInput:RadComboBox x:Name="cmbCultureSelector" Width="42" Height="22" MinHeight="0" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Visible" Opacity="0.80" Margin="2,2,2,2" Grid.Row="1" Grid.Column="3" SelectionChanged="cmbCultureSelection_SelectionChanged"> |
<telerikInput:RadComboBox.ItemTemplate> |
<DataTemplate> |
<StackPanel Orientation="Horizontal"> |
<Image Source="{Binding Path=CultureInfoFlag}" Height="11" Margin="2,2,2,2"/> |
<TextBlock Text="{Binding Path=CultureInfoID}" FontFamily="Verdana" FontSize="9" VerticalAlignment="Center" /> |
</StackPanel> |
</DataTemplate> |
</telerikInput:RadComboBox.ItemTemplate> |
<telerikInput:RadComboBox.SelectionBoxItemTemplate> |
<DataTemplate> |
<Image Source="{Binding Path=CultureInfoFlag}" Height="11" Margin="2,0,2,2" VerticalAlignment="Center"/> |
</DataTemplate> |
</telerikInput:RadComboBox.SelectionBoxItemTemplate> |
</telerikInput:RadComboBox> |
Object "binded" to the combo box:
internal ObservableCollection<CultureInfoItem> cultureInfoCollection; |
Could you please help me?
Thanks,
L. Pinho