Beispiel #1
0
        /// <summary>
        /// Handles visibility changing of framework elements.
        /// </summary>
        /// <param name="sender">Sender of the event.</param>
        /// <param name="e">Event arguments.</param>
        private static void frameworkElement_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            FrameworkElement elem = sender as FrameworkElement;

            if (elem.IsVisible)
            {
                ObjectDataProvider provider = ((sender as FrameworkElement).Resources["Resources"] as ObjectDataProvider);
                provider.Refresh();
                CultureResources.registerDataProvider(provider);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles loading of a framework element.
        /// </summary>
        /// <param name="sender">Sender of the event.</param>
        /// <param name="e">Event arguments.</param>
        private static void FrameworkElement_Loaded(object sender, RoutedEventArgs e)
        {
            FrameworkElement elem = sender as FrameworkElement;

            if (elem.IsVisible == false)
            {
                // don't register the provider if this element is not visible. The problem is the element is never unloaded unless it is made
                // visible first. The visibility handler will register the provider when the element becomes visible.
                return;
            }
            ObjectDataProvider provider = (elem.Resources["Resources"] as ObjectDataProvider);

            provider.Refresh();
            CultureResources.registerDataProvider(provider);
        }
Beispiel #3
0
 public Login()
 {
     InitializeComponent();
     CultureResources.registerDataProvider(this);
 }
Beispiel #4
0
 public AccessLevel()
 {
     InitializeComponent();
     CultureResources.registerDataProvider(this);
 }