Click here to Skip to main content
15,890,438 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Visual Web Developer express 2010 Pin
Abhinav S1-Sep-11 22:29
Abhinav S1-Sep-11 22:29 
AnswerRe: Visual Web Developer express 2010 Pin
Columbus-MCSD2-Sep-11 4:37
Columbus-MCSD2-Sep-11 4:37 
QuestionWpf Pin
radhika 51-Sep-11 18:57
radhika 51-Sep-11 18:57 
AnswerRe: Wpf Pin
Abhinav S1-Sep-11 21:17
Abhinav S1-Sep-11 21:17 
GeneralRe: Wpf Pin
radhika 51-Sep-11 21:23
radhika 51-Sep-11 21:23 
GeneralRe: Wpf Pin
Saksida Bojan9-Sep-11 23:45
Saksida Bojan9-Sep-11 23:45 
QuestionSwitch between diffrent languages with indexers Pin
Mc_Topaz31-Aug-11 21:37
Mc_Topaz31-Aug-11 21:37 
AnswerRe: Switch between diffrent languages with indexers Pin
Wayne Gaylard31-Aug-11 23:13
professionalWayne Gaylard31-Aug-11 23:13 
I would use a custom class that contains a property for the index and another property for the actual word. Something like this:

C#
class LanguageItem
    {
        public int ID { get; set; }
        public string Word { get; set; }
    }


Then you could create a property in your viewmodel/codebehind that returns an ObservableCollection<LanguageItem> like this

C#
ObservableCollection<LanguageItem> words = new ObservableCollection<LanguageItem>();
       public ObservableCollection<LanguageItem> Words
       {
           get
           {
               return words;
           }
           set
           {
               if (words != value)
               {
                   words = value;
                   NotifyPropertyChanged("Words");
               }
           }
       }


You could populate this with with a method that reads and parses your language file appropriately.

Then you can bind your individual controls to the correct LanguageItem's Word like this


XML
<Label Content="{Binding Path=Words[0].Word}"/>
<Label Content="{Binding Path=Words[1].Word}" Grid.Column="1"/>


Hope this helps
Live for today. Plan for tomorrow. Party tonight!

GeneralRe: Switch between diffrent languages with indexers Pin
Mc_Topaz31-Aug-11 23:36
Mc_Topaz31-Aug-11 23:36 
GeneralRe: Switch between diffrent languages with indexers Pin
Wayne Gaylard31-Aug-11 23:40
professionalWayne Gaylard31-Aug-11 23:40 
GeneralRe: Switch between diffrent languages with indexers Pin
Mc_Topaz1-Sep-11 1:57
Mc_Topaz1-Sep-11 1:57 
GeneralRe: Switch between diffrent languages with indexers Pin
Pete O'Hanlon1-Sep-11 2:09
mvePete O'Hanlon1-Sep-11 2:09 
GeneralRe: Switch between diffrent languages with indexers Pin
Mc_Topaz1-Sep-11 2:23
Mc_Topaz1-Sep-11 2:23 
GeneralRe: Switch between diffrent languages with indexers Pin
Pete O'Hanlon1-Sep-11 3:27
mvePete O'Hanlon1-Sep-11 3:27 
GeneralRe: Switch between different languages with indexers Pin
Wayne Gaylard1-Sep-11 21:50
professionalWayne Gaylard1-Sep-11 21:50 
GeneralRe: Switch between different languages with indexers Pin
Pete O'Hanlon1-Sep-11 22:27
mvePete O'Hanlon1-Sep-11 22:27 
GeneralRe: Switch between different languages with indexers Pin
Wayne Gaylard1-Sep-11 23:05
professionalWayne Gaylard1-Sep-11 23:05 
GeneralRe: Switch between different languages with indexers Pin
Pete O'Hanlon1-Sep-11 23:29
mvePete O'Hanlon1-Sep-11 23:29 
GeneralRe: Switch between different languages with indexers Pin
Mycroft Holmes1-Sep-11 23:45
professionalMycroft Holmes1-Sep-11 23:45 
GeneralRe: Switch between diffrent languages with indexers Pin
Wayne Gaylard1-Sep-11 2:39
professionalWayne Gaylard1-Sep-11 2:39 
AnswerRe: Switch between diffrent languages with indexers Pin
Abhinav S1-Sep-11 1:13
Abhinav S1-Sep-11 1:13 
Questionsilverlight - backgroundworker process [modified] Pin
arkiboys31-Aug-11 18:41
arkiboys31-Aug-11 18:41 
AnswerRe: silverlight - backgroundworker process Pin
Mycroft Holmes31-Aug-11 19:28
professionalMycroft Holmes31-Aug-11 19:28 
GeneralRe: silverlight - backgroundworker process Pin
arkiboys31-Aug-11 19:30
arkiboys31-Aug-11 19:30 
AnswerRe: silverlight - backgroundworker process Pin
Pete O'Hanlon31-Aug-11 21:07
mvePete O'Hanlon31-Aug-11 21:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.