private void UserSettingChanged(object sender, PropertyChangedEventArgs e) { PropertyInfo prop = sender.GetType().GetProperty(e.PropertyName); object newValue = prop?.GetValue(sender, null); log.Debug($"Setting change: {e.PropertyName} New Value: {newValue}"); switch (e.PropertyName) { case nameof(UserSettings.Setting.KeepOnTop): Topmost = (bool)newValue; break; case nameof(UserSettings.Setting.IncludeV6): InternalIP.GetMyInternalIP(); break; case nameof(UserSettings.Setting.IncludeDebug): NLHelpers.SetLogLevel((bool)newValue); break; case nameof(UserSettings.Setting.DarkMode): SetBaseTheme((int)newValue); break; case nameof(UserSettings.Setting.PrimaryColor): SetPrimaryColor((int)newValue); break; case nameof(UserSettings.Setting.UISize): int size = (int)newValue; double newSize = UIScale(size); MainGrid.LayoutTransform = new ScaleTransform(newSize, newSize); break; } }
private void Window_ContentRendered(object sender, EventArgs e) { InternalIP.GetMyInternalIP(); ExternalInfo.GetExtInfo(); }