コード例 #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Image> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                var s = e.NewElement.Source as FileImageSource;
                if (s != null)
                {
                    fileName = s.File;
                    var ResourcePath = "";
                    try
                    {
                        ResourcePath = TizenResourceManager.TryGetPath(TizenResourceManager.Category.Image, fileName);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("[LocalizedImageRenderer] Error : " + ex.Message);
                    }

                    e.NewElement.Source = ResourcePath;
                }
            }
        }
コード例 #2
0
 // Invoked every time the language setting has been changed
 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
 {
     // Get the path of a proper image based on locale and update the source of an image
     Element.Source = TizenResourceManager.TryGetPath(TizenResourceManager.Category.Image, fileName);
 }