예제 #1
0
        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;
            }
        }
예제 #2
0
        private void Window_ContentRendered(object sender, EventArgs e)
        {
            InternalIP.GetMyInternalIP();

            ExternalInfo.GetExtInfo();
        }