コード例 #1
0
        private void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CultureInfo selected_culture = cultureComboBox.SelectedItem as CultureInfo;

            if (Properties.Resources.Culture != null && !Properties.Resources.Culture.Equals(selected_culture))
            {
                Debug.WriteLine(string.Format("Change Current Culture to [{0}]", selected_culture));
                CultureResources.ChangeCulture(selected_culture);
            }
        }
コード例 #2
0
        public MainWindow()
        {
            string[] args = Environment.GetCommandLineArgs();
            this._utilityArguments = new UtilityArguments(args);
            InitializeComponent();
            CultureResources.ResourceProvider.DataChanged += new EventHandler(ResourceProvider_DataChanged);
            CultureResources.ChangeCulture(this._utilityArguments.Culture);
            this.cultureComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cbLanguages_SelectionChanged);
            this.cultureComboBox.SelectedItem      = this._utilityArguments.Culture;
            this._busyIndicator.IsBusy             = this._utilityArguments.UseBusyControl;
            this._mainPanel.IsEnabled              = !this._utilityArguments.UseBusyControl;
            this.Loaded += new RoutedEventHandler(this.MainWindow_Loaded);
            Person person = new Person();

            person.FirstName = "José";
            person.LastName  = "Salgado";
            this.PersonList  = new ObservableCollection <Person>();
            this.PersonList.Add(person);
        }