void InitLocalization()
        {
            IEnumerable <odm.localization.Language> langs = odm.localization.Language.AvailableLanguages;

            odm.ui.controls.ListItem <odm.localization.Language>[] list = langs.Select(x => odm.ui.controls.ListItem.Wrap(x, y => y.DisplayName)).Where(u => u.Unwrap().iso3 != null).ToArray();

            var defItem = list.Where(x => x.Unwrap().iso3 == odm.ui.Properties.Settings.Default.DefaultLocaleIso3).FirstOrDefault();

            list.ForEach(x => LocalesCollection.Add(x.Unwrap()));

            if (defItem == null)
            {
                defItem = odm.ui.controls.ListItem.Wrap(odm.localization.Language.Default, x => "english");
                LocalesCollection.Add(defItem.Unwrap());
            }
            SelectedLocale = defItem.Unwrap();
        }
Exemplo n.º 2
0
        void LocaLization()
        {
            IEnumerable <odm.localization.Language> langs = odm.localization.Language.AvailableLanguages;

            odm.ui.controls.ListItem <odm.localization.Language>[] list = langs.Select(x => odm.ui.controls.ListItem.Wrap(x, y => y.DisplayName)).Where(u => u.Unwrap().iso3 != null).ToArray();

            var defItem = list.Where(x => x.Unwrap().iso3 == odm.ui.Properties.Settings.Default.DefaultLocaleIso3).FirstOrDefault();

            list.ForEach(x => langValue.Items.Add(x.Unwrap()));

            if (defItem == null)
            {
                defItem = odm.ui.controls.ListItem.Wrap(odm.localization.Language.Default, x => "english");
                LocalesCollection.Add(defItem.Unwrap());
            }

            langValue.SelectedItem = defItem.Unwrap();

            basePortCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.basePortCaption);
            eventTypeCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.eventTypeCaption);

            webCaption.CreateBinding(TextBlock.TextProperty, Strings, s => s.webbrowser);

            collectEventsCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.collectEventsCaption);
            enableCustomAnalyticsCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.enableCustomAnalyticsCaption);
            enableEventCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.enableEventCaption);
            enableGraphicAnnotationCaption.CreateBinding(TextBlock.TextProperty, Strings, s => s.enableGraphicAnnotationCaption);
            enableSnapshotCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.enableSnapshotCaption);
            langCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.langCaption);
            videoRenderingFpsCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.videoRenderingFpsCaption);
            enableOnlyDefMode.CreateBinding(TextBlock.TextProperty, Strings, x => x.enableOnlyDefModeCaption);
            showVideoPlaybackStatisticsCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.showVideoPlaybackStatisticsCaption);
            eventCaption.CreateBinding(GroupBox.HeaderProperty, Strings, x => x.eventCaption);
            transportCaption.CreateBinding(TextBlock.TextProperty, Strings, x => x.videotransport);


            applyButton.CreateBinding(Button.ContentProperty, ButtonStrings, x => x.apply);
            cancelButton.CreateBinding(Button.ContentProperty, ButtonStrings, x => x.cancel);

            uiCaption.CreateBinding(GroupBox.HeaderProperty, Strings, x => x.uiCaption);
            communicationCaption.CreateBinding(GroupBox.HeaderProperty, Strings, x => x.communicationCaption);

            this.CreateBinding(NavigationContext.TitleProperty, Titles, x => x.appsettings);
        }