How to acces a window from the main project in a library project?

69 Views Asked by At

I am working on a c# WPF solution with a main project and 3 library projects. In the main project there is a window with this refresh methode to update changes I make to content.

public static class ExtensionMethods
    {
        private static readonly Action EmptyDelegate = delegate { };
        public static void Refresh(this UIElement uiElement)
        {
            uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
        }
    }

In the App.xaml.cs file I can use this refresh methode like this :

startupScreen.Worker.Content = "bla bla bla...";
startupScreen.Worker.Refresh();

That changes the content of the label Worker and refreshes the UI.

But now I also need the do this form one of the library projects. I can update the text by passing startupScreen.Worker as a parameter to a methode, but how can I acces the Refresh methode ?

Or are there other/better ways to update that label and force refresh the UI ?

0

There are 0 best solutions below