-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from adrianhajdukiewicz1/feat/change-font
Feat/add changing font size in tray menu Ref #36
- Loading branch information
Showing
10 changed files
with
115 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,56 @@ | ||
namespace HuntAndPeck.ViewModels | ||
using HuntAndPeck.Properties; | ||
using System; | ||
using System.ComponentModel; | ||
using System.Windows; | ||
|
||
namespace HuntAndPeck.ViewModels | ||
{ | ||
internal class OptionsViewModel | ||
internal class OptionsViewModel : INotifyPropertyChanged | ||
{ | ||
public OptionsViewModel() | ||
{ | ||
DisplayName = "Options"; | ||
FontSize = Settings.Default.FontSize; | ||
Settings.Default.PropertyChanged += OnSettingsPropertyChanged; | ||
} | ||
|
||
public string DisplayName { get; set; } | ||
|
||
private string _fontSize; | ||
public string FontSize | ||
// Assign the font size value to a variable and update it every time user | ||
// changes the option in tray menu | ||
{ | ||
get { return _fontSize; } | ||
set | ||
{ | ||
if (_fontSize != value) | ||
{ | ||
_fontSize = value; | ||
OnPropertyChanged("FontSize"); | ||
Settings.Default.FontSize = value; | ||
Settings.Default.Save(); | ||
} | ||
} | ||
} | ||
|
||
|
||
private void OnSettingsPropertyChanged(object sender, PropertyChangedEventArgs e) | ||
{ | ||
if (e.PropertyName == "FontSize") | ||
{ | ||
FontSize = Settings.Default.FontSize; | ||
} | ||
} | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
private void OnPropertyChanged(string propertyName) | ||
{ | ||
if (PropertyChanged != null) | ||
{ | ||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters