wildREA
Manually Showing MainWindow.xaml In App.xaml.cs (Dependency Injection)
Hey! My code is supposed to manually show MainWindow.xaml, but it doesn't if I remove
StartupUri="MainWindow.xaml"
and I get the error that is listed with details below with it. Without it, I get no error, so it must be my logic. The way I wrote it is because of dependency injection for AppLanguageServices.
App.xaml
App.xaml.cs
148 replies
How to Correctly Reference a Method in App.xaml.cs
Hey, reviewer. The
ChangeLanguage
method should work, but referencing is a challenge at the moment, since I get the error 'App' does not contain a definition for 'ChangeLanguage' and no accessible extension method 'ChangeLanguage' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?)
.
The OnLanguageChanged
method works until I add that reference for ((App)Application.Current)...
.
How do I correctly reference to a method in App.xaml.cs?
----
Settings.xaml.cs
App.xaml.cs
8 replies
✅ Ways to Add Language Support (WPF)
I'm creating a hardware monitor software that will show statistics of (primarily internal) components. There is a monitor and a settings user control to switch between the two. There are two user controls for the controls themselves and then a window, which is MainWindow that serves as the median between these two.
How would I go about switching languages dynamically in my XAML when a selected ComboBoxItem for a language is selected, which is applied upon clicking on the apply button? Like methods of implementation.
3 replies